private void BindDataList() { //调用控件 string type = ""; type = rblLimitsChoose.SelectedValue.ToString(); if (type != "") { UserManage1.Type = type; DataTable dt = (DataTable)Session["UserID"]; string SelectVal = ""; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (SelectVal == "") { SelectVal = dt.Rows[i]["UserID"].ToString(); } else { SelectVal += "," + dt.Rows[i]["UserID"].ToString(); } } } UserManage1.SelectVal = SelectVal; UserManage1.Show_GView_UserManage(); } }
private void BindDataList() { string type = ""; type = rblLimitsChoose.SelectedValue.ToString(); if (type != "") { UserManage1.Type = type; UserManage1.Show_GView_UserManage(); } }
/// <summary> ///点击确定按钮触发的事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button_sumbit_Click(object sender, EventArgs e) { try { string NAME = this.txtNAME.Text;//获取到用户名 mNews_News = new Dianda.Model.News_News(); mNews_News = bNews_News.GetModel(Int32.Parse(Request["id"])); mNews_News.NAME = txtNAME.Text; //mNews_News.PARENTID = Int32.Parse(ddlPARENTID.SelectedValue); mNews_News.DATETIME = DateTime.Now; mNews_News.CONTENTS = this.FCKeditor_neirong.Value; // mNews_News.TYPE = 0; mNews_News.KEYWORD = txtNAME.Text; mNews_News.WRITER = ((Model.USER_Users)Session["USER_Users"]).USERNAME; //mNews_News.FILEUP = "";//上传附件/AllFileUp/admin/news/目录下 mNews_News.UPTOP = 0; mNews_News.DELFLAG = 0; mNews_News.ISPASS = 0;//是否通过审核(默认0,1表示通过审核,2表示审核不通过)添加新闻时,需要根据选择栏目的审核设定进行赋值 mNews_News.LimitsChoose = Int32.Parse(this.rblLimitsChoose.SelectedValue); bNews_News.Update(mNews_News); string strSQL = "DELETE FROM News_LimitUser WHERE NewsID=" + Request["id"]; pageControl.doSql(strSQL); string NEWS = ""; if (Request["PARENTID"] == "3") { NEWS = "部门消息"; } else if (Request["PARENTID"] == "4") { NEWS = "个人消息"; } else if (Request["PARENTID"] == "5") { NEWS = "通知公告"; } // 添加News_LimitUser ArrayList arrUserID = UserManage1.getSelectUser(); // 清除旧信息 string strSQL2 = "Update FaceShowMessage set Delflag=1 Where NewsType='" + NEWS + "' and URLS like '%id=" + Request["id"] + "''%'"; pageControl.doSql(strSQL2); if (arrUserID.Count > 0) { for (int k = 0; k < arrUserID.Count; k++) { mNews_LimitUser = new Dianda.Model.News_LimitUser(); mNews_LimitUser.ID = bNews_LimitUser.GetMaxId(); mNews_LimitUser.UserID = arrUserID[k].ToString(); mNews_LimitUser.NewsID = Int32.Parse(Request["id"]); mNews_LimitUser.IsRead = 0; bNews_LimitUser.Add(mNews_LimitUser); /*给业务申请者发信息*/ Model.FaceShowMessage mFaceShowMessage = new Dianda.Model.FaceShowMessage(); BLL.FaceShowMessage bFaceShowMessage = new Dianda.BLL.FaceShowMessage(); mFaceShowMessage.DATETIME = DateTime.Now; mFaceShowMessage.FromTable = NEWS; mFaceShowMessage.IsRead = 0; mFaceShowMessage.NewsID = null; mFaceShowMessage.NewsType = NEWS; mFaceShowMessage.ReadTime = null; mFaceShowMessage.Receive = arrUserID[k].ToString(); mFaceShowMessage.DELFLAG = 0; //mFaceShowMessage.URLS = ((Model.USER_Users)Session["USER_Users"]).REALNAME + "(" + ((Model.USER_Users)Session["USER_Users"]).USERNAME.ToString() + ")给您发送了[" + NEWS + "]!<a href='/Admin/newsManage/OAnews/show.aspx?id=" + intMaxID + "' target='_self' rel='gb_page_center[726,400]' title='查看详细'>点击查看</a>"; mFaceShowMessage.URLS = "<a href=\"javascript:window.showModalDialog('/Admin/newsManage/OAnews/show.aspx?id=" + Request["id"] + "','','dialogWidth=726px;dialogHeight=400px');\" target='_self' title='发布时间:" + DateTime.Now.ToString() + "'>" + NEWS + ":" + NAME + "</a> (" + ((Model.USER_Users)Session["USER_Users"]).REALNAME.ToString() + ")"; bFaceShowMessage.Add(mFaceShowMessage); /*给业务申请者发信息*/ } } //tag.Text = "操作成功!"; string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?PARENTID=" + Request["PARENTID"] + "&pageindex=" + Request["pageindex"] + "&status=" + Request["status"] + "\";</script>"; Response.Write(coutws); //添加操作日志 Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt(); Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"]; bsyslog.addlogs(((Model.USER_Users)Session["USER_Users"]).REALNAME + "(" + ((Model.USER_Users)Session["USER_Users"]).USERNAME + ")", "添加新闻", "添加成功"); //添加操作日志 } catch { tag.Text = "操作失败,请重试!"; } }
/// <summary> ///点击确定按钮触发的事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button_sumbit_Click(object sender, EventArgs e) { string NAME = this.txtNAME.Text;//获取到用户名 if (NAME != "" && NAME != null) { try { //if (String.IsNullOrEmpty(NAME)) //{ // tag.Text = "标题不能为空,请填写标题!"; // return; //} //if (this.ddlPARENTID.SelectedIndex == 0) //{ // tag.Text = "请选择栏目!"; // return; //} int intMaxID = bNews_News.GetMaxId(); mNews_News = new Dianda.Model.News_News(); mNews_News.ID = intMaxID; mNews_News.NAME = txtNAME.Text; mNews_News.PARENTID = Int32.Parse(ddlPARENTID.SelectedValue); mNews_News.DATETIME = DateTime.Now; mNews_News.CONTENTS = this.FCKeditor_neirong.Value; // mNews_News.TYPE = 0; mNews_News.KEYWORD = txtNAME.Text; mNews_News.WRITER = ((Model.USER_Users)Session["USER_Users"]).USERNAME; //mNews_News.FILEUP = "";//上传附件/AllFileUp/admin/news/目录下 mNews_News.UPTOP = 0; mNews_News.DELFLAG = 0; mNews_News.ISPASS = 0;//是否通过审核(默认0,1表示通过审核,2表示审核不通过)添加新闻时,需要根据选择栏目的审核设定进行赋值 mNews_News.LimitsChoose = Int32.Parse(this.rblLimitsChoose.SelectedValue); bNews_News.Add(mNews_News); // 添加News_LimitUser ArrayList arrUserID = UserManage1.getSelectUser(); if (arrUserID.Count > 0) { for (int k = 0; k < arrUserID.Count; k++) { mNews_LimitUser = new Dianda.Model.News_LimitUser(); mNews_LimitUser.ID = bNews_LimitUser.GetMaxId(); mNews_LimitUser.UserID = arrUserID[k].ToString(); mNews_LimitUser.NewsID = intMaxID; mNews_LimitUser.IsRead = 0; bNews_LimitUser.Add(mNews_LimitUser); /*给业务申请者发信息*/ Model.FaceShowMessage mFaceShowMessage = new Dianda.Model.FaceShowMessage(); BLL.FaceShowMessage bFaceShowMessage = new Dianda.BLL.FaceShowMessage(); mFaceShowMessage.DATETIME = DateTime.Now; mFaceShowMessage.FromTable = this.ddlPARENTID.SelectedItem.Text; mFaceShowMessage.IsRead = 0; mFaceShowMessage.NewsID = null; mFaceShowMessage.NewsType = "项目消息";// this.ddlPARENTID.SelectedItem.Text; mFaceShowMessage.ReadTime = null; mFaceShowMessage.Receive = arrUserID[k].ToString(); //mFaceShowMessage.URLS = ((Model.USER_Users)Session["USER_Users"]).REALNAME + "(" + ((Model.USER_Users)Session["USER_Users"]).USERNAME.ToString() + ")给您发送了[" + this.ddlPARENTID.SelectedItem.Text + "]!<a href='/Admin/newsManage/OAnews/show.aspx?id=" + intMaxID + "' target='_self' rel='gb_page_center[726,400]' title='查看详细'>点击查看</a>"; mFaceShowMessage.URLS = "<a href=\"javascript:window.showModalDialog('/Admin/newsManage/OAnews/show.aspx?id=" + intMaxID + " ','','dialogWidth=726px;dialogHeight=400px');\" target='_self' title='发布时间:" + DateTime.Now.ToString() + "'>" + NAME + "</a> " + ddlPARENTID.SelectedItem.Text + " 项目消息 (" + ((Model.USER_Users)Session["USER_Users"]).REALNAME.ToString() + ")"; mFaceShowMessage.ProjectID = int.Parse(Session["Work_ProjectId"].ToString()); mFaceShowMessage.DELFLAG = 0; bFaceShowMessage.Add(mFaceShowMessage); /*给业务申请者发信息*/ } } // tag.Text = "操作成功!"; string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "&status=" + Request["status"] + "&PARENTID=" + Request["PARENTID"] + "\";</script>"; Response.Write(coutws); //添加操作日志 Dianda.BLL.SYS_LogsExt bsyslog = new Dianda.BLL.SYS_LogsExt(); Model.USER_Users user_model = (Model.USER_Users)Session["USER_Users"]; bsyslog.addlogs(((Model.USER_Users)Session["USER_Users"]).REALNAME + "(" + ((Model.USER_Users)Session["USER_Users"]).USERNAME + ")", "添加新闻", "添加成功"); //添加操作日志 } catch { tag.Text = "操作失败,请重试!"; } } else { tag.Text = "操作失败,标题不能为空!"; } }