当前位置: 首页>>代码示例>>C#>>正文


C# BLL.article.GetGoodsModel方法代码示例

本文整理汇总了C#中BLL.article.GetGoodsModel方法的典型用法代码示例。如果您正苦于以下问题:C# BLL.article.GetGoodsModel方法的具体用法?C# BLL.article.GetGoodsModel怎么用?C# BLL.article.GetGoodsModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BLL.article的用法示例。


在下文中一共展示了BLL.article.GetGoodsModel方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowPage

 /// <summary>
 /// 重写虚方法,此方法将在Init事件前执行
 /// </summary>
 protected override void ShowPage()
 {
     id = DTRequest.GetQueryInt("id");
     BLL.article bll = new BLL.article();
     if (!bll.Exists(id))
     {
         HttpContext.Current.Response.Redirect(config.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您要浏览的页面不存在或已删除啦!"));
         return;
     }
     model = bll.GetGoodsModel(id);
     //浏览数+1
     bll.UpdateField(id, "click=click+1");
     //跳转URL
     if (model.link_url != null)
         model.link_url = model.link_url.Trim();
     if (!string.IsNullOrEmpty(model.link_url))
     {
         HttpContext.Current.Response.Redirect(model.link_url);
     }
 }
开发者ID:egojit,项目名称:B2C,代码行数:23,代码来源:goods_show.cs

示例2: GetList

        /// <summary>
        /// 获得购物车列表
        /// </summary>
        public static IList<Model.cart_items> GetList(int group_id)
        {
            IDictionary<string, int> dic = GetCart();
            if (dic != null)
            {
                IList<Model.cart_items> iList = new List<Model.cart_items>();

                foreach (var item in dic)
                {
                    BLL.article bll = new BLL.article();
                    Model.article_goods model = bll.GetGoodsModel(Convert.ToInt32(item.Key));
                    if (model == null)
                    {
                        continue;
                    }
                    Model.cart_items modelt = new Model.cart_items();
                    modelt.id = model.id;
                    modelt.title = model.title;
                    modelt.img_url = model.img_url;
                    modelt.point = model.point;
                    modelt.price = model.sell_price;
                    modelt.user_price = model.sell_price;
                    modelt.stock_quantity = model.stock_quantity;
                    //会员价格
                    if (model.goods_group_prices != null)
                    {
                        Model.goods_group_price gmodel = model.goods_group_prices.Find(p => p.group_id == group_id);
                        if (gmodel != null)
                        {
                            modelt.user_price = gmodel.price;
                        }
                    }
                    modelt.quantity = item.Value;
                    iList.Add(modelt);
                }
                return iList;
            }
            return null;
        }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:42,代码来源:ShoppingCart.cs

示例3: rptList_ItemCommand

 //设置操作
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     ChkAdminLevel(channel_id, DTEnums.ActionEnum.Edit.ToString()); //检查权限
     int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value);
     BLL.article bll = new BLL.article();
     Model.article_goods model = bll.GetGoodsModel(id);
     switch (e.CommandName.ToLower())
     {
         case "ibtnmsg":
             if (model.is_msg == 1)
                 bll.UpdateGoodsField(id, "is_msg=0");
             else
                 bll.UpdateGoodsField(id, "is_msg=1");
             break;
         case "ibtntop":
             if (model.is_top == 1)
                 bll.UpdateGoodsField(id, "is_top=0");
             else
                 bll.UpdateGoodsField(id, "is_top=1");
             break;
         case "ibtnred":
             if (model.is_red == 1)
                 bll.UpdateGoodsField(id, "is_red=0");
             else
                 bll.UpdateGoodsField(id, "is_red=1");
             break;
         case "ibtnhot":
             if (model.is_hot == 1)
                 bll.UpdateGoodsField(id, "is_hot=0");
             else
                 bll.UpdateGoodsField(id, "is_hot=1");
             break;
         case "ibtnslide":
             if (model.is_slide == 1)
                 bll.UpdateGoodsField(id, "is_slide=0");
             else
                 bll.UpdateGoodsField(id, "is_slide=1");
             break;
     }
     this.RptBind("id>0" + CombSqlTxt(this.channel_id, this.category_id, this.keywords, this.property), "sort_id asc,add_time desc");
 }
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:42,代码来源:list.aspx.cs

