private void SetProductIsShow() { int id = RequestHelper.GetFormInt("id"); BLL.common_article bll = new BLL.common_article(); Model.common_article model = bll.GetModel(id); if (model != null) { if (model.upvote == (int)EnumCollection.YesOrNot.是) { model.upvote = (int)EnumCollection.YesOrNot.否; } else { model.upvote = (int)EnumCollection.YesOrNot.是; } bll.Update(model); HttpContext.Current.Response.Write("1"); HttpContext.Current.Response.End(); } else { HttpContext.Current.Response.Write("0"); HttpContext.Current.Response.End(); } }
private bool DoEdit(int id) { BLL.common_article bll = new BLL.common_article(); Model.common_article model = bll.GetModel(id); model.group_id = (int)EnumCollection.article_group.关于我们; model.user_id = 0; model.category_id = 0; model.title = Convert.ToString(txttitle.Text); model.subtitle = ""; model.contents = Convert.ToString(txtcontents.Text); model.img_src = ""; model.click = 0; model.upvote = 0; model.status = (int)EnumCollection.YesOrNot.是; model.add_time = System.DateTime.Now; if (bll.Update(model)) { AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改关于我们,主键:" + id); //记录日志 return(true); } else { return(false); } }
//保存 protected void btnSubmit_Click(object sender, EventArgs e) { ChkAdminLevel("_ybd_common_article", EnumCollection.ActionEnum.Modify.ToString()); //检查权限 BLL.common_article bll = new BLL.common_article(); Model.common_article model = bll.GetModel(this.id); model.group_id = Convert.ToInt32(txtgroup_id.Text); model.user_id = Convert.ToInt32(txtuser_id.Text); model.category_id = Convert.ToInt32(txtcategory_id.Text); model.title = Convert.ToString(txttitle.Text); model.subtitle = Convert.ToString(txtsubtitle.Text); model.contents = Convert.ToString(txtcontents.Text); model.img_src = Convert.ToString(txtimg_src.Text); model.click = Convert.ToInt32(txtclick.Text); model.upvote = Convert.ToInt32(txtupvote.Text); model.status = Convert.ToInt32(txtstatus.Text); model.add_time = Convert.ToDateTime(txtadd_time.Text); if (bll.Update(model)) { AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改全局文章信息,主键:" + id); //记录日志 JscriptMsg("修改全局文章信息成功!", "Manage.aspx"); } else { JscriptMsg("保存过程中发生错误!", ""); } }
private bool DoEdit(int id) { BLL.common_article bll = new BLL.common_article(); Model.common_article model = bll.GetModel(this.id); model.group_id = (int)EnumCollection.article_group.精品微课问题讨论; model.user_id = 0; model.category_id = this.chapter; model.title = Convert.ToString(txttitle.Text); model.contents = Convert.ToString(txtcontents.Text); if (bll.Update(model)) { #region 保存图片 string[] albumArr = Request.Form.GetValues("hid_photo_name"); if (albumArr != null && albumArr.Length > 0) { DBUtility.DbHelperSQL.ExecuteSql("delete ybd_common_albums where rc_guid=" + model.id + " and group_id=" + (int)EnumCollection.img_group.精品微课问题讨论图片);//删除图片 for (int i = 0; i < albumArr.Length; i++) { string[] imgArr = albumArr[i].Split('|'); if (imgArr.Length == 3) { var img = new Model.common_albums { group_id = (int)EnumCollection.img_group.精品微课问题讨论图片, rc_type = 0, rc_data_id = id, add_time = DateTime.Now, original_path = imgArr[1], thumb_path = imgArr[2], remark = "" }; new BLL.common_albums().Add(img); } } } #endregion 保存图片 AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改问题讨论信息,主键:" + model.id); //记录日志 return(true); } else { return(false); } }
private bool DoEdit(int id) { BLL.common_article bll = new BLL.common_article(); Model.common_article model = bll.GetModel(this.id); model.category_id = Convert.ToInt32(ddlCategory.SelectedValue); model.contents = Convert.ToString(txtcontents.Text.Trim()); if (bll.Update(model)) { AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改服务项目,主键:" + model.id); //记录日志 return(true); } else { return(false); } }
private bool DoEdit() { BLL.common_article bll = new BLL.common_article(); Model.common_article model = bll.GetModel(this.id); model.group_id = (int)EnumCollection.article_group.课堂公告; if (adminInfo != null) { if (adminInfo.role_type == 2)//教师 { Model.user_info user = new BLL.user_info().GetModel(" phone = '" + adminInfo.user_name + "' "); model.user_id = user.id; } else if (adminInfo.role_type == 1)//超管 { Model.classroom_info ciModel = new BLL.classroom_info().GetModel(this.class_id); if (ciModel != null) { model.user_id = ciModel.user_id; } } } model.category_id = Convert.ToInt32(ddlClassroom.SelectedValue); //model.category_id = this.class_id; model.title = Convert.ToString(txttitle.Text); model.subtitle = ""; model.contents = Convert.ToString(txtcontents.Text); model.img_src = Convert.ToString(txtimg_src.Text); model.click = 0; model.upvote = 0; model.status = 1; if (bll.Update(model)) { AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改课堂公告信息,主键:" + id); //记录日志 return(true); } else { return(false); } }
private bool DoEdit(int id) { BLL.common_article bll = new BLL.common_article(); Model.common_article model = bll.GetModel(this.id); model.title = Convert.ToString(txttitle.Text.Trim()); model.contents = Convert.ToString(txtcontents.Text.Trim()); model.img_src = Convert.ToString(txtimg_src.Text.Trim()); if (bll.Update(model)) { AddAdminLog(EnumCollection.ActionEnum.Modify.ToString(), "修改我们的团队,主键:" + model.id); //记录日志 return(true); } else { return(false); } }