• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Products类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Products的典型用法代码示例。如果您正苦于以下问题:C# Products类的具体用法?C# Products怎么用?C# Products使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Products类属于命名空间,在下文中一共展示了Products类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: loadGridView

    /// <summary>
    /// Method which loads the gridview with all the Products.
    /// </summary>
    protected void loadGridView()
    {
        Products product = new Products();

        GridView1.DataSource = product.getAllProducts();
        GridView1.DataBind();
    }
开发者ID:efigarolam,项目名称:Snackthat,代码行数:10,代码来源:viewallproducts.aspx.cs


示例2: rpNews_ItemCommand

    protected void rpNews_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string strCommand = e.CommandName;
        int nID = ConvertData.ConvertToInt(e.CommandArgument);
        Products objProduct = new Products();
        switch (strCommand)
        {
            case "Delete":
                objProduct.LoadById(nID);
                Support.DeleteFile("product", objProduct.Data.Images);
                Support.DeleteFolder("productimg",nID);
                int nDelete = objProduct.DeleteById(nID);
                BindDataToGrid(1);
                break;

            case "Edit":

                string sEdit = Constants.ROOT + Pages.BackEnds.ADMIN + "?" + Constants.PAGE + "=" + Pages.BackEnds.STR_PRODUCT_ADD + "&" + Constants.ACTION + "=" + Constants.ACTION_EDIT + "&" + Constants.ACTION_ID + "=" + nID;
                Response.Redirect(sEdit);
                break;
            case "Active":
                int nActive = objProduct.UpdateStatus(nID, EnumeType.INACTIVE);

                BindDataToGrid(1);
                break;

            case "Inactive":
                int nInactive = objProduct.UpdateStatus(nID, EnumeType.ACTIVE);

                BindDataToGrid(1);
                break;
        }
    }
开发者ID:changtraicantinh,项目名称:atpgroup,代码行数:33,代码来源:ProductMain.ascx.cs


示例3: EsDataSource1_esCreateEntity

    protected void EsDataSource1_esCreateEntity(object sender, EntitySpaces.Web.esDataSourceCreateEntityEventArgs e)
    {
        ProductsQuery p = new ProductsQuery("p");
        CategoriesQuery c = new CategoriesQuery("c");

        p.Select(p, c.CategoryName);
        p.InnerJoin(c).On(p.CategoryID == c.CategoryID);

        if (e.PrimaryKeys != null)
        {
            p.Where(p.ProductID == (int)e.PrimaryKeys[0]);
        }
        else
        {
            // They want to add a new one, lets do a select that brings back
            // no records so that our CategoryName column (virutal) will be
            // present in the underlying record format
            p.Where(1 == 0);
        }

        Products prd = new Products();
        prd.Load(p);  // load the data (if any)

        // Assign the Entity
        e.Entity = prd;
    }
开发者ID:stacyjeptha,项目名称:EntitySpaces-CompleteSource,代码行数:26,代码来源:Join.aspx.cs


示例4: GetProducts

 /// <summary>
 /// Gets the list of products.
 /// </summary>
 /// <returns>
 /// Returns the list of products.
 /// </returns>
 public static Products GetProducts()
 {
     var products =
         new Products(
             new List<Product>()
                 {
                     new Product()
                         {
                             ProductId = 1,
                             Name = "ABC",
                             Description = "Product ABC",
                             Href = "/product/1",
                             Links =
                                 {
                                     new Link() { Rel = "collection", Href = "/products" },
                                     new Link() { Rel = "template", Href = "/product/{productId}" },
                                 }
                         },
                     new Product()
                         {
                             ProductId = 2,
                             Name = "XYZ",
                             Description = "Product XYZ",
                             Href = "/product/2",
                             Links =
                                 {
                                     new Link() { Rel = "collection", Href = "/products" },
                                     new Link() { Rel = "template", Href = "/product/{productId}" },
                                 }
                         },
                 });
     return products;
 }
开发者ID:aliencube,项目名称:Aliencube.WebApi.Hal,代码行数:39,代码来源:ProductHelper.cs


示例5: PutProducts

        public IHttpActionResult PutProducts(int id, Products products)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != products.Product_ID)
            {
                return BadRequest();
            }

            db.Entry(products).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProductsExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:ZeroFata,项目名称:UX-ChickenAPI,代码行数:32,代码来源:ProductsController.cs