示例4: ShowInfo

        private void ShowInfo(int _id)
        {
            BLL.article bll = new BLL.article();
            Model.article_goods model = bll.GetGoodsModel(_id);

            ddlCategoryId.SelectedValue = model.category_id.ToString();
            txtTitle.Text = model.title;
            txtGoodsNo.Text = model.goods_no;
            txtStockQuantity.Text = model.stock_quantity.ToString();
            txtMarketPrice.Text = model.market_price.ToString();
            txtSellPrice.Text = model.sell_price.ToString();
            txtPoint.Text = model.point.ToString();
            txtLinkUrl.Text = model.link_url;
            if (model.is_msg == 1)
            {
                cblItem.Items[0].Selected = true;
            }
            if (model.is_top == 1)
            {
                cblItem.Items[1].Selected = true;
            }
            if (model.is_red == 1)
            {
                cblItem.Items[2].Selected = true;
            }
            if (model.is_hot == 1)
            {
                cblItem.Items[3].Selected = true;
            }
            if (model.is_slide == 1)
            {
                cblItem.Items[4].Selected = true;
            }
            if (model.is_lock == 1)
            {
                cblItem.Items[5].Selected = true;
            }
            txtSortId.Text = model.sort_id.ToString();
            txtClick.Text = model.click.ToString();
            txtDiggGood.Text = model.digg_good.ToString();
            txtDiggBad.Text = model.digg_bad.ToString();
            txtContent.Value = model.content;
            txtSeoTitle.Text = model.seo_title;
            txtSeoKeywords.Text = model.seo_keywords;
            txtSeoDescription.Text = model.seo_description;
            //赋值用户组价格
            if (model.goods_group_prices != null)
            {
                for (int i = 0; i < this.rptPrice.Items.Count; i++)
                {
                    int hideId = Convert.ToInt32(((HiddenField)this.rptPrice.Items[i].FindControl("hideGroupId")).Value);
                    foreach (Model.goods_group_price modelt in model.goods_group_prices)
                    {
                        if (hideId == modelt.group_id)
                        {
                            ((HiddenField)this.rptPrice.Items[i].FindControl("hidePriceId")).Value = modelt.id.ToString();
                            ((TextBox)this.rptPrice.Items[i].FindControl("txtGroupPrice")).Text = modelt.price.ToString();
                        }
                    }
                }
            }
            //赋值上传的相册
            focus_photo.Value = model.img_url; //封面图片
            LitAlbumList.Text = GetAlbumHtml(model.albums, model.img_url);
            //赋值属性列表
            LitAttributeList.Text = GetAttributeHtml(model.attribute_values, this.channel_id, _id);
        }
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:67,代码来源:edit.aspx.cs

