Пример #1
0
        private bool DoAdd()
        {
            try
            {
                Model.contents.article_category model = new Model.contents.article_category();
                BLL.contents.article_category   bll   = new BLL.contents.article_category();

                model.nav_type   = OSEnums.NavigationEnum.System.ToString().Trim();;
                model.title      = txtTitle.Text.Trim();
                model.channel_id = -1;
                model.call_index = txtName.Text.Trim();
                model.link_url   = txtLinkUrl.Text.Trim();
                model.content    = txtRemark.Text;
                model.sort_id    = int.Parse(txtSortId.Text.Trim());
                model.is_lock    = 0;
                if (cbIsLock.Checked == true)
                {
                    model.is_lock = 1;
                }
                model.parent_id = int.Parse(ddlParentId.SelectedValue);

                //添加操作权限类型
                string action_type_str = string.Empty;
                for (int i = 0; i < cblActionType.Items.Count; i++)
                {
                    if (cblActionType.Items[i].Selected && Utils.ActionType().ContainsKey(cblActionType.Items[i].Value))
                    {
                        action_type_str += cblActionType.Items[i].Value + ",";
                    }
                }
                model.action_type = Utils.DelLastComma(action_type_str);

                if (bll.Add(model) > 0)
                {
                    AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "添加导航信息:" + model.title); //记录日志
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
Пример #2
0
        private bool DoAdd()
        {
            try
            {
                Model.contents.article_category model = new Model.contents.article_category();
                BLL.contents.article_category   bll   = new BLL.contents.article_category();
                model.channel_id = this.channel_id;
                model.nav_type   = OSEnums.NavigationEnum.WebSite.ToString().Trim();
                model.call_index = txtCallIndex.Text.Trim();
                model.title      = txtTitle.Text.Trim();

                //  model.parent_id = int.Parse(ddlParentId.SelectedValue);
                model.parent_id       = this.id;
                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.model_id        = int.Parse(rblStatus.SelectedValue);
                model.is_add_category = 0;
                model.is_add_content  = 0;
                model.is_show_top     = 0;
                model.is_show_foot    = 0;
                if (cblItem.Items[0].Selected == true)
                {
                    model.is_add_category = 1;
                }
                if (cblItem.Items[1].Selected == true)
                {
                    model.is_add_content = 1;
                }
                if (cblItem.Items[2].Selected == true)
                {
                    model.is_show_top = 1;
                }
                if (cblItem.Items[3].Selected == true)
                {
                    model.is_show_foot = 1;
                }

                if (cbIsAlbums.Checked == true)
                {
                    model.is_albums = 1;
                }
                if (cbIsAttach.Checked == true)
                {
                    model.is_attach = 1;
                }
                model.page_size = Utils.StrToInt(txtPageSize.Text.Trim(), 10);
                //添加频道扩展字段
                List <Model.contents.category_field> ls = new List <Model.contents.category_field>();
                for (int i = 0; i < cblAttributeField.Items.Count; i++)
                {
                    if (cblAttributeField.Items[i].Selected)
                    {
                        ls.Add(new Model.contents.category_field {
                            field_id = Utils.StrToInt(cblAttributeField.Items[i].Value, 0)
                        });
                    }
                }
                model.category_fields = ls;

                if (bll.Add(model) > 0)
                {
                    AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "频道栏目分类:" + model.title); //记录日志
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
Пример #3
0
        private bool DoAdd()
        {
            try
            {
                Model.contents.article_category model = new Model.contents.article_category();
                BLL.contents.article_category bll = new BLL.contents.article_category();

                model.nav_type = OSEnums.NavigationEnum.System.ToString().Trim();;
                model.title = txtTitle.Text.Trim();
                model.channel_id = -1;
                model.call_index = txtName.Text.Trim();
                model.link_url = txtLinkUrl.Text.Trim();
                model.content = txtRemark.Text;
                model.sort_id = int.Parse(txtSortId.Text.Trim());
                model.is_lock = 0;
                if (cbIsLock.Checked == true)
                {
                    model.is_lock = 1;
                }
                model.parent_id = int.Parse(ddlParentId.SelectedValue);

                //添加操作权限类型
                string action_type_str = string.Empty;
                for (int i = 0; i < cblActionType.Items.Count; i++)
                {
                    if (cblActionType.Items[i].Selected && Utils.ActionType().ContainsKey(cblActionType.Items[i].Value))
                    {
                        action_type_str += cblActionType.Items[i].Value + ",";
                    }
                }
                model.action_type = Utils.DelLastComma(action_type_str);

                if (bll.Add(model) > 0)
                {
                    AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "添加导航信息:" + model.title); //记录日志
                    return true;
                }
            }
            catch
            {
                return false;
            }
            return false;
        }
Пример #4
0
        private bool DoAdd()
        {
            try
            {
                Model.contents.article_category model = new Model.contents.article_category();
                BLL.contents.article_category bll = new BLL.contents.article_category();
                model.channel_id = this.channel_id;
                model.nav_type = OSEnums.NavigationEnum.WebSite.ToString().Trim();
                model.call_index = txtCallIndex.Text.Trim();
                model.title = txtTitle.Text.Trim();

                //  model.parent_id = int.Parse(ddlParentId.SelectedValue);
                model.parent_id = this.id;
                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.model_id = int.Parse(rblStatus.SelectedValue);
                model.is_add_category = 0;
                model.is_add_content = 0;
                model.is_show_top = 0;
                model.is_show_foot = 0;
                if (cblItem.Items[0].Selected == true)
                {
                    model.is_add_category = 1;
                }
                if (cblItem.Items[1].Selected == true)
                {
                    model.is_add_content = 1;
                }
                if (cblItem.Items[2].Selected == true)
                {
                    model.is_show_top = 1;
                }
                if (cblItem.Items[3].Selected == true)
                {
                    model.is_show_foot = 1;
                }

                if (cbIsAlbums.Checked == true)
                {
                    model.is_albums = 1;
                }
                if (cbIsAttach.Checked == true)
                {
                    model.is_attach = 1;
                }
                model.page_size = Utils.StrToInt(txtPageSize.Text.Trim(), 10);
                //添加频道扩展字段
                List<Model.contents.category_field> ls = new List<Model.contents.category_field>();
                for (int i = 0; i < cblAttributeField.Items.Count; i++)
                {
                    if (cblAttributeField.Items[i].Selected)
                    {
                        ls.Add(new Model.contents.category_field { field_id = Utils.StrToInt(cblAttributeField.Items[i].Value, 0) });
                    }
                }
                model.category_fields = ls;

                if (bll.Add(model) > 0)
                {
                    AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "频道栏目分类:" + model.title); //记录日志
                    return true;
                }
            }
            catch
            {
                return false;
            }
            return false;
        }