示例6: PrintProductVSByCategory

    void PrintProductVSByCategory(Remix.Category category, StringBuilder sb)
    {
        Products products = new Products();
        int.TryParse(Request["page"], out products.CurrentPage);
        products.CurrentPage = products.CurrentPage == 0 ? 1 : products.CurrentPage;
        BestBuyCategoryProductsFiller.Do(products, category);

        sb.Append("<div>");
        sb.Append("<h2>Product VS Pair List - Total " + products.TotalPages + " Pages</h2>");

        sb.Append("<ul class='better-ranked'>");

        foreach (var product in products)
        {
            ProductPool.Cache(product, CacheType.Simple);

            sb.Append(@"
        <li>
        <a href='/P.aspx?upc=" + product.UPC + @"&title=" + HttpUtility.UrlEncode(HttpUtility.HtmlEncode(product.Name)) + @"' title='" + product.Name + (product.BBYSalePrice > 0 ? " $" + product.BBYSalePrice : "") + @"'>
        <img src='" + (string.IsNullOrEmpty(product.LargeImageUrl) ? product.ThumbnailImageUrl : product.LargeImageUrl) + @"' /><br />
        " + product.Name + @"
        " + (product.BBYSalePrice > 0 ? "<br /><span style='color:#000'>$" + product.BBYSalePrice + "</span>" : "") + @"
        </a>
        </li>
        ");
        }
        sb.Append("</ul>");
        sb.Append("<div class='clear' style='width:100%;'></div>");

        sb.Append("</div>");

        //page
        string baseUrl = "/Category.aspx?id=" + HttpUtility.UrlEncode(category.Id);
        HTMLGenerator.PrintPageNav(products.CurrentPage, products.TotalPages, baseUrl, sb);
    }
开发者ID:jimji2008,项目名称:ProcutVS,代码行数:35,代码来源:Category.aspx.cs


示例7: BuildControl

        protected override void BuildControl(System.Web.Mvc.TagBuilder builder, Products.CustomFieldDefinition field, string value, object htmlAttributes, System.Web.Mvc.ViewContext viewContext)
        {
            builder.AddCssClass("form-list");

            var itemsHtml = new StringBuilder();
            var i = 0;

            foreach (var item in field.SelectionItems)
            {
                itemsHtml.AppendLine("<li>");

                var radioId = field.Name + "_" + i;
                var radio = new TagBuilder("input");
                radio.MergeAttribute("id", radioId);
                radio.MergeAttribute("type", "radio");
                radio.MergeAttribute("name", field.Name);
                radio.MergeAttribute("value", item.Value);

                var label = new TagBuilder("label");
                label.InnerHtml = item.Text;
                label.AddCssClass("inline");
                label.MergeAttribute("for", radioId);

                itemsHtml.AppendLine(radio.ToString(TagRenderMode.SelfClosing));
                itemsHtml.AppendLine(label.ToString());

                itemsHtml.AppendLine("</li>");

                i++;
            }

            builder.InnerHtml = itemsHtml.ToString();

            base.BuildControl(builder, field, value, htmlAttributes, viewContext);
        }
开发者ID:Kooboo,项目名称:Ecommerce,代码行数:35,代码来源:RadioList.cs


示例8: PrintProductVSByCategory

        public static void PrintProductVSByCategory(string categoryId)
        {
            Products products = new Products();
            BestBuyCategoryProductsFiller.Do(products, new Remix.Category() { Id = categoryId });

            foreach (var product in products)
            {
                ProductPool.Cache(product, CacheType.Simple);
            }

            Dictionary<string, string> VSDic = new Dictionary<string, string>();
            foreach (var product in products)
            {
                foreach (var similarProduct in product.SimilarProducts)
                {
                    Product filledSimilarProduct = ProductPool.GetByBestBuySKU(similarProduct.BBYSKU, CacheType.Simple);
                    ProductPool.Cache(filledSimilarProduct, CacheType.Simple);

                    if (filledSimilarProduct.BBYCategoryPath != null
                        && filledSimilarProduct.BBYCategoryPath[filledSimilarProduct.BBYCategoryPath.Length - 1].Id
                        == product.BBYCategoryPath[product.BBYCategoryPath.Length - 1].Id)
                    {
                        VSDic[product.UPC] = filledSimilarProduct.UPC;
                    }
                }
            }

            foreach (var key in VSDic.Keys)
            {
                Product product1 = ProductPool.GetByUPC(key, CacheType.Simple);
                Product product2 = ProductPool.GetByUPC(VSDic[key], CacheType.Simple);
                Console.WriteLine("{0},{1} -|- {2},{3}", product1.UPC, product1.Name, product2.UPC, product2.Name);
            }
        }
开发者ID:jimji2008,项目名称:ProcutVS,代码行数:34,代码来源:Printer.cs


示例9: ProductsPresenter

 public ProductsPresenter(Products view)
 {
     productDAO = new productDAO();
     cached = new List<Product>();
     this.view = view;
     this.state = FormState.UPDATE_OLD;
 }
开发者ID:kapranowroman,项目名称:Tasks,代码行数:7,代码来源:ProductsPresenter.cs


示例10: Test_CK_einProduktZweiMal_InsPaket

        public void Test_CK_einProduktZweiMal_InsPaket()
        {
            var sut = new Solution();

            var products = new Products { { "Apfel", 10 } };

            var success = false;

            var productPackages = new ProductPackages
            {
                new ProductPackage(){ Price = 15, Products = { "Apfel", "Apfel" }},

            };

            sut.Setup(products, productPackages);

            var price = 0;
            sut.SendPrice += p =>
            {
                price = p;
                Debug.WriteLine("{0},", price);
            };

            sut.Order("Apfel");
            price.Should().Be(10);
            sut.Order("Apfel");
            price.Should().Be(15);
        }
开发者ID:chrkon,项目名称:dotnetpro_Contests,代码行数:28,代码来源:Test.cs


示例11: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     divSuccess.Visible = false;
     divError.Visible = false;
     Products products = new Products();
     //Validates if it has a name parameter to filter the products
     string name = Request.Params.Get("name");
     string type = Request.Params.Get("type");
     if (name != null && name != "")
     {
         products._name = name;
         Repeater1.DataSource = products.RetrieveProductsByName();
     }
     //Validates if it has a type parameter
     else if (type != null && type != "")
     {
         products._type = type;
         Repeater1.DataSource = products.RetrieveProductsByType();
     }
     else
     {
         Repeater1.DataSource = products.RetrieveAllProducts();
     }
     Repeater1.DataBind();
 }
