/// <summary> /// 添加 /// </summary> /// <param name="userfrom"></param> /// <param name="usertolist"></param> /// <param name="filename"></param> /// <param name="titlename"></param> private void doSave(string userfrom, string usertolist, string filename, string titlename) { //可以添加到表中 docFromModel.ID = commnid.GetGUID(); docFromModel.DATETIME = DateTime.Now; docFromModel.DELFLAG = 0; docFromModel.FILEPATH = filename; docFromModel.FROMUSER = userfrom; docFromModel.TITLES = titlename; docFromModel.TOUSER = usertolist; docFromBll.Add(docFromModel);//添加到发件箱 string[] userarray = usertolist.Split(','); for (int i = 0; i < userarray.Length; i++) { if (userarray[i].Length > 0) { docToModel.DATETIME = DateTime.Now; docToModel.DELFLAG = 0; docToModel.FILEPATH = filename; docToModel.FROMUSER = userfrom; docToModel.ID = commnid.GetGUID(); docToModel.ISREAD = 0; docToModel.READTIME = null; docToModel.TITLES = titlename; docToModel.TOUSER = userarray[i].ToString(); docToBll.Add(docToModel);//添加到收件箱 } } }
/// <summary> /// 确定提交新的组 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button_sumbit_Click(object sender, EventArgs e) { try { if (TextBox_NAME.Text.ToString().Length > 0) { mUsergroup.DELFLAG = 0; mUsergroup.ISMOREN = 0; mUsergroup.NAME = TextBox_NAME.Text.ToString(); mUsergroup.ISMOREN = 0;// int.Parse(TextBox_ISMOREN.Text.ToString()); mUsergroup.TAGS = DropDownList_roles.SelectedItem.Value.ToString(); ArrayList al = rolemodel1.getSelectUser(); string rols = ""; if (al.Count > 0) { for (int i = 0; i < al.Count; i++) { if (i == al.Count - 1) { rols = rols + al[i].ToString(); } else { rols = rols + al[i].ToString() + ","; } } } mUsergroup.ROLE = rols; mUsergroup.ID = commons.GetGUID(); bUsergroup.Add(mUsergroup); ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('添加完成!')", true); addrole.Visible = false; //设置模板页中的管理值 (Master.FindControl("Label_navigation") as Label).Text = "管理 > 组管理 > 用户组列表"; //设置模板页中的管理值 showlist(DropDownList_roles.SelectedItem.Value.ToString()); } else { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('组名称不能为空!')", true); } } catch { ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('操作失败,请重试!')", true); } }