private bool DoEdit(int _id) { try { BLL.contents.article_category bll = new BLL.contents.article_category(); Model.contents.article_category model = bll.GetModel(_id); model.title = txtTitle.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = 0; model.call_index = txtName.Text.Trim(); if (cbIsLock.Checked == true) { model.is_lock = 1; } if (model.is_sys == 0) { int parentId = int.Parse(ddlParentId.SelectedValue); //如果选择的父ID不是自己,则更改 if (parentId != model.id) { model.parent_id = parentId; } } model.link_url = txtLinkUrl.Text.Trim(); model.content = txtRemark.Text; //添加操作权限类型 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.Update(model)) { AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "修改导航信息:" + model.title); //记录日志 return(true); } } catch { return(false); } return(false); }
private bool DoEdit(int _id) { try { BLL.contents.article_category bll = new BLL.contents.article_category(); Model.contents.article_category model = bll.GetModel(_id); int parentId = int.Parse(ddlParentId.SelectedValue); model.channel_id = this.channel_id; model.call_index = txtCallIndex.Text.Trim(); model.title = txtTitle.Text.Trim(); //如果选择的父ID不是自己,则更改 //if (parentId != model.id) //{ // model.parent_id = parentId; //} 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 { category_id = model.id, field_id = Utils.StrToInt(cblAttributeField.Items[i].Value, 0) }); } } model.category_fields = ls; if (bll.Update(model)) { AddAdminLog(OSEnums.ActionEnum.Edit.ToString(), "修改" + this.channel_name + "频道栏目分类:" + model.title); //记录日志 return(true); } } catch { return(false); } return(false); }
private bool DoEdit(int _id) { try { BLL.contents.article_category bll = new BLL.contents.article_category(); Model.contents.article_category model = bll.GetModel(_id); model.title = txtTitle.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = 0; model.call_index = txtName.Text.Trim(); if (cbIsLock.Checked == true) { model.is_lock = 1; } if (model.is_sys == 0) { int parentId = int.Parse(ddlParentId.SelectedValue); //如果选择的父ID不是自己,则更改 if (parentId != model.id) { model.parent_id = parentId; } } model.link_url = txtLinkUrl.Text.Trim(); model.content = txtRemark.Text; //添加操作权限类型 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.Update(model)) { AddAdminLog(OSEnums.ActionEnum.Add.ToString(), "修改导航信息:" + model.title); //记录日志 return true; } } catch { return false; } return false; }
private bool DoEdit(int _id) { try { BLL.contents.article_category bll = new BLL.contents.article_category(); Model.contents.article_category model = bll.GetModel(_id); int parentId = int.Parse(ddlParentId.SelectedValue); model.channel_id = this.channel_id; model.call_index = txtCallIndex.Text.Trim(); model.title = txtTitle.Text.Trim(); //如果选择的父ID不是自己,则更改 //if (parentId != model.id) //{ // model.parent_id = parentId; //} 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 { category_id = model.id, field_id = Utils.StrToInt(cblAttributeField.Items[i].Value, 0) }); } } model.category_fields = ls; if (bll.Update(model)) { AddAdminLog(OSEnums.ActionEnum.Edit.ToString(), "修改" + this.channel_name + "频道栏目分类:" + model.title); //记录日志 return true; } } catch { return false; } return false; }