开发者ID:EdgarPerezJ,项目名称:Shopm8s,代码行数:25,代码来源:Default.aspx.cs


示例12: Upgrade

 public Upgrade(UpgradeType type, Products target, string name, BigInteger price)
 {
     this.Type = type;
     this.Target = target;
     this.Name = name;
     this.Price = price;
 }
开发者ID:guilherme-gm,项目名称:numbers-game,代码行数:7,代码来源:UpgradeData.cs


示例13: Details

 public ActionResult Details(string id)
 {
     var product = new Products().FirstOrDefault(x => x.ProductNumber == id);
     if (product == null)
         return View("Error");
     return View(product);
 }
开发者ID:shahramF,项目名称:MVC-Samples,代码行数:7,代码来源:HomeController.cs


示例14: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     Products products = new Products();
     products._clientid = new Guid(Session["id"].ToString());
     Repeater1.DataSource = products.RetrieveProductsBySeller();
     Repeater1.DataBind();
 }
开发者ID:EdgarPerezJ,项目名称:Shopm8s,代码行数:7,代码来源:MyProducts.aspx.cs


示例15: UpdateTable

    public void UpdateTable(Products ps, int id, string datar)
    {
        cn = new MySqlConnection("database=y;server=x;user id=b;password=a");
        string qry = "INSERT INTO SHOPPINGCART VALUES (@IDCUSTOMER, @IDPRODUCT, @ORDERDATE, @PICKUPDATE, @TOTAL, @PAYMETHOD, @NOTES)";

        foreach (Product p in ps)
        {
            MySqlCommand cmd = new MySqlCommand(qry, cn);
            cmd.Parameters.AddWithValue("@IDCUSTOMER",                         id);
            cmd.Parameters.AddWithValue("@IDPRODUCT",                 p.IdProduct);
            cmd.Parameters.AddWithValue("@ORDERDATE",                DateTime.Now);
            cmd.Parameters.AddWithValue("@PICKUPDATE",                      datar);
            cmd.Parameters.AddWithValue("@TOTAL",                         p.Price);
            cmd.Parameters.AddWithValue("@PAYMETHOD", "\"" + "not defined" + "\"");
            cmd.Parameters.AddWithValue("@NOTES",        "\"" + "no notes" + "\"");

            cn.Open();
            cmd.ExecuteNonQuery();
            cn.Close();
        }

        Session.Clear();
        Session.RemoveAll();

        Response.Redirect("index.aspx");
    }
开发者ID:Xiryl,项目名称:SushiOrder,代码行数:26,代码来源:order.aspx.cs


