示例#1
0
        private bool DoAdd()
        {
            try
            {
                Model.article_category model = new Model.article_category();
                BLL.article_category   bll   = new BLL.article_category();
                model.channel_id      = this.channel_id;
                model.call_index      = txtCallIndex.Text.Trim();
                model.title           = txtTitle.Text.Trim();
                model.parent_id       = int.Parse(ddlParentId.SelectedValue);
                model.sort_id         = int.Parse(txtSortId.Text.Trim());
                model.seo_title       = txtSeoTitle.Text;
                model.seo_keywords    = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url        = txtLinkUrl.Text.Trim();
                model.img_url         = txtImgUrl.Text.Trim();
                model.content         = txtContent.Value;
                model.ico_url         = Request.Form["txtImgICO"].Trim();// txtImgICO.Text;
                Model.wx_userweixin weixin = GetWeiXinCode();
                model.wid = weixin.id;

                if (bll.Add(model) > 0)
                {
                    AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "频道栏目分类:" + model.title); //记录日志
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
示例#2
0
        private bool DoAdd()
        {
            //try
            //{
            Model.article_category model = new Model.article_category();
            BLL.article_category   bll   = new BLL.article_category();
            model.channel_id      = 0;
            model.call_index      = txtCallIndex.Text.Trim();
            model.title           = txtTitle.Text.Trim();
            model.parent_id       = int.Parse(ddlParentId.SelectedValue);
            model.sort_id         = int.Parse(txtSortId.Text.Trim());
            model.seo_title       = txtSeoTitle.Text;
            model.seo_keywords    = txtSeoKeywords.Text;
            model.seo_description = txtSeoDescription.Text;
            model.link_url        = txtLinkUrl.Text.Trim();
            model.img_url         = txtImgUrl.Text.Trim();
            model.content         = txtContent.Value;
            model.ico_url         = Request.Form["txtImgICO"].Trim();// txtImgICO.Text;
            model.wid             = 0;

            if (bll.Add(model) > 0)
            {
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加" + pageLevelName + "频道栏目分类:" + model.title);     //记录日志
                return(true);
            }
            //}
            //catch
            //{
            //    return false;
            //}
            return(false);
        }
        private bool DoAdd()
        {
            try
            {
                Model.article_category model = new Model.article_category();
                BLL.article_category   bll   = new BLL.article_category();
                model.site_id         = channelModel.site_id;
                model.channel_id      = this.channel_id;
                model.call_index      = txtCallIndex.Text.Trim();
                model.title           = txtTitle.Text.Trim();
                model.parent_id       = int.Parse(ddlParentId.SelectedValue);
                model.sort_id         = int.Parse(txtSortId.Text.Trim());
                model.seo_title       = txtSeoTitle.Text;
                model.seo_keywords    = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url        = txtLinkUrl.Text.Trim();
                model.img_url         = txtImgUrl.Text.Trim();
                model.content         = txtContent.Value;

                if (bll.Add(model) > 0)
                {
                    AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加" + channelModel.name + "频道栏目分类:" + model.title); //记录日志
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
示例#4
0
        private bool DoAdd()
        {
            try
            {
                Model.article_category model = new Model.article_category();
                BLL.article_category   bll   = new BLL.article_category();
                model.site_id         = new BLL.channel().GetSiteId(this.channel_id);
                model.channel_id      = this.channel_id;
                model.call_index      = txtCallIndex.Text.Trim();
                model.title           = txtTitle.Text.Trim();
                model.parent_id       = int.Parse(ddlParentId.SelectedValue);
                model.sort_id         = int.Parse(txtSortId.Text.Trim());
                model.seo_title       = txtSeoTitle.Text;
                model.seo_keywords    = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url        = txtLinkUrl.Text.Trim();
                model.content         = txtContent.Value;
                model.is_page         = int.Parse(rblPage.SelectedValue);
                model.is_lock         = int.Parse(rblStatus.SelectedValue);
                //判断上传图片
                if (this.imgUpload.HasFile)
                {
                    Model.upLoad upfile = new Web.UI.UpLoad().fileSaveAs(this.imgUpload.PostedFile, 0, false, false);
                    if (upfile.status > 0)
                    {
                        model.img_url = upfile.path;
                    }
                }
                else
                {
                    model.img_url = txtImgUrl.Text.Trim();
                }
                //获取管理员
                int           rolo_id    = 0;
                Model.manager adminModel = GetAdminInfo();
                if (adminModel.role_type != 1)
                {
                    rolo_id = adminModel.role_id;
                }

                if (bll.Add(model, rolo_id) > 0)
                {
                    AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "频道栏目分类:" + model.title); //记录日志
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
示例#5
0
        private bool DoAdd()
        {
            try
            {
                Model.article_category model = new Model.article_category();
                BLL.article_category   bll   = new BLL.article_category();
                model.site_id         = channelModel.site_id;
                model.channel_id      = this.channel_id;
                model.call_index      = txtCallIndex.Text.Trim();
                model.title           = txtTitle.Text.Trim();
                model.parent_id       = int.Parse(ddlParentId.SelectedValue);
                model.sort_id         = int.Parse(txtSortId.Text.Trim());
                model.seo_title       = txtSeoTitle.Text;
                model.seo_keywords    = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url        = txtLinkUrl.Text.Trim();
                model.img_url         = txtImgUrl.Text.Trim();
                model.content         = txtContent.Value;

                #region 保存规格====================
                string[] specIdArr = Request.Form.GetValues("hide_spec_id");
                if (specIdArr != null && specIdArr.Length > 0)
                {
                    List <Model.article_category_spec> ls = new List <Model.article_category_spec>();
                    for (int i = 0; i < specIdArr.Length; i++)
                    {
                        int specId = Utils.StrToInt(specIdArr[i], 0);
                        ls.Add(new Model.article_category_spec {
                            spec_id = specId
                        });
                    }
                    model.category_specs = ls;
                }
                #endregion

                if (bll.Add(model) > 0)
                {
                    AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加" + channelModel.name + "频道栏目分类:" + model.title); //记录日志
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
示例#6
0
        private bool DoAdd()
        {
            try
            {
                Model.article_category model = new Model.article_category();
                BLL.article_category   bll   = new BLL.article_category();
                model.channel_id = this.channel_id;
                if (cbIsLock.Checked)
                {
                    model.call_index = "1";
                }
                else
                {
                    model.call_index = "0";
                }
                model.title           = txtTitle.Text.Trim();
                model.parent_id       = int.Parse(ddlParentId.SelectedValue);
                model.sort_id         = int.Parse(txtSortId.Text.Trim());
                model.seo_title       = txtSeoTitle.Text;
                model.seo_keywords    = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url        = txtLinkUrl.Text.Trim();
                model.img_url         = txtImgUrl.Text.Trim();
                model.content         = txtContent.Value;

                if (bll.Add(model) > 0)
                {
                    AddAdminLog(TWEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "頻道欄位分類:" + model.title); //記錄日誌
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
        private bool DoAdd()
        {
            try
            {
                Model.article_category model = new Model.article_category();
                BLL.article_category bll = new BLL.article_category();
                model.channel_id = this.channel_id;
                model.call_index = txtCallIndex.Text.Trim();
                model.title = txtTitle.Text.Trim();
                model.parent_id = int.Parse(ddlParentId.SelectedValue);
                model.sort_id = int.Parse(txtSortId.Text.Trim());
                model.seo_title = txtSeoTitle.Text;
                model.seo_keywords = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url = txtLinkUrl.Text.Trim();
                model.img_url = txtImgUrl.Text.Trim();
                model.content = txtContent.Value;
                model.ico_url = Request.Form["txtImgICO"].Trim();// txtImgICO.Text;
                Model.wx_userweixin weixin = GetWeiXinCode();
                model.wid = weixin.id;

                if (bll.Add(model) > 0)
                {
                    AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "微网站分类:" + model.title); //记录日志
                    return true;
                }
            }
            catch
            {
                return false;
            }
            return false;
        }
示例#8
0
 private bool DoAdd()
 {
     try
     {
         Model.article_category model = new Model.article_category();
         BLL.article_category bll = new BLL.article_category();
         model.channel_id = this.channel_id;
         model.call_index = txtCallIndex.Text.Trim();
         model.title = txtTitle.Text.Trim();
         model.parent_id = int.Parse(ddlParentId.SelectedValue);
         model.sort_id = int.Parse(txtSortId.Text.Trim());
         model.seo_title = txtSeoTitle.Text;
         model.seo_keywords = txtSeoKeywords.Text;
         model.seo_description = txtSeoDescription.Text;
         model.link_url = txtLinkUrl.Text.Trim();
         model.img_url = txtImgUrl.Text.Trim();
         model.content = txtContent.Value;
         if (bll.Add(model) >0)
         {
             AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "频道栏目分类:" + model.title); //记录日志
             return true;
         }
     }
     catch
     {
         return false;
     }
     return false;
 }