示例5: DoEdit

        private bool DoEdit(int _id)
        {
            bool result = true;
            BLL.article bll = new BLL.article();
            Model.article_goods model = bll.GetGoodsModel(_id);

            model.channel_id = this.channel_id;
            model.title = txtTitle.Text.Trim();
            model.category_id = int.Parse(ddlCategoryId.SelectedValue);
            model.goods_no = txtGoodsNo.Text;
            model.stock_quantity = int.Parse(txtStockQuantity.Text);
            model.market_price = decimal.Parse(txtMarketPrice.Text);
            model.sell_price = decimal.Parse(txtSellPrice.Text);
            model.point = int.Parse(txtPoint.Text);
            model.link_url = txtLinkUrl.Text.Trim();
            model.img_url = focus_photo.Value;
            model.content = txtContent.Value;
            model.seo_title = txtSeoTitle.Text.Trim();
            model.seo_keywords = txtSeoKeywords.Text.Trim();
            model.seo_description = txtSeoDescription.Text.Trim();
            model.sort_id = int.Parse(txtSortId.Text.Trim());
            model.click = int.Parse(txtClick.Text.Trim());
            model.digg_good = int.Parse(txtDiggGood.Text.Trim());
            model.digg_bad = int.Parse(txtDiggBad.Text.Trim());
            model.is_msg = 0;
            model.is_top = 0;
            model.is_red = 0;
            model.is_hot = 0;
            model.is_slide = 0;
            model.is_lock = 0;
            if (cblItem.Items[0].Selected == true)
            {
                model.is_msg = 1;
            }
            if (cblItem.Items[1].Selected == true)
            {
                model.is_top = 1;
            }
            if (cblItem.Items[2].Selected == true)
            {
                model.is_red = 1;
            }
            if (cblItem.Items[3].Selected == true)
            {
                model.is_hot = 1;
            }
            if (cblItem.Items[4].Selected == true)
            {
                model.is_slide = 1;
            }
            if (cblItem.Items[5].Selected == true)
            {
                model.is_lock = 1;
            }
            //用户组价格
            List<Model.goods_group_price> priceList = new List<Model.goods_group_price>();
            for (int i = 0; i < rptPrice.Items.Count; i++)
            {
                int hidPriceId = 0;
                if (!string.IsNullOrEmpty(((HiddenField)rptPrice.Items[i].FindControl("hidePriceId")).Value))
                {
                    hidPriceId = Convert.ToInt32(((HiddenField)rptPrice.Items[i].FindControl("hidePriceId")).Value);
                }
                int hidGroupId = Convert.ToInt32(((HiddenField)rptPrice.Items[i].FindControl("hideGroupId")).Value);
                decimal _price = Convert.ToDecimal(((TextBox)rptPrice.Items[i].FindControl("txtGroupPrice")).Text.Trim());
                priceList.Add(new Model.goods_group_price { id = hidPriceId, article_id = _id, group_id = hidGroupId, price = _price });
            }
            model.goods_group_prices = priceList;
            //保存相册
            if (model.albums != null)
                model.albums.Clear();
            string[] albumArr = Request.Form.GetValues("hide_photo_name");
            string[] remarkArr = Request.Form.GetValues("hide_photo_remark");
            if (albumArr != null)
            {
                List<Model.article_albums> ls = new List<Model.article_albums>();
                for (int i = 0; i < albumArr.Length; i++)
                {
                    string[] imgArr = albumArr[i].Split('|');
                    int img_id = int.Parse(imgArr[0]);
                    if (imgArr.Length == 3)
                    {
                        if (!string.IsNullOrEmpty(remarkArr[i]))
                        {
                            ls.Add(new Model.article_albums { id = img_id, article_id = _id, big_img = imgArr[1], small_img = imgArr[2], remark = remarkArr[i] });
                        }
                        else
                        {
                            ls.Add(new Model.article_albums { id = img_id, article_id = _id, big_img = imgArr[1], small_img = imgArr[2] });
                        }
                    }
                }
                model.albums = ls;
            }

            //扩展属性
            BLL.attributes bll2 = new BLL.attributes();
            DataSet ds2 = bll2.GetList("channel_id=" + this.channel_id);

            List<Model.attribute_value> attrls = new List<Model.attribute_value>();
//.........这里部分代码省略.........
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:101,代码来源:edit.aspx.cs

示例6: ShowInfo

        private void ShowInfo(int _id)
        {
            BLL.article bll = new BLL.article();
            Model.article_goods model = bll.GetGoodsModel(_id);

            ddlCategoryId.SelectedValue = model.category_id.ToString();
            txtTitle.Text = model.title;
            // txtGoodsNo.Text = model.goods_no;
            txtStockQuantity.Text = model.stock_quantity.ToString();
            txtSellPrice.Text = model.market_price.ToString();
            txtSellPrice.Text = model.sell_price.ToString();
            //  txtPoint.Text = model.point.ToString();
            // txtLinkUrl.Text = model.link_url;
            if (model.is_msg == 1)
            {
                cblItem.Items[0].Selected = true;
            }
            if (model.is_top == 1)
            {
                cblItem.Items[1].Selected = true;
            }
            if (model.is_red == 1)
            {
                cblItem.Items[2].Selected = true;
            }
            if (model.is_hot == 1)
            {
                cblItem.Items[3].Selected = true;
            }
            if (model.is_slide == 1)
            {
                cblItem.Items[4].Selected = true;
            }
            if (model.is_lock == 1)
            {
                cblItem.Items[5].Selected = true;
            }
            txtSortId.Text = model.sort_id.ToString();
            // txtClick.Text = model.click.ToString();
            // txtDiggGood.Text = model.digg_good.ToString();
            //txtDiggBad.Text = model.digg_bad.ToString();
            txtContent.Text = model.content;
            // txtSeoTitle.Text = model.seo_title;
            // txtSeoKeywords.Text = model.seo_keywords;
            // txtSeoDescription.Text = model.seo_description;
            //赋值上传的相册
            focus_photo.Value = model.img_url; //封面图片
            LitAlbumList.Text = GetAlbumHtml(model.albums, model.img_url);
            //赋值属性列表
            //LitAttributeList.Text = GetAttributeHtml(model.attribute_values, this.channel_id, _id);
        }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:51,代码来源:edit.aspx.cs

示例7: DoEdit

        private bool DoEdit(int _id)
        {
            bool result = true;
            BLL.article bll = new BLL.article();
            Model.article_goods model = bll.GetGoodsModel(_id);

            model.channel_id = this.channel_id;
            model.title = txtTitle.Text.Trim();
            model.category_id = int.Parse(ddlCategoryId.SelectedValue);
            //model.goods_no = txtGoodsNo.Text;
            model.stock_quantity = int.Parse(txtStockQuantity.Text);
            model.market_price = decimal.Parse(txtSellPrice.Text);
            model.sell_price = decimal.Parse(txtSellPrice.Text);
            //model.point = int.Parse(txtPoint.Text);
            //model.link_url = txtLinkUrl.Text.Trim();
            model.img_url = focus_photo.Value;
            model.content = txtContent.Text;
            //model.seo_title = txtSeoTitle.Text.Trim();
            // model.seo_keywords = txtSeoKeywords.Text.Trim();
            //model.seo_description = txtSeoDescription.Text.Trim();
            model.sort_id = int.Parse(txtSortId.Text.Trim());
            // model.click = int.Parse(txtClick.Text.Trim());
            // model.digg_good = int.Parse(txtDiggGood.Text.Trim());
            // model.digg_bad = int.Parse(txtDiggBad.Text.Trim());
            model.is_msg = 0;
            model.is_top = 0;
            model.is_red = 0;
            model.is_hot = 0;
            model.is_slide = 0;
            model.is_lock = 0;
            if (cblItem.Items[0].Selected == true)
            {
                model.is_msg = 1;
            }
            if (cblItem.Items[1].Selected == true)
            {
                model.is_top = 1;
            }
            if (cblItem.Items[2].Selected == true)
            {
                model.is_red = 1;
            }
            if (cblItem.Items[3].Selected == true)
            {
                model.is_hot = 1;
            }
            if (cblItem.Items[4].Selected == true)
            {
                model.is_slide = 1;
            }
            if (cblItem.Items[5].Selected == true)
            {
                model.is_lock = 1;
            }
            //保存相册
            if (model.albums != null)
                model.albums.Clear();
            string[] albumArr = Request.Form.GetValues("hide_photo_name");
            string[] remarkArr = Request.Form.GetValues("hide_photo_remark");
            if (albumArr != null)
            {
                List<Model.article_albums> ls = new List<Model.article_albums>();
                for (int i = 0; i < albumArr.Length; i++)
                {
                    string[] imgArr = albumArr[i].Split('|');
                    int img_id = int.Parse(imgArr[0]);
                    if (imgArr.Length == 3)
                    {
                        if (!string.IsNullOrEmpty(remarkArr[i]))
                        {
                            ls.Add(new Model.article_albums { id = img_id, article_id = _id, big_img = imgArr[1], small_img = imgArr[2], remark = remarkArr[i] });
                        }
                        else
                        {
                            ls.Add(new Model.article_albums { id = img_id, article_id = _id, big_img = imgArr[1], small_img = imgArr[2] });
                        }
                    }
                }
                model.albums = ls;
            }

            if (!bll.Update(model))
            {
                result = false;
            }
            return result;
        }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:87,代码来源:edit.aspx.cs


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