private void save_Role(HttpContext context) { int mid = DTRequest.GetFormInt("mid"); BLL.selfMessage bll = new BLL.selfMessage(); Model.selfMessage model = bll.GetModel(mid); model.me_isRead = true; bll.Update(model); context.Response.End(); }
private string DoEdit(int _id) { BLL.selfMessage bll = new BLL.selfMessage(); Model.selfMessage model = bll.GetModel(_id); model.me_isRead = cbIsRead.Checked; if (bll.Update(model)) { return(""); } return("修改失败"); }
private void self_Message(HttpContext context) { Model.manager adminModel = new ManagePage().GetAdminInfo();//获得当前登录管理员信息 BLL.selfMessage bll = new BLL.selfMessage(); DataSet ds = bll.getUnReadMessage(adminModel.user_name, adminModel.real_name); if (ds != null && ds.Tables.Count > 0) { context.Response.Write(JArray.FromObject(ds.Tables[0])); context.Response.End(); } context.Response.Write("[]"); context.Response.End(); }
private void ShowInfo(int _id) { BLL.selfMessage bll = new BLL.selfMessage(); Model.selfMessage model = bll.GetModel(_id); labTitle.Text = model.me_title; labContent.Text = model.me_content; if (model.me_isRead.Value) { cbIsRead.Checked = true; } else { cbIsRead.Checked = false; } }
private void RptBind(string _strWhere, string _orderby) { if (!this.isSearch) { this.page = DTRequest.GetQueryInt("page", 1); } else { this.page = 1; } this.txtKeywords.Text = this.keywords; BLL.selfMessage bll = new BLL.selfMessage(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("selfMessage.aspx", "txtKeywords={0}&page={1}&ddlisRead={2}", this.keywords, "__id__", _isRead); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//批量已读 protected void btnRead_Click(object sender, EventArgs e) { ChkAdminLevel("sys_myself_message", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.selfMessage bll = new BLL.selfMessage(); string idstr = string.Empty; for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { idstr += id.ToString() + ","; } } idstr = idstr.TrimEnd(','); if (bll.updateRecordReadStatus(idstr) > 0) { JscriptMsg("操作成功!", Utils.CombUrlTxt("selfMessage.aspx", "txtKeywords={0}&ddlisRead={1}", this.keywords, _isRead), ""); } JscriptMsg("操作失败!", Utils.CombUrlTxt("selfMessage.aspx", "txtKeywords={0}&ddlisRead={1}", this.keywords, _isRead), ""); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("sys_myself_message", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.selfMessage bll = new BLL.selfMessage(); logmodel = new Model.business_log(); string idstr = string.Empty; for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { idstr += id.ToString() + ","; } } idstr = idstr.TrimEnd(','); DataSet ds = bll.GetList(0, "me_id in (" + idstr + ")", ""); string nameStr = string.Empty; if (ds != null && ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { nameStr += "[" + dr["me_id"] + "]" + dr["me_title"] + ","; } nameStr = nameStr.TrimEnd(','); if (bll.Delete(idstr)) { logmodel.ol_title = "删除个人消息"; logmodel.ol_content = nameStr; logmodel.ol_operateDate = DateTime.Now; AddBusinessLog(DTEnums.ActionEnum.Delete.ToString(), logmodel); //记录日志 JscriptMsg("删除成功!", Utils.CombUrlTxt("selfMessage.aspx", "keywords={0}&ddlisRead={1}", this.keywords, _isRead), ""); } } JscriptMsg("删除失败!", Utils.CombUrlTxt("selfMessage.aspx", "txtKeywords={0}&ddlisRead={1}", this.keywords, _isRead), ""); }