protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable compDT = compBll.Sel(); if (UserID < 1) { function.WriteErrMsg("未指定需要操作的用户"); } if (compDT.Rows.Count < 1) { function.WriteErrMsg("还没有公司数据,请先添加公司"); } M_UserInfo mu = buser.SelReturnModel(UserID); UserName_L.Text = mu.UserName; PlatComp_DP.DataSource = compDT; PlatComp_DP.DataBind(); PlatGroup_DP.DataSource = gpBll.SelByCompID(Convert.ToInt32(PlatComp_DP.SelectedValue)); PlatGroup_DP.DataBind(); PlatGroup_DP.Items.Insert(0, new ListItem("不分配", "")); //--------- M_User_Plat upMod = upBll.SelReturnModel(UserID); if (upMod == null || upMod.CompID < 1) { PlatInfo_L.Text = "<span style='color:red;'>该用户尚未加入过能力中心</span>"; Remove_Btn.Visible = false; } else { PlatInfo_L.Text += "<span class='btn btn-default margin_r5'>所属公司:" + (string.IsNullOrEmpty(upMod.CompName) ? "无" : upMod.CompName) + "</span>"; PlatInfo_L.Text += "<span class='btn btn-default margin_r5'>所属部门:" + (string.IsNullOrEmpty(upMod.GroupName) ? "未分配" : upMod.GroupName) + "</span>"; } Call.HideBread(Master); } }
void ShowPlatInfo(int id) { M_User_Plat platModel = PlatBll.SelReturnModel(id); if (platModel != null) { platInfo_A.Visible = true; tbTrueName_T.Text = platModel.TrueName; DataTable dt = new B_Plat_Comp().Sel(); tbCompName_D.DataSource = dt; tbCompName_D.DataBind(); tbPost_T.Text = platModel.Post; tbPhone_T.Text = platModel.Mobile; } }
protected void Page_Load(object sender, EventArgs e) { B_User.CheckIsLogged(Request.RawUrl); if (!IsPostBack) { M_UserInfo mu = buser.GetLogin(); M_Uinfo basemu = buser.GetUserBaseByuserid(mu.UserID); if (basemu != null) { Mobile_T.Text = basemu.Mobile; Email_T.Text = mu.Email; CompName_T.Text = mu.CompanyName; QQ_T.Text = basemu.QQ; } M_User_Plat upMod = upBll.SelReturnModel(mu.UserID); if (upMod != null && upMod.Status != -1) { ShowRemind("你已开通能力中心,不需要再申请"); } else if (alyBll.IsExist("plat_applyopen", mu.UserID)) { ShowRemind("你提交的审请正在审核中..."); } } }
private void MyBind() { M_User_Plat upMod = upBll.SelReturnModel(UserID); M_Plat_Comp compMod = compBll.SelReturnModel(upMod.CompID); if (upMod.CompID != B_User_Plat.GetLogin().CompID) { function.WriteErrMsg("用户不存在"); } HoneyName_L.InnerHtml = B_User.GetUserName(upMod.UserName, upMod.TrueName); Post_L.InnerHtml = GetInfo(upMod.Post); CompName_l.InnerHtml = upMod.CompName; if (!string.IsNullOrEmpty(upMod.UserFace)) { uface_img.Src = upMod.UserFace; } //--------- Mobile_L.Text = GetInfo(upMod.Mobile); Mail_L.Text = GetInfo(""); WorkNum_L.Text = GetInfo(""); Work_L.Text = GetInfo(""); Home_L.Text = GetInfo(""); BirthDay_L.Text = GetInfo(""); uid_hid.Value = upMod.UserID.ToString(); }
public void MyBind(int id) { upMod = upBll.SelReturnModel(id); pre_img.ImageUrl = upMod.UserFace; username_T.Value = upMod.UserName; trueName_L.Text = upMod.TrueName; position_L.Text = upMod.Post; mobile_L.Text = upMod.Mobile; group_L.Text = upMod.GroupName; }
void ShowPlatInfo(int id) { M_User_Plat upMod = PlatBll.SelReturnModel(id); if (upMod != null) { DataTable compdt = new B_Plat_Comp().Sel(); platInfo_A.Visible = true; tbTrueName_T.Text = upMod.TrueName; tbCompName_D.DataSource = compdt; tbCompName_D.DataBind(); tbCompName_D.Items.Insert(0, new ListItem() { Text = "未指定公司", Value = "0" }); tbCompName_D.SelectedValue = upMod.CompID.ToString(); tbPost_T.Text = upMod.GroupName; //tbPhone_T.Text = platModel.Mobile; } }
public void MyBind() { M_Plat_Group gpMod = gpBll.SelReturnModel(Gid); M_User_Plat upMod = upBll.SelReturnModel(gpMod.CreateUser); GName_L.Text = gpMod.GroupName; DataTable dt = upBll.SelByGroup(upMod.CompID, Gid); EGV.DataSource = dt; EGV.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (B_User_Plat.GetLogin().CompID < 1) { function.WriteErrMsg("您还不是企业会员,请加入企业再使用考勤功能!"); } if (B_User_Plat.GetLogin().CompID <= 0) { stats_a.Visible = false; } if (UserID > 0) { if (userpBll.SelReturnModel(UserID).CompID != B_User_Plat.GetLogin().CompID) { function.WriteErrMsg("只可查看本公司员工的考勤信息!"); } Tit_L.Text = userpBll.SelReturnModel(UserID).TrueName + "-考勤信息"; } MyBind(); } }
void ShowPlatInfo(int id) { try { M_User_Plat upMod = upBll.SelReturnModel(id); if (upMod != null && upMod.Status != -1) { platInfo_A.Visible = true; DownPlat_B.Visible = true; tbTrueName_L.Text = upMod.TrueName; tbCompName_L.Text = upMod.CompName; tbPost_L.Text = upMod.GroupName; tbPhone_L.Text = upMod.Mobile; } else { UpPlat_B.Visible = true; } } catch //数据库未升级,可能报错 { UpPlat_B.Visible = false; } }
private void MyBind(int uid) { showViboIcons(uid); M_UserInfo mu = buser.SelReturnModel(uid); userMod = userBll.SelReturnModel(uid); UserName_T2.Text = userMod.UserName; Plat_Group_T2.Text = string.IsNullOrEmpty(userMod.GroupName.Trim(',')) ? "未分组" : userMod.GroupName.Trim(','); Mobile_T2.Text = userMod.Mobile; Post_T2.Text = userMod.Post; TrueName_T2.Text = mu.HoneyName; SFile_Up.FileUrl = mu.UserFace; UserRole = userMod.Plat_Role; DataTable roledt = urBll.SelByCompID(userMod.CompID); Role_Rep.DataSource = roledt; Role_Rep.DataBind(); if (!string.IsNullOrWhiteSpace(UserRole.Trim(','))) { roledt.DefaultView.RowFilter = "ID in(" + UserRole.Trim(',') + ")"; Role_View_Rep.DataSource = roledt.DefaultView.ToTable(); Role_View_Rep.DataBind(); } }
public IActionResult SelUser(C_SelUser filter) { if (filter == null) { filter = new C_SelUser(); } PageSetting setting = null; switch (filter.dataMode) { case "user": //全部用户 default: { setting = buser.SelPage(filter.cpage, filter.psize, new F_User() { groupIds = filter.groupId.ToString(), uname = filter.skey }); } break; case "plat": //仅能力中心用户 { B_User_Plat upBll = new B_User_Plat(); M_User_Plat upMod = upBll.SelReturnModel(mu.UserID); setting = upBll.SelPage(filter.cpage, filter.psize, new F_User() { compIds = upMod.CompID.ToString(), groupIds = filter.groupId.ToString(), uname = filter.skey }); setting.dt.Columns["UserFace"].ColumnName = "salt"; } break; } filter.psize = setting.psize; filter.r_pcount = setting.pageCount; filter.r_itemCount = setting.itemCount; filter.r_dt = setting.dt; if (Request.IsAjaxRequest()) { return(PartialView("SelUser_List", filter)); } else { return(View(filter)); } }
public void MyBind() { M_Plat_Group gpMod = gpBll.SelReturnModel(Gid); M_User_Plat upMod = upBll.SelReturnModel(gpMod.CreateUser);//创建人模型 DataTable dt = new DataTable(); if (MType == 1) { dt = upBll.SelByIDS(gpMod.ManageIDS); } else { dt = upBll.SelByGroup(upMod.CompID, Gid); } EGV.DataSource = dt; EGV.DataBind(); }
void ShowPlatInfo(int id) { try { M_User_Plat platModel = PlatBll.SelReturnModel(id); if (platModel != null) { platInfo_A.Visible = true; UpPlat_B.Visible = false; tbTrueName_L.Text = platModel.TrueName; tbCompName_L.Text = platModel.CompName; tbPost_L.Text = platModel.Post; tbPhone_L.Text = platModel.Mobile; } } catch { UpPlat_B.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["ID"])) { taskMod = taskBll.SelReturnModel(TaskID); M_User_Plat upMod = upBll.SelReturnModel(taskMod.CreateUser); userimg_img.Src = upMod.UserFace; CreateUName_L.Text = upMod.TrueName.Length > 5 ? taskMod.CreateUName.Substring(0, 5) + ".." : taskMod.CreateUName; TName_L.Text = taskMod.TaskName; BTime_L.Text = taskMod.BeginTime.ToString("MM月dd日 HH:mm"); ETime_L.Text = taskMod.EndTime.ToString("MM月dd日 HH:mm"); TaskContent_T.Text = taskMod.TaskContent; LeaderIDS.Text = GetUName(taskMod.LeaderIDS, 50); PartTakeIDS.Text = GetUName(taskMod.PartTakeIDS, 500); MyBind(); } } }
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(); }
private void MyBind() { upMod = B_User_Plat.GetLogin(); compMod = compBll.SelReturnModel(upMod.CompID); if (compMod.Status == 0) { //检测是否已提交企业申请或加入公司申请 if (ualyBll.JoinComp_Exist(upMod.UserID)) { person_div.InnerHtml = "<div>您已提交加入企业申请,请等待公司管理员审核!</div>"; } if (ualyBll.CompCert_Exist(upMod.UserID)) { person_div.InnerHtml = "<div>您已提交企业认证申请,请等待管理员审核。</div>"; } person_div.Visible = true; } else { compinfo_div.Visible = true; upMod = upBll.SelReturnModel(compMod.CreateUser); if (upMod == null) { upMod = new M_User_Plat(); } CompShort_T.Text = compMod.CompShort; CompName_T.Text = compMod.CompName; CompDesc_T.Text = compMod.CompDesc; CompStatus_T.Text = "正常";// compMod.Status==1?"正常":"关闭"; CompUser_T.Text = upMod.UserName; CompHref_T.Text = compMod.CompHref; CreateTime_T.Text = compMod.CreateTime.ToString("yyyy年MM月dd日"); SFiles_Up.FVPath = compMod.CompLogo; Logo_Img.ImageUrl = compMod.CompLogo; Telephone_T.Text = compMod.Telephone; Mobile_T.Text = compMod.Mobile; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { M_User_Plat upMod = B_User_Plat.GetLogin(); if (upMod == null) { function.WriteErrMsg("您还没有登录,不能使用该功能!"); } M_UserInfo info = buser.SelReturnModel(uid); if (info.IsNull) { function.WriteErrMsg("用户不存在!"); } M_User_Plat upMod2 = upBll.SelReturnModel(uid); if (upMod2.CompID != upMod.CompID) { function.WriteErrMsg("您没有权限下载该用户的时间线记录!"); } if (type.Equals("mht")) { HtmlHelper htmlHelp = new HtmlHelper(); string url = SiteConfig.SiteInfo.SiteUrl + "/Plat/Blog/Timeline.aspx?uids=" + uid + "&uname=" + info.UserName + "&upwd=" + info.UserPwd; string vpath = htmlHelp.DownToMHT(url, "/UploadFiles/" + info.UserName + "的时间线.mht"); SafeSC.DownFile(vpath); } else if (type.Equals("pdf")) { StringWriter sw = new StringWriter(); string url = "/Plat/Blog/TimelineToPDF.aspx?uids=" + uid + "&uname=" + info.UserName + "&upwd=" + info.UserPwd; Server.Execute(url, sw); string vpath = "/UploadFiles/" + info.UserName + "的时间线.pdf"; PdfHelper.HtmlToPdf(sw.ToString(), "", vpath); SafeSC.DownFile(vpath); } } }
//统一状态码 -1:失败,99:成功 //以下都限制为只能获取用户所在的公司 public void ProcessRequest(HttpContext context) { M_APIResult retMod = new M_APIResult(); retMod.retcode = M_APIResult.Failed; M_User_Plat upMod = null; string value = context.Request.Form["value"]; string result = ""; switch (Action) { case "plat_compuser": //获取公司中成员,用于@功能 { upMod = B_User_Plat.GetLogin(); DataTable dt = upBll.SelByCompWithAT(upMod.CompID); result = JsonHelper.JsonSerialDataTable(dt); OldRep(result); } break; case "getuinfo": //获取单个用户信息(只允许获取本公司),返回的信息存入Json,避免重复检测,后期将服务端也缓存化 { upMod = B_User_Plat.GetLogin(); int uid = Convert.ToInt32(value); M_User_Plat model = upBll.SelReturnModel(uid, upMod.CompID); if (model != null) { result = "{\"id\":\"" + model.UserID + "\",\"UserID\":\"" + model.UserID + "\",\"UserName\":\"" + model.TrueName + "\",\"Mobile\":\"" + model.Mobile + "\",\"GroupName\":\"" + model.GroupName.Trim(',') + "\",\"UserFace\":\"" + model.UserFace + "\"}"; } OldRep(result); } break; case "getnotify": //获取提醒 { B_Notify notBll = new B_Notify(); if (B_Notify.NotifyList.Count < 1) { retMod.retmsg = "none"; } else { notBll.RemoveExpire(); //去除超时的 M_UserInfo mu = new B_User().GetLogin(); List <M_Notify> list = notBll.GetNotfiyByUid(mu.UserID); DataTable retdt = new DataTable(); retdt.Columns.Add(new DataColumn("title", typeof(string))); retdt.Columns.Add(new DataColumn("content", typeof(string))); retdt.Columns.Add(new DataColumn("cuname", typeof(string))); if (list.Count > 0) { foreach (M_Notify model in list) //有多个就发多条 { notBll.AddReader(model, mu.UserID); DataRow dr = retdt.NewRow(); dr["title"] = model.Title; dr["content"] = model.Content; dr["cuname"] = model.CUName; retdt.Rows.Add(dr); } } retMod.retcode = M_APIResult.Success; retMod.result = JsonConvert.SerializeObject(retdt); } RepToClient(retMod); } break; case "newblog": //自己公司有无新的信息 { upMod = B_User_Plat.GetLogin(); result = msgBll.SelByDateForNotify(Req("date"), upMod).ToString(); OldRep(result); } break; case "privatesend": //私信功能,走邮件模块 { upMod = B_User_Plat.GetLogin(); if (upMod != null) { string msg = context.Request.Form["msg"]; string receuser = context.Request.Form["receuser"]; if (!string.IsNullOrWhiteSpace(msg) && !string.IsNullOrWhiteSpace(receuser) && SafeSC.CheckIDS(receuser)) { //过滤非用户公司的同事,后期处理 M_Message msgMod = new M_Message(); B_Message msgBll = new B_Message(); msgMod.Incept = receuser; msgMod.Sender = upMod.UserID.ToString(); msgMod.Title = upMod.TrueName + "的私信"; msgMod.PostDate = DateTime.Now; msgMod.Content = msg; msgMod.Savedata = 0; msgMod.Receipt = ""; msgMod.CCUser = ""; msgMod.Attachment = ""; msgBll.GetInsert(msgMod); result = "99"; //添加一条新提醒 B_Notify.AddNotify(upMod.UserName, "你收到一封私信", msgMod.Title, msgMod.Incept); } else { result = "-1"; } } else { result = "0"; } //未登录 OldRep(result); break; } case "addread": //阅读量统计 { string ids = context.Request.Form["ids"]; msgBll.AddRead(ids.Trim(',')); OldRep("1"); } break; } }
//选择好用户后,为其创建相关信息 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"); }