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


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

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


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

示例1: lbtnPublish_Click

        //批量发布
        protected void lbtnPublish_Click(object sender, EventArgs e)
        {
            try
            {
                ChkAdminLevel(channel_id, DTEnums.ActionEnum.Publish.ToString()); //检查权限
                BLL.article bll = new BLL.article();
                Repeater rptList = new Repeater();

                rptList = this.rptList1;

                Model.article_news model_new = null;
                for (int i = 0; i < rptList.Items.Count; i++)
                {
                    int _id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                    CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                    if (cb.Checked)
                    {
                        model_new = bll.GetNewsModel(_id);

                        Publish publish_new = new Publish();
                        //开始发布
                        string serverFileName = publish_new.Publish_News(model_new.title, model_new.content, model_new.from, model_new.add_time.ToShortDateString());
                        //修改URL字段
                        if (!string.IsNullOrEmpty(serverFileName))
                        {
                            model_new.link_url = serverFileName;
                            model_new.is_publish = 1;
                            bll.Update(model_new);
                        }
                        //bll.UpdateField(_id, "link_url='" + serverFileName + "'");
                        //bll.UpdateNewsField(_id, "is_publish=1");

                    }
                }
                JscriptMsg("批量发布成功啦!", Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
                this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
            }
            catch
            {
                JscriptMsg("发布过程中遇到错误,请联系管理员!", Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
                this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Error");
            }
        }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:44,代码来源:list.aspx.cs

示例2: DoEdit


//.........这里部分代码省略.........
            {
                model.is_red = 1;
            }
            if (cblItem.Items[3].Selected == true)
            {
                model.is_hot = 1;
            }
            if (cblItem.Items[4].Selected == true)
            {
                model.is_slide = 1;
            }
            model.add_time = Utils.StrToDateTime(txtAddTime.Text.Trim());
            model.update_time = DateTime.Now;
            model.fields = SetFieldValues(this.channel_id); //扩展字段赋值

            #region 保存相册====================
            //检查是否有自定义图片
            if (txtImgUrl.Text.Trim() == "")
            {
                model.img_url = hidFocusPhoto.Value;
            }
            if (model.albums != null)
            {
                model.albums.Clear();
            }
            string[] albumArr = Request.Form.GetValues("hid_photo_name");
            string[] remarkArr = Request.Form.GetValues("hid_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 = Utils.StrToInt(imgArr[0], 0);
                    if (imgArr.Length == 3)
                    {
                        if (!string.IsNullOrEmpty(remarkArr[i]))
                        {
                            ls.Add(new Model.article_albums { id = img_id, article_id = _id, original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i] });
                        }
                        else
                        {
                            ls.Add(new Model.article_albums { id = img_id, article_id = _id, original_path = imgArr[1], thumb_path = imgArr[2] });
                        }
                    }
                }
                model.albums = ls;
            }
            #endregion

            #region 保存附件====================
            if (model.attach != null)
            {
                model.attach.Clear();
            }
            string[] attachIdArr = Request.Form.GetValues("hid_attach_id");
            string[] attachFileNameArr = Request.Form.GetValues("hid_attach_filename");
            string[] attachFilePathArr = Request.Form.GetValues("hid_attach_filepath");
            string[] attachFileSizeArr = Request.Form.GetValues("hid_attach_filesize");
            string[] attachPointArr = Request.Form.GetValues("txt_attach_point");
            if (attachIdArr != null && attachFileNameArr != null && attachFilePathArr != null && attachFileSizeArr != null && attachPointArr != null
                && attachIdArr.Length > 0 && attachFileNameArr.Length > 0 && attachFilePathArr.Length > 0 && attachFileSizeArr.Length > 0 && attachPointArr.Length > 0)
            {
                List<Model.article_attach> ls = new List<Model.article_attach>();
                for (int i = 0; i < attachFileNameArr.Length; i++)
                {
                    int attachId = Utils.StrToInt(attachIdArr[i], 0);
                    int fileSize = Utils.StrToInt(attachFileSizeArr[i], 0);
                    string fileExt = Utils.GetFileExt(attachFilePathArr[i]);
                    int _point = Utils.StrToInt(attachPointArr[i], 0);
                    ls.Add(new Model.article_attach { id = attachId, article_id = _id, file_name = attachFileNameArr[i], file_path = attachFilePathArr[i], file_size = fileSize, file_ext = fileExt, point = _point, });
                }
                model.attach = ls;
            }
            #endregion

            #region 保存会员组价格==============
            List<Model.user_group_price> priceList = new List<Model.user_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.user_group_price { id = hidPriceId, article_id = _id, group_id = hidGroupId, price = _price });
            }
            model.group_price = priceList;
            #endregion

            if (bll.Update(model))
            {

                AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "微网站修改" + this.channel_name + "频道内容:" + model.title); //记录日志
                result = true;
            }
            return result;
        }