示例16: AjaxRecommandOperation

 public ActionResult AjaxRecommandOperation(FormCollection fm)
 {
     if (base.UserPrincipal.HasPermissionID(base.GetPermidByActID(base.Act_ApproveList)))
     {
         string str = fm["Type"];
         string str2 = fm["TargetType"];
         int productId = Globals.SafeInt(fm["TargetId"], 0);
         if (((productId > 0) && !string.IsNullOrEmpty(str)) && !string.IsNullOrEmpty(str2))
         {
             if (str2 == "product")
             {
                 Products products = new Products();
                 if (products.UpdateRecomend(productId, (str == "recommand") ? 1 : 0))
                 {
                     return base.Content("Yes");
                 }
             }
             else
             {
                 Photos photos = new Photos();
                 if (photos.UpdateRecomend(productId, (str == "recommand") ? 1 : 0))
                 {
                     return base.Content("Yes");
                 }
             }
         }
     }
     return base.Content("No");
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:29,代码来源:AdminController.cs


示例17: Put

        public IHttpActionResult Put(ProductsModel model)
        {
            var product = manager.GetById(model.Id);

            var newProduct = new Products()
            {
                Comment = product.Comment,
                ProductTypeId = product.ProductTypeId,
                Price = product.Price,
                ProceedsAccountId = product.ProceedsAccountId,
                Number = String.Empty,
                ProductMaterialRsps = new List<ProductMaterialRsp>(),
                CreateDate = DateTime.Now,
                ChangeDate = DateTime.Now,
            };
            
            manager.AddEntity(newProduct);

            foreach(var material in product.ProductMaterialRsps.Where(o => !o.DeleteDate.HasValue).ToList())
            {
                var newPosition = new ProductMaterialRsp()
                {
                    Amount = material.Amount,
                    MaterialId = material.MaterialId,
                    Products = newProduct
                };

                //positionManager.AddEntity(newPosition);
                newProduct.ProductMaterialRsps.Add(newPosition);
            }

            manager.SaveChanges();

            return Ok(new { id = newProduct.Id });
        }
开发者ID:HedinRakot,项目名称:Zierer,代码行数:35,代码来源:CopyProductController.cs


示例18: RptExport_ItemDataBound

    protected void RptExport_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer))
        {
            Label lblName = (Label)e.Item.FindControl("lblName");
            Label lblPrice = (Label)e.Item.FindControl("lblPrice");
            //Label lblQuantity = (Label)e.Item.FindControl("lblQuantity");
            //Label lblProductTotal = (Label)e.Item.FindControl("lblProductTotal");

            int nQuantity = 1;
            int nProductID = ConvertData.ConvertToInt(DataBinder.Eval(e.Item.DataItem, "ProductID2"));

            Products objProduct = new Products();
            objProduct.LoadById(nProductID);

            string sNameProduct = ConvertData.ConvertToString(objProduct.Data.ProductName);
            int nPrice = ConvertData.ConvertToInt(objProduct.Data.Price);

            lblName.Text = sNameProduct;
            lblPrice.Text = ConvertData.ConvertToString(Support.FormatCurrency(nPrice)) + " " + "vn₫";

            //lblQuantity.Text = ConvertData.ConvertToString(nQuantity);

            int nTotal = nPrice * nQuantity;

            //lblProductTotal.Text = ConvertData.ConvertToString(Support.FormatCurrency(nTotal)) + " " + "vn₫";

            int nTotalOrder = nTotal;
            fSubTotal += ConvertData.ConvertToDouble(nTotal);
        }
        lblTotal.Text = ConvertData.ConvertToString(Support.FormatCurrency(fSubTotal)) + " " + "vn₫";
    }
开发者ID:changtraicantinh,项目名称:atpgroup,代码行数:32,代码来源:OrderAdd.ascx.cs


示例19: NewVersionEventArgs

        public NewVersionEventArgs(Products products)
        {
            products.Sort((obj, obj1) => (new Version(obj.ProductVersion) < new Version(obj1.ProductVersion)) ? +1 : -1);

            this.Products = products;
            this.NewVersion = products.FirstOrDefault();
        }
开发者ID:marinehero,项目名称:ThinkAway.net,代码行数:7,代码来源:NewVersionEventArgs.cs


示例20: Put

        // PUT odata/Product(5)
        public async Task<IHttpActionResult> Put([FromODataUri] int key, Products products)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (key != products.ProductId)
            {
                return BadRequest();
            }

            db.Entry(products).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProductsExists(key))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return Updated(products);
        }
开发者ID:dhanutpk,项目名称:Simple-MVC-Crud-Operation,代码行数:33,代码来源:ProductController.cs



注:本文中的Products类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Profile类代码示例发布时间:2022-05-24
下一篇:
C# Production类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap