/// <summary> /// 添加、修改稿件栏目 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdd_Click(object sender, EventArgs e) { ArticleColumn articleColumn = new ArticleColumn(); articleColumn.Name = txtName.Text; articleColumn.Description = txtDepict.Text; articleColumn.ResponsibelUserId = int.Parse(DropName.SelectedValue); //添加新栏目 if (lblColumn.Text == "添加新栏目") { ArticleColumnManager.InsertArticleColumn(articleColumn); } //修改栏目信息 else if (lblColumn.Text == "修改栏目信息") { articleColumn.Id = int.Parse(lblId.Text); ArticleColumnManager.UpdateArticleColumn(articleColumn); lblColumn.Text = "添加新栏目"; } //清空填写的信息 txtName.Text = ""; txtDepict.Text = ""; DropName.SelectedIndex = 0; DataBing_(); }
/// <summary> /// 响应责编完成按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnFinishResponsible(object sender, EventArgs e) { //获取基础信息 GeneralUser userResponsible = new GeneralUser(); this.GetGeneralInfo(userResponsible); //添加责编到库 if ((userResponsible.Id = UserManager.InsertGeneralUserReturnIndentity(userResponsible)) != 0) { //更新栏目 for (int i = 0; i < this.CBLArticleColumn.Items.Count; i++) { if (this.CBLArticleColumn.Items[i].Selected) { //搜出栏目 对象 int columnId = Convert.ToInt32(this.CBLArticleColumn.Items[i].Value); ArticleColumn articleColumn = ArticleColumnManager.GetArticleColumnById(columnId); //更新栏目对应责编 articleColumn.ResponsibelUserId = userResponsible.Id; articleColumn.UserInfo_Name = userResponsible.Name; ArticleColumnManager.UpdateArticleColumn(articleColumn); } } } else { return; } //显示成功页面 this.HideAllPanel(); this.PanelSuccess.Visible = true; }