protected void UpPlat_B_Click(object sender, EventArgs e) { M_UserInfo mu = buser.SelReturnModel(UserID); M_User_Plat upMod = upBll.SelReturnModel(UserID); M_Plat_Comp compMod = new M_Plat_Comp(); B_Plat_Comp compBll = new B_Plat_Comp(); if (upMod == null) { //------------------------------------ upMod = new M_User_Plat(); upMod.UserID = mu.UserID; upMod.TrueName = B_User.GetUserName(mu.HoneyName, mu.TrueName, mu.UserName); upMod.Post = ""; upMod.Status = 1; //---------------------------------------- compBll.CreateByUser(upMod); upBll.Insert(upMod); } else { if (upMod.CompID == 0)//兼容之前的逻辑 { compBll.CreateByUser(upMod); } upMod.Status = 1; upBll.UpdateByID(upMod); } ShowPlatInfo(upMod.UserID); function.WriteSuccessMsg("操作成功,你现在可以为该用户指定公司"); }
protected void Save_Btn_Click(object sender, EventArgs e) { M_UserInfo mu = buser.SelReturnModel(UserID); M_User_Plat upMod = upBll.SelReturnModel(UserID); M_Plat_Group gpMod = gpBll.SelReturnModel(DataConvert.CLng(PlatGroup_DP.SelectedValue)); M_Plat_Comp compMod = compBll.SelReturnModel(Convert.ToInt32(PlatComp_DP.SelectedValue)); if (upMod == null) { upMod = upBll.NewUser(mu, compMod); upMod.Plat_Group = PlatGroup_DP.SelectedValue; upBll.Insert(upMod); } else { upMod.CompID = compMod.ID; upMod.Status = 1; upBll.UpdateByID(upMod); } if (gpMod != null) { gpBll.AddMember(UserID.ToString(), gpMod.ID); } function.WriteSuccessMsg("操作成功", Request.RawUrl); }
protected void Sure_Btn_Click(object sender, EventArgs e) { M_UserInfo mu = buser.GetLogin(); ////------------UserBase //bool isExist = true; //M_Uinfo muinfo = buser.GetUserBaseByuserid(mu.UserID); //if (muinfo == null) //{ // isExist = false; // muinfo = new M_Uinfo(); // muinfo.UserId = mu.UserID; //} //muinfo.TrueName = TrueName_T.Text; //muinfo.Mobile = Mobile_T.Text; //muinfo.CompanyName = CompName_T.Text; //if (isExist) // buser.UpdateBase(muinfo); //else // buser.AddBase(muinfo); //------------M_Plat_User int compid = Convert.ToInt32(EncryptHelper.AESDecrypt(Request.QueryString["Info"])); upMod.UserID = mu.UserID; upMod.CompID = compid; upMod.Mobile = Mobile_T.Text; upMod.TrueName = TrueName_T.Text; upMod.Post = Post_T.Text; upMod.Status = 0; upMod.CreateTime = DateTime.Now; upBll.Insert(upMod); Response.Redirect("/Plat/Blog/"); }
protected void BatAgree_Btn_Click(object sender, EventArgs e) { string ids = Request.Form["idchk"]; //修改公司状态,并更正名称 DataTable dt = ualyBll.Search(ztype, ids, "", (int)ZLEnum.ConStatus.UnAudit, 0); foreach (DataRow dr in dt.Rows) { M_Common_UserApply ualyMod = new M_Common_UserApply().GetModelFromReader(dr); M_UserInfo mu = buser.SelReturnModel(ualyMod.UserID); //-------------创建公司和用户 M_User_Plat upMod = upBll.NewUser(mu); M_Plat_Comp compMod = compBll.CreateByUser(upMod); compMod.CompName = ualyMod.CompName; compMod.CompShort = ualyMod.Info1; compMod.Telephone = ualyMod.Mobile; compMod.Mobile = ualyMod.Mobile; compMod.Status = 1; compBll.UpdateByID(compMod); upBll.Insert(upMod); //-------------创建部门 DataTable userDT = GetUserDT(); NewByUserDT(compMod, userDT); } ualyBll.ChangeByIDS(ids, (int)ZLEnum.ConStatus.Audited); function.WriteSuccessMsg("批量同意完成"); }
protected void UpPlat_B_Click(object sender, EventArgs e) { M_User_Plat platModel = new M_User_Plat(); platModel.UserID = Convert.ToInt32(Request.QueryString["id"]); platModel.TrueName = "初始用户"; platModel.Post = "初始部门"; platModel.CompID = 1; platModel.Status = 1; PlatBll.Insert(platModel); ShowPlatInfo(platModel.UserID); }
protected void BatAdd_Btn_Click(object sender, EventArgs e) { M_Plat_Comp compMod = compBll.SelReturnModel(CompID); string[] ids = UserIDS_Hid.Value.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < ids.Length; i++) { int uid = DataConvert.CLng(ids[i]); M_User_Plat upMod = upBll.SelReturnModel(uid); if (upMod == null) { M_UserInfo newmu = buser.SelReturnModel(uid); upMod = upBll.NewUser(newmu, compMod); upBll.Insert(upMod); } else { upMod.CompID = CompID; upBll.UpdateByID(upMod); } } MyBind(); }
//选择好用户后,为其创建相关信息 protected void Submit_Btn_Click(object sender, EventArgs e) { int uid = Convert.ToInt32(User_Hid.Value.Split(',')[0]); M_UserInfo mu = buser.SelReturnModel(uid); if (mu.IsNull) { function.WriteErrMsg("用户[" + User_T.Text + "]不存在"); } if (upBll.SelReturnModel(uid) != null) { function.WriteErrMsg("创建失败:用户" + User_T.Text + "已经有了企业,不能重复创建"); } M_Plat_Comp compMod = new M_Plat_Comp(); M_Plat_UserRole urMod = new M_Plat_UserRole(); DataTable userDT = JsonConvert.DeserializeObject <DataTable>(UserInfo_Hid.Value);//为空下是否会报错 if (SFileUp.HasFile) { SFileUp.SaveFile(); } //------------------公司 compMod.CompName = CompName_T.Text; compMod.Status = 1; compMod.CreateUser = mu.UserID; compMod.CompLogo = SFileUp.FileUrl; compMod.UPPath = compBll.CreateUPPath(compMod); compMod.ID = compBll.Insert(compMod); //------------------角色 urMod.IsSuper = 1; urMod.RoleAuth = ""; urMod.CompID = compMod.ID; urMod.RoleName = "网络管理员"; urMod.RoleDesc = "公司网络管理员,拥有全部权限,该角色只允许存在一个"; urMod.UserID = mu.UserID; urMod.ID = urBll.Insert(urMod); //------------------网络管理员 { M_User_Plat upMod = upBll.NewUser(mu, compMod); upMod.Plat_Role = "," + urMod.ID + ","; upBll.Insert(upMod); M_Plat_Group gpMod = NewGroup(upMod.CompID, "办公部门", upMod.UserID); gpBll.Insert(gpMod); } //------------------其他权限管理员 { for (int i = 0; i < userDT.Rows.Count; i++) { string gname = userDT.Rows[i]["gname"].ToString(); string uname = userDT.Rows[i]["uname"].ToString(); string honey = userDT.Rows[i]["honey"].ToString(); if (string.IsNullOrEmpty(uname)) { continue; } M_UserInfo newmu = buser.NewUser(uname, "111111"); newmu.HoneyName = honey; newmu.UserID = buser.Add(newmu); M_Uinfo basemu = buser.NewBase(newmu); buser.AddBase(basemu); //----能力相关信息 M_Plat_Group gpMod = NewGroup(compMod.ID, gname, newmu.UserID); M_User_Plat upMod = upBll.NewUser(newmu, compMod); gpMod.ID = gpBll.Insert(gpMod); upMod.Gid = gpMod.ID.ToString(); upBll.Insert(upMod); } } function.WriteSuccessMsg(mu.UserName + "的企业[" + compMod.CompName + "]创建成功", "CompList.aspx"); }