开发者ID:wujiang1984,项目名称:WechatBuilder,代码行数:101,代码来源:wx_article_edit.aspx.cs

示例3: DoEdit


//.........这里部分代码省略.........
            string[] specGroupPriceArr = Request.Form.GetValues("hide_group_price");
            if (specGoodsIdArr != null && specGoodsNoArr != null && specMarketPriceArr != null && specSellPriceArr != null && specStockQuantityArr != null
                && specSpecIdsArr != null && specTextArr != null && specGroupPriceArr != null
                && specGoodsIdArr.Length > 0 && specGoodsNoArr.Length > 0 && specMarketPriceArr.Length > 0 && specSellPriceArr.Length > 0
                && specStockQuantityArr.Length > 0 && specSpecIdsArr.Length > 0 && specTextArr.Length > 0 && specGroupPriceArr.Length > 0)
            {
                List<Model.article_goods> goodsList = new List<Model.article_goods>();
                for (int i = 0; i < specGoodsNoArr.Length; i++)
                {
                    List<Model.user_group_price> groupList = new List<Model.user_group_price>();
                    if (!string.IsNullOrEmpty(specGroupPriceArr[i]))
                    {
                        groupList = (List<Model.user_group_price>)JsonHelper.JSONToObject<List<Model.user_group_price>>(specGroupPriceArr[i]);
                    }
                    goodsList.Add(new Model.article_goods
                    {
                        id = Utils.StrToInt(specGoodsIdArr[i], 0),
                        article_id = model.id,
                        goods_no = specGoodsNoArr[i],
                        spec_ids = specSpecIdsArr[i],
                        spec_text = specTextArr[i],
                        stock_quantity = Utils.StrToInt(specStockQuantityArr[i], 0),
                        market_price = Utils.StrToDecimal(specMarketPriceArr[i], 0),
                        sell_price = Utils.StrToDecimal(specSellPriceArr[i], 0),
                        group_prices = groupList
                    });
                }
                model.goods = goodsList;
            }
            #endregion

            #region 保存相册====================
            //检查是否有自定义图片
            if (txtImgUrl.Text.Trim() == "")
            {
                model.img_url = hidFocusPhoto.Value;
            }
            if (model.albums != null)
            {
                model.albums.Clear();
            }
            string[] albumArr = Request.Form.GetValues("hid_photo_name");
            string[] remarkArr = Request.Form.GetValues("hid_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 = Utils.StrToInt(imgArr[0], 0);
                    if (imgArr.Length == 3)
                    {
                        if (!string.IsNullOrEmpty(remarkArr[i]))
                        {
                            ls.Add(new Model.article_albums { id = img_id, article_id = _id, original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i] });
                        }
                        else
                        {
                            ls.Add(new Model.article_albums { id = img_id, article_id = _id, original_path = imgArr[1], thumb_path = imgArr[2] });
                        }
                    }
                }
                model.albums = ls;
            }
            #endregion

            #region 保存附件====================
            if (model.attach != null)
            {
                model.attach.Clear();
            }
            string[] attachIdArr = Request.Form.GetValues("hid_attach_id");
            string[] attachFileNameArr = Request.Form.GetValues("hid_attach_filename");
            string[] attachFilePathArr = Request.Form.GetValues("hid_attach_filepath");
            string[] attachFileSizeArr = Request.Form.GetValues("hid_attach_filesize");
            string[] attachPointArr = Request.Form.GetValues("txt_attach_point");
            if (attachIdArr != null && attachFileNameArr != null && attachFilePathArr != null && attachFileSizeArr != null && attachPointArr != null
                && attachIdArr.Length > 0 && attachFileNameArr.Length > 0 && attachFilePathArr.Length > 0 && attachFileSizeArr.Length > 0 && attachPointArr.Length > 0)
            {
                List<Model.article_attach> ls = new List<Model.article_attach>();
                for (int i = 0; i < attachFileNameArr.Length; i++)
                {
                    int attachId = Utils.StrToInt(attachIdArr[i], 0);
                    int fileSize = Utils.StrToInt(attachFileSizeArr[i], 0);
                    string fileExt = Utils.GetFileExt(attachFilePathArr[i]);
                    int _point = Utils.StrToInt(attachPointArr[i], 0);
                    ls.Add(new Model.article_attach { id = attachId, article_id = _id, file_name = attachFileNameArr[i], file_path = attachFilePathArr[i], file_size = fileSize, file_ext = fileExt, point = _point, });
                }
                model.attach = ls;
            }
            #endregion

            if (bll.Update(model))
            {

                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改" + this.channel_name + "频道内容:" + model.title); //记录日志
                result = true;
            }
            return result;
        }
开发者ID:lvchenbaby,项目名称:dx,代码行数:101,代码来源:article_edit.aspx.cs

示例4: lbtnEditPublish_Click

        /// <summary>
        /// 取消发布
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lbtnEditPublish_Click(object sender, EventArgs e)
        {
            BLL.article bll = new BLL.article();
            //Repeater rptList = new Repeater();
            //rptList = this.rptList1;

            Model.article_news model_new = null;

            LinkButton lnkbtn = (LinkButton)sender;

            int _id = Convert.ToInt32(((HiddenField)lnkbtn.FindControl("hidId")).Value);

            model_new = bll.GetNewsModel(_id);
            if (model_new != null)
            {
                string temp_url = model_new.link_url;
                model_new.link_url = "";
                model_new.is_publish = 0;

                if (bll.Update(model_new))
                {
                    Utils.DeleteFile(temp_url); //删除文件
                }
                JscriptMsg("取消发布成功啦!", Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
                this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
            }
            else
            {
                JscriptMsg("实体获取失败,请联系管理员!", Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
                this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Error");
            }
        }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:37,代码来源:list.aspx.cs

示例5: DoEdit


//.........这里部分代码省略.........
            model.zhaiyao = Utils.DropHTML(txtZhaiyao.Text, 250);
            model.link_url = txtLinkUrl.Text.Trim();
            //检查是否有自定义图片
            if (txtImgUrl.Text.Trim() != "")
            {
                model.img_url = txtImgUrl.Text;
            }
            else
            {
                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;
            }
            //保存相册
            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>();
            foreach (DataRow dr in ds2.Tables[0].Rows)
            {
                int attr_id = int.Parse(dr["id"].ToString());
                string attr_title = dr["title"].ToString();
                string attr_value_id = Request.Form["value_" + attr_id];
                string attr_value_content = Request.Form["content_" + attr_id];
                if (!string.IsNullOrEmpty(attr_value_id) && !string.IsNullOrEmpty(attr_value_content))
                {
                    attrls.Add(new Model.attribute_value { id =  Convert.ToInt32(attr_value_id), article_id = _id, attribute_id = attr_id, title = attr_title, content = attr_value_content });
                }
            }
            model.attribute_values = attrls;

            if (!bll.Update(model))
            {
                result = false;
            }
            return result;
        }
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:101,代码来源:edit.aspx.cs

示例6: DoEdit

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

            model.channel_id = this.channel_id;
            model.title = txtTitle.Text.Trim();

            model.category_id = int.Parse(ddlCategoryId.SelectedValue);
            model.link_url = txtLinkUrl.Text.Trim();
            //检查是否有自定义图片
            if (txtImgUrl.Text.Trim() != "")
            {
                model.img_url = txtImgUrl.Text;
            }
            else
            {
                model.img_url = focus_photo.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.content = Utils.ToTxt(txtContent.Text);
            model.digg_good = int.Parse(txtDiggGood.Text.Trim());
            model.digg_bad = int.Parse(txtDiggBad.Text.Trim());
            model.is_msg = 0;
            model.is_red = 0;
            model.is_lock = 0;
            model.is_top = 0;
            model.telephone = txtTelephone.Text.Trim();
            model.user = txtContact.Text.Trim();
            model.address = txtAddress.Text.Trim();
            model.remark1 = "";
            model.remark2 = 0;
            model.x_lng = "";
            model.y_lat = "";
            model.line =  Utils.ToHtml(txtLine.Text.Trim());
            model.price = decimal.Parse(txtPrice.Text.Trim());
            model.sell_price = decimal.Parse(txtSellPrice.Text.Trim());
            model.flight_num = txtFlightNum.Text.Trim();
            model.seat_price = txtFlightSeat.Text.Trim();
            model.begin_date = txtBeginDate.Text.Trim();
            model.end_date = txtEndDate.Text.Trim();
            model.entry_port = txtEntryPort.Text.Trim();
            model.visa_type = txtVisaType.Text.Trim();
            model.visa_nation = txtVisaNation.Text.Trim();
            model.visa_data = Utils.ToHtml( txtVisaData.Text.Trim());
            //if (cblItem.Items[0].Selected == true)
            //{
            //    model.is_msg = 1;
            //}
            if (cblItem.Items[0].Selected == true)
            {
                model.is_red = 1;
            }
            //if (cblItem.Items[2].Selected == true)
            //{
            //    model.is_lock = 1;
            //}
            //if (cblItem.Items[3].Selected == true)
            //{
            //    model.is_top = 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,代码行数:98,代码来源:edit.aspx.cs

示例7: DoEdit


//.........这里部分代码省略.........
            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>();
            foreach (DataRow dr in ds2.Tables[0].Rows)
            {
                int attr_id = int.Parse(dr["id"].ToString());
                string attr_title = dr["title"].ToString();
                string attr_value_id = Request.Form["value_" + attr_id];
                string attr_value_content = Request.Form["content_" + attr_id];
                if (!string.IsNullOrEmpty(attr_value_id) && !string.IsNullOrEmpty(attr_value_content))
                {
                    attrls.Add(new Model.attribute_value { id =  Convert.ToInt32(attr_value_id), article_id = _id, attribute_id = attr_id, title = attr_title, content = attr_value_content });
                }
            }
            model.attribute_values = attrls;

            if (!bll.Update(model))
            {
                result = false;
            }
            return result;
        }
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:101,代码来源:edit.aspx.cs

示例8: DoEdit


//.........这里部分代码省略.........
            string[] attachPointArr = Request.Form.GetValues("txt_attach_point");
            if (attachIdArr != null && attachFileNameArr != null && attachFilePathArr != null && attachFileSizeArr != null && attachPointArr != null
                && attachIdArr.Length > 0 && attachFileNameArr.Length > 0 && attachFilePathArr.Length > 0 && attachFileSizeArr.Length > 0 && attachPointArr.Length > 0)
            {
                List<Model.article_attach> ls = new List<Model.article_attach>();
                for (int i = 0; i < attachFileNameArr.Length; i++)
                {
                    int attachId = Utils.StrToInt(attachIdArr[i], 0);
                    int fileSize = Utils.StrToInt(attachFileSizeArr[i], 0);
                    string fileExt = Utils.GetFileExt(attachFilePathArr[i]);
                    int _point = Utils.StrToInt(attachPointArr[i], 0);
                    ls.Add(new Model.article_attach { id = attachId, article_id = _id, file_name = attachFileNameArr[i], file_path = attachFilePathArr[i], file_size = fileSize, file_ext = fileExt, point = _point, });
                }
                model.attach = ls;
            }
            #endregion

            #region 保存会员组价格==============
            List<Model.user_group_price> priceList = new List<Model.user_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.user_group_price { id = hidPriceId, article_id = _id, group_id = hidGroupId, price = _price });
            }
            model.group_price = priceList;
            #endregion

            if (bll.Update(model))
            {
                #region  商品相关

                if (channel_name == "goods")
                {
                    //规格价格
                    BLL.standard_price bll_price = new BLL.standard_price();
                    DataTable dt = bll_price.GetList(0, "good_id=" + _id, "id asc").Tables[0];
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        if (!bll_price.Delete("good_id=" + _id))
                        {
                            JscriptMsg("价格信息清除失败!", "", "Error");
                            return false;
                        }
                    }
                    string standard_ids = DTRequest.GetFormString("ck_standard");
                    string standard_value_ids = DTRequest.GetFormString("ck_standard_value");

                    string str_standards = "";
                    BLL.standard bll_standard = new BLL.standard();
                    string[] str_standard_arr = standard_ids.Split(',');
                    foreach (string str in str_standard_arr)
                    {
                        if (!string.IsNullOrEmpty(str))
                        {
                            Model.standard model_standard = bll_standard.GetModel(Convert.ToInt32(str));
                            if (model_standard != null)
                            {
                                str_standards += model_standard.title + ",";
                            }
                        }
开发者ID:wangjinfang,项目名称:DTCMS,代码行数:67,代码来源:article_edit.aspx.cs

示例9: DoEdit

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

            model.channel_id = this.channel_id;
            model.title = txtTitle.Text.Trim();
            model.category_id = int.Parse(ddlCategoryId.SelectedValue);
            model.link_url = txtLinkUrl.Text.Trim();
            model.img_url = txtImgUrl.Text.Trim();
            model.author = txtAuthor.Text.Trim();
            model.form = txtForm.Text.Trim();
            model.zhaiyao = Utils.DropHTML(txtZhaiyao.Text, 250);
            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.content = txtContent.Value;
            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 (!bll.Update(model))
            {
                result = false;
            }
            return result;
        }
开发者ID:sichina,项目名称:DTcms_103_sql_src,代码行数:57,代码来源:edit.aspx.cs


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