public V_UserLogin SystemLogin(string userName, string Pwd) { using (SysUserBLL bll = new SysUserBLL()) { return bll.systemUserLogin(userName, Pwd); } }
public List<V_BllCommonUserPermission> GetUserMenuPermsByUserPermissionBllCommon(string menuCode, string userID, ref string OwnerCompanyIDs, ref string OwnerDepartmentIDs, ref string OwnerPositionIDs) { //SysUserBLL bll = new SysUserBLL(); //IQueryable<V_Permission> plist = bll.GetUserMenuPerms(menuCode, userID); #region 使用缓存 try { using (SysUserBLL bll = new SysUserBLL()) { List<V_BllCommonUserPermission> plist; IQueryable<V_BllCommonUserPermission> IQlist = bll.GetUserMenuPermsByUserPermisionBllCommon(menuCode, userID, ref OwnerCompanyIDs, ref OwnerDepartmentIDs, ref OwnerPositionIDs); //if(IQlist != null) plist = IQlist !=null ? IQlist.ToList() : null; return plist == null ? null : plist; } } catch (Exception ex) { Tracer.Debug("PermissionBllCommon出现错误:" + menuCode + System.DateTime.Now.ToString("d")+" "+ex.ToString()); return null; } #endregion }
public List<V_UserPermissionUI> GetUserPermissionByUserToUI(string userID) { using (SysUserBLL bll = new SysUserBLL()) { #region 龙康才新增 List<V_UserPermissionUI> plist; T_SYS_FBADMIN UserFb = null; string keyString = "GetUserPermissionByUserToUI" + userID; if (WCFCache.Current[keyString] == null) { if (!string.IsNullOrEmpty(userID)) { PermissionService p = new PermissionService(); UserFb = p.getFbAdmin(userID); } IQueryable<V_UserPermissionUI> IQList = UserFb != null ? bll.GetUserPermissionByUserToUI(userID, "") : bll.GetUserPermissionByUserToUINotForFbAdmin(userID, ""); plist = IQList == null ? null : IQList.ToList(); WCFCache.Current.Insert(keyString, plist, DateTime.Now.AddMinutes(15)); } else { plist = (List<V_UserPermissionUI>)WCFCache.Current[keyString]; } #endregion return plist != null ? plist : null; } }
public List<V_UserPermissionUI> GetEntityPermissionByUser(string userID, string StrMenuId) { using (SysUserBLL bll = new SysUserBLL()) { IQueryable<V_UserPermissionUI> plist; plist = bll.GetUserPermissionByUserToUI(userID, StrMenuId); return plist.Count() > 0 ? plist.ToList() : null; } }
public V_UserLogin UserLogin(string userName, string Pwd) { using (SysUserBLL bll = new SysUserBLL()) { string Ip = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); return bll.AddUserLoginHis(userName, Pwd, Ip); } //SysUserBLL bll = new SysUserBLL(); // string Ip = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); // return bll.GetUserInfoByLogin(userName, Pwd, Ip); }
public V_UserLogin UserLoginToTaken(string userName, string Pwd,ref string StrTaken) { //using (SysUserBLL bll = new SysUserBLL()) //{ // string Ip = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); // return bll.GetUserInfoByLogin(userName, Pwd, Ip); //} SysUserBLL bll = new SysUserBLL(); string Ip = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); return bll.GetUserInfoByLoginToTaken(userName, Pwd, Ip, StrTaken); }
public List<V_BllCommonUserPermission> GetUserMenuPermsByUserPermissionBllCommon(string menuCode, string userID, ref string OwnerCompanyIDs, ref string OwnerDepartmentIDs, ref string OwnerPositionIDs) { //SysUserBLL bll = new SysUserBLL(); //IQueryable<V_Permission> plist = bll.GetUserMenuPerms(menuCode, userID); #region 使用缓存 try { using (SysUserBLL bll = new SysUserBLL()) { List<V_BllCommonUserPermission> plist; string keyString = "BllCommonUserMenuPermsstring" + menuCode + userID; string Companykey = "BllOwnerCompanyIDs" + menuCode + userID; string Departmentkey = "BllOwnerDepartmentIDs" + menuCode + userID; string Positionkey = "BllOwnerPositionIDs" + menuCode + userID; if (WCFCache.Current[keyString] == null) { IQueryable<V_BllCommonUserPermission> IQlist = bll.GetUserMenuPermsByUserPermisionBllCommon(menuCode, userID, ref OwnerCompanyIDs, ref OwnerDepartmentIDs, ref OwnerPositionIDs); //if(IQlist != null) plist = IQlist !=null ? IQlist.ToList() : null; WCFCache.Current.Insert(keyString, plist, DateTime.Now.AddMinutes(1)); WCFCache.Current.Insert(Companykey, OwnerCompanyIDs, DateTime.Now.AddMinutes(1)); WCFCache.Current.Insert(Departmentkey, OwnerDepartmentIDs, DateTime.Now.AddMinutes(1)); WCFCache.Current.Insert(Positionkey, OwnerPositionIDs, DateTime.Now.AddMinutes(1)); } else { plist = (List<V_BllCommonUserPermission>)WCFCache.Current[keyString]; OwnerCompanyIDs = (string)WCFCache.Current[Companykey]; OwnerDepartmentIDs = (string)WCFCache.Current[Departmentkey]; OwnerPositionIDs = (string)WCFCache.Current[Positionkey]; } return plist == null ? null : plist; } } catch (Exception ex) { Tracer.Debug("PermissionBllCommon出现错误:" + menuCode + System.DateTime.Now.ToString("d")+" "+ex.ToString()); return null; } #endregion }
public List<V_BllCommonUserPermission> GetUserMenuPermsByUserPermissionBllCommonAddPermissionValue(string menuCode, string userID, ref string OwnerCompanyIDs, ref string OwnerDepartmentIDs, ref string OwnerPositionIDs,string StrPermissionValue) { try { using (SysUserBLL bll = new SysUserBLL()) { List<V_BllCommonUserPermission> plist; IQueryable<V_BllCommonUserPermission> IQlist = bll.GetUserMenuPermsByUserPermisionBllCommonAddPermissionValue(menuCode, userID, ref OwnerCompanyIDs, ref OwnerDepartmentIDs, ref OwnerPositionIDs, StrPermissionValue); plist = IQlist != null ? IQlist.ToList() : null; return plist == null ? null : plist; } } catch (Exception ex) { Tracer.Debug("GetUserMenuPermsByUserPermissionBllCommonAddPermissionValue出现错误:" + menuCode + System.DateTime.Now.ToString("d") + " " + ex.ToString()); return null; } }
public bool UserLoginOperation(string UserID, string LoginRecordId, bool IsLogin) { using (SysUserBLL bll = new SysUserBLL()) { string Ip = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); return bll.LoginOutConfirm(UserID, LoginRecordId, Ip, IsLogin); } }
//批量修改用户状态 public string SysUserBatchUpdate(string[] StrSysUserIDs, string StrUserID, string UserName, string UserState) { using (SysUserBLL UserBll = new SysUserBLL()) { //清空对应的用户的缓存 if (StrSysUserIDs.Count() > 0) { //清空即时通讯的缓存 string InstantkeyString = "ImInstantLoginUsers"; WCFCache.Current[InstantkeyString] = null; for (int i = 0; i < StrSysUserIDs.Count(); i++) { string keyString = "GetUserByEmployeeID" + StrSysUserIDs[i]; WCFCache.Current[keyString] = null; } } return UserBll.BatchUpdateSysUserInfos(StrSysUserIDs, StrUserID, UserName, UserState); } }
//批量删除 public string SysUserBatchDel(string[] StrSysUserIDs) { using (SysUserBLL UserBll = new SysUserBLL()) { //清空即时通讯的缓存 string InstantkeyString = "ImInstantLoginUsers"; WCFCache.Current[InstantkeyString] = null; return UserBll.BatchDeleteSysUserInfos(StrSysUserIDs); } }
//所有用户信息 根据用户所属公司获取 2010-8-24 public List<T_SYS_USER> GetSysUserAllInfosPagingByCompanyIDs(int pageIndex, int pageSize, string sort, string filterString, object[] paras, ref int pageCount, LoginUserInfo loginUserInfo, string[] CompanyIDs) { using (SysUserBLL UserBll = new SysUserBLL()) { IQueryable<T_SYS_USER> recordList = UserBll.GetAllSysUserInfosWithPagingByCompanyIDs(pageIndex, pageSize, sort, filterString, paras, ref pageCount, loginUserInfo.userID, CompanyIDs); return recordList == null ? null : recordList.ToList(); } }
public List<T_SYS_USER> GetSysUserAllInfos() { using (SysUserBLL UserBll = new SysUserBLL()) { List<T_SYS_USER> SysUserInfosList = UserBll.GetAllSysUserInfos(); if (SysUserInfosList == null) { return null; } else { return SysUserInfosList; } } }
/// <summary> /// 初始化页面数据 /// </summary> private void getDetail() { try { SysUserBLL userbll = new SysUserBLL(); SysUser user = userbll.getDetail(PrimaryKey); AMBaseAnnexesFileBLL AMBaseAnnexesFileBLL = new AMBaseAnnexesFileBLL(); AMBaseAnnexesFileEntity AMBaseAnnexesFileEntity = AMBaseAnnexesFileBLL.GetEntity(user.F_Picture1); department = user.D_Code; strTeamCode = user.F_TeamCode; role = user.R_CSCode; F_Account.Text = user.F_Account; F_RealName.Text = user.F_RealName; F_Password.Text = "******";//user.F_Password ; F_Gender.SelectedItem = user.F_Gender == 1 ? "男" : "女"; F_Kind.Text = "正式工"; cmbImage.Text = "照片1"; D_Code.Text = department; if (role != null) { R_Code.SelectedValue = role; } if (strTeamCode != null) { cmbTeam.SelectedValue = strTeamCode; } F_Mobile.Text = user.F_Mobile; F_Email.Text = user.F_Email; F_OICQ.Text = user.F_OICQ; F_WeChat.Text = user.F_WeChat; F_Indate.Text = user.F_Indate.ToString(); F_Outdate.Text = user.F_Outdate.ToString(); U_Address.Text = user.U_Address; F_Description.Text = user.F_Description; F_EnabledMark.Checked = user.F_EnabledMark; F_CreateUserName.Text = user.F_CreateUserName; F_ModifyUserName.Text = user.F_ModifyUserName; switch (user.F_Kind) { case 1: F_Kind.Text = "正式工"; break; case 2: F_Kind.Text = "临时工"; break; case 3: F_Kind.Text = "劳务工"; break; } //switch (cmbImage.Text) //{ // case "照片1": // txtImageFile.Text = AMBaseAnnexesFileEntity.F_FilePath; // break; // case "照片2": // txtImageFile.Text = AMBaseAnnexesFileEntity.F_FilePath; // break; // case "照片3": // txtImageFile.Text = AMBaseAnnexesFileEntity.F_FilePath; // break; // case "照片4": // txtImageFile.Text = AMBaseAnnexesFileEntity.F_FilePath; // break; // case "照片5": // txtImageFile.Text = AMBaseAnnexesFileEntity.F_FilePath; // break; //} F_RFIDCode.Text = user.F_RFIDCode; //user.F_Indate = F_Indate.Text; //user.F_Outdate = F_Outdate.Text; F_Cert.Text = user.F_Cert; F_Nation.Text = user.F_Nation; F_Record.Text = user.F_Record; F_Origin.Text = user.F_Origin; //照片显示 //AMBaseAnnexesFileEntity = AMBaseAnnexesFileBLL.GetEntity(user.F_Picture1); //string strPath = System.AppDomain.CurrentDomain.BaseDirectory + AMBaseAnnexesFileEntity.F_FilePath; //string strPath = "http://183.236.45.60:7001/picture/" + 10006.jpg"; string strPath = Application.StartupPath + "\\img\\" + user.F_Account + ".jpg"; string url = "http://183.236.45.60:7001/picture/" + user.F_Account + ".jpg"; Down(strPath, url); if (File.Exists(strPath)) { FileStream fs = new FileStream(strPath, FileMode.Open, FileAccess.Read); Byte[] mybyte = new byte[fs.Length]; fs.Read(mybyte, 0, mybyte.Length); fs.Close(); MemoryStream ms = new MemoryStream(mybyte); Bitmap myimge = new Bitmap(ms); pictureBox1.Image = myimge; } if (user.F_CreateDate.HasValue) { F_CreateDate.Value = user.F_CreateDate.Value; } else { F_CreateDate.Value = DateTime.Now; } if (user.F_ModifyDate.HasValue) { F_ModifyDate.Value = user.F_ModifyDate.Value; } else { F_ModifyDate.Value = DateTime.Now; } } catch (Exception ex) { untCommon.ErrorMsg("用户管理加载数据异常:" + ex.Message); } }
public string UpdatePwdByUserNameAndPwd(string UserName, string pwd) { using (SysUserBLL bll = new SysUserBLL()) { string IsReturn = ""; Tracer.Debug(UserName +"开始修改密码,用户密码:" + pwd); IsReturn = bll.UpdatePwdByUserNameAndPwd(UserName,pwd); return IsReturn; } }
public List<FlowUserInfo> GetUserByRoleIDAndCompanyID(string roleID, string companyID) { using (SysUserBLL bll = new SysUserBLL()) { Tracer.Debug("流程调用了GetUserByRoleIDAndCompanyID:" + "角色ID:"+ roleID +" 公司ID:"+ companyID); return bll.GetUserByRoleIDAndCompanyID(roleID,companyID); } }
public List<FlowUserInfo> GetDepartmentHeadByDepartmentID(string departmentID) { using (SysUserBLL bll = new SysUserBLL()) { Tracer.Debug("流程调用了GetDepartmentHeadByDepartmentID:" + departmentID); return bll.GetDepartmentHeadByDepartmentID(departmentID); } }
public string GetUserNameIsExistNameAddOne(string UserName, string employeeid) { using (SysUserBLL UserBll = new SysUserBLL()) { return UserBll.GetUserNameIsExistAddOne(UserName, employeeid); } }
public List<string> GetCompanyidsAndDepartmentidsByUserid(string userid, ref List<string> lsDepartmentids) { using (SysUserBLL UserBll = new SysUserBLL()) { return UserBll.GetCompanyidsAndDepartmentidsByUserid(userid, ref lsDepartmentids); } }
//所有用户登录信息 2010-6-10 public List<V_UserLoginRecord> GetSysUserLoginRecordInfosPaging(int pageIndex, int pageSize, string sort, string filterString, object[] paras, ref int pageCount, LoginUserInfo loginUserInfo) { using (SysUserLoginRecordBll UserLoginBll = new SysUserLoginRecordBll()) { IQueryable<V_UserLoginRecord> recordList = UserLoginBll.GetAllUserLoginRecordInfosWithPaging(pageIndex, pageSize, sort, filterString, paras, ref pageCount, loginUserInfo.userID); SysUserBLL bll = new SysUserBLL(); //string OwnerCompanyIDs = ""; //string OwnerDepartmentIDs = ""; //string OwnerPositionIDs = ""; //IQueryable<V_BllCommonUserPermission> plist; //plist = bll.GetUserMenuPermsByUserPermisionBllCommon("T_HR_SALARYSOLUTION", "2e41f129-cab4-4864-832e-6a2d6fba2750", ref OwnerCompanyIDs, ref OwnerDepartmentIDs, ref OwnerPositionIDs); //plist = bll.GetUserMenuPermsByUserPermisionBllCommonAddPermissionValue("T_FB_DEPTBUDGETAPPLYMASTER", "286ab878-be35-4cb9-83d4-51e4f0344637", ref OwnerCompanyIDs, ref OwnerDepartmentIDs, ref OwnerPositionIDs, "0"); //plist = bll.GetUserMenuPermsByUserPermisionBllCommon("T_HR_COMPANY", "2e67b94c-888f-4488-8663-d356740efcc6", ref OwnerCompanyIDs, ref OwnerDepartmentIDs, ref OwnerPositionIDs); //plist = bll.GetUserMenuPermsByUserPermisionBllCommon("T_OA_WORKRECORD", "5dabd014-e418-4d0e-a88e-440ec012857e", ref OwnerCompanyIDs, ref OwnerDepartmentIDs, ref OwnerPositionIDs); if (recordList == null) { return null; } else { return recordList.ToList(); } } }
/// <summary> /// 添加 /// </summary> private void addUser() { try { if (checkInput()) { SysUser user = new SysUser(); user.F_Account = F_Account.Text; user.F_RealName = F_RealName.Text; user.F_Password = F_Password.Text; user.F_Gender = F_Gender.Text == "男" ? 1 : 0; user.D_Code = D_Code.SelectedValue.ToString(); user.R_CSCode = R_Code.SelectedValue.ToString(); user.F_Mobile = F_Mobile.Text; user.F_Email = F_Email.Text; user.F_OICQ = F_OICQ.Text; user.F_WeChat = F_WeChat.Text; user.U_Address = U_Address.Text; user.F_Description = F_Description.Text; user.F_EnabledMark = F_EnabledMark.Checked; user.F_CreateUserName = F_CreateUserName.Text; user.F_CreateDate = F_CreateDate.Value; user.F_ModifyUserName = SysUser.F_Account.ToString(); user.F_ModifyDate = DateTime.Now; switch (F_Kind.Text) { case "正式工": user.F_Kind = 1; break; case "临时工": user.F_Kind = 2; break; case "劳务工": user.F_Kind = 3; break; } user.F_RFIDCode = F_RFIDCode.Text; //user.F_Indate = F_Indate.Text; //user.F_Outdate = F_Outdate.Text; user.F_Cert = F_Cert.Text; user.F_Nation = F_Nation.Text; user.F_Record = F_Record.Text; user.F_Origin = label99.Text; //user.F_Picture1 = F_RFIDCode.Text; SysUserBLL userbll = new SysUserBLL(); if (userbll.Add(user) > 0) { untCommon.InfoMsg("添加成功!"); frmParent.loadData(); } else { untCommon.InfoMsg("添加失败!"); } } } catch (Exception ex) { untCommon.ErrorMsg("角色管理添加数据异常:" + ex.Message); } }
/// <summary> /// 修改 /// </summary> private void updateUser() { try { if (checkInput()) { SysUser user = new SysUser(); AMBaseDepartmentBLL AMBaseDepartmentBLL = new AMBaseDepartmentBLL(); var rows = AMBaseDepartmentBLL.GetList_F_ID(D_Code.Text); user.F_Account = F_Account.Text; user.F_RealName = F_RealName.Text; //user.F_Password = U_Pwd.Text; user.F_Gender = F_Gender.Text == "男" ? 1 : 0; //user.D_Code = D_Code.SelectedValue.ToString(); user.D_Code = D_Code.Text; user.F_DepartmentId = rows[0].F_DepartmentId; user.R_CSCode = R_Code.SelectedValue.ToString(); user.F_TeamCode = cmbTeam.SelectedValue.ToString(); user.F_TeamName = cmbTeam.Text.ToString(); user.F_Mobile = F_Mobile.Text; user.F_Email = F_Email.Text; user.F_OICQ = F_OICQ.Text; user.F_WeChat = F_WeChat.Text; user.U_Address = U_Address.Text; user.F_Description = F_Description.Text; user.F_EnabledMark = F_EnabledMark.Checked; user.F_CreateUserName = F_CreateUserName.Text; user.F_CreateDate = F_CreateDate.Value; user.F_ModifyUserName = SysUser.F_RealName.ToString(); user.F_ModifyDate = DateTime.Now; switch (F_Kind.Text) { case "正式工": user.F_Kind = 1; break; case "临时工": user.F_Kind = 2; break; case "劳务工": user.F_Kind = 3; break; } user.F_RFIDCode = F_RFIDCode.Text; //user.F_Indate = F_Indate.Text; //user.F_Outdate = F_Outdate.Text; user.F_Cert = F_Cert.Text; user.F_Nation = F_Nation.Text; user.F_Record = F_Record.Text; user.F_Origin = F_Origin.Text; //user.F_Picture1 = F_RFIDCode.Text; SysUserBLL userbll = new SysUserBLL(); if (userbll.Edit(user) > 0) { untCommon.InfoMsg("修改成功!"); frmParent.loadData(); this.Close(); } else { untCommon.InfoMsg("修改失败!"); } } } catch (Exception ex) { untCommon.ErrorMsg("角色管理更新数据异常:" + ex.Message); } }
private void btnUploadImage_Click(object sender, EventArgs e) { try { if (file()) { string ID = Guid.NewGuid().ToString("N");//照片名称 SysUser user = new SysUser(); SysUserBLL SysUserBLL = new SysUserBLL(); AMBaseAnnexesFileEntity AMBaseAnnexesFileEntity = new AMBaseAnnexesFileEntity(); AMBaseAnnexesFileBLL AMBaseAnnexesFileBLL = new AMBaseAnnexesFileBLL(); AMBaseAnnexesFileEntity.F_Id = ID; AMBaseAnnexesFileEntity.F_FolderId = Guid.NewGuid().ToString(); AMBaseAnnexesFileEntity.F_FileName = Path.GetFileName(imagefile);//获取文件名和扩展名 AMBaseAnnexesFileEntity.F_FilePath = "D:/fileAnnexes/shop_erp/System/" + DateTime.Now.ToString("yyyyMMdd") + "/" + AMBaseAnnexesFileEntity.F_Id; AMBaseAnnexesFileEntity.F_FileSize = fileInfoLength; AMBaseAnnexesFileEntity.F_FileExtensions = Path.GetExtension(imagefile); //获取文件扩展名 AMBaseAnnexesFileEntity.F_FileType = imagefile.Substring(imagefile.LastIndexOf(".") + 1); // Path.GetExtension(imagefile).Substring(0, 1); //AMBaseAnnexesFileEntity.F_DownloadCount = ""; AMBaseAnnexesFileEntity.F_CreateDate = DateTime.Now; AMBaseAnnexesFileEntity.F_CreateUserId = SysUser.F_Account.ToString(); AMBaseAnnexesFileEntity.F_CreateUserName = SysUser.F_RealName.ToString(); user.F_Account = PrimaryKey; switch (cmbImage.Text) { case "照片1": user.F_Picture1 = AMBaseAnnexesFileEntity.F_Id; break; case "照片2": user.F_Picture2 = AMBaseAnnexesFileEntity.F_Id; break; case "照片3": user.F_Picture3 = AMBaseAnnexesFileEntity.F_Id; break; case "照片4": user.F_Picture4 = AMBaseAnnexesFileEntity.F_Id; break; case "照片5": user.F_Picture5 = AMBaseAnnexesFileEntity.F_Id; break; } //Computer MyComputer = new Computer(); //imagefile = System.AppDomain.CurrentDomain.BaseDirectory; //MyComputer.FileSystem.RenameFile(imagefile, image);//imagefile是所要重命名的文件的全路径,image是目标文件名 //image = Path.GetFileNameWithoutExtension(imagefile);// 没有扩展名的文件名 //FaceRecognition.Get_zjdz(imagefile); string str = FaceRecognition.ImageToBase64(imagefile); if (AMBaseAnnexesFileBLL.SaveEntity("", AMBaseAnnexesFileEntity) > 0) { if (SysUserBLL.Edit(user) > 0) { MesDeviceBLL MesDeviceBLL = new MesDeviceBLL(); var MesDevice = MesDeviceBLL.GetList_Deparemaent(D_Code.Text, ""); user = SysUserBLL.getDetail(PrimaryKey); string url = "http://" + MesDevice[0].D_IP + ":8090/person/create"; string postData = "pass=12345678&personId=" + user.F_EnCode + "&faceId=" + ID + "&imgBase64" + str + ""; string strtemp = FaceRecognition.Port(url, postData); if (!FaceRecognition.json(strtemp)) { untCommon.InfoMsg("该IP地址不可用!"); return; } JObject joModel = (JObject)JsonConvert.DeserializeObject(strtemp); if (!bool.Parse(joModel["success"].ToString())) { untCommon.InfoMsg(joModel["msg"].ToString()); return; } else { untCommon.InfoMsg("人脸识别注册成功!"); } switch (cmbImage.Text) { case "照片1": AMBaseAnnexesFileBLL.DeleteEntity(user.F_Picture1); break; case "照片2": AMBaseAnnexesFileBLL.DeleteEntity(user.F_Picture2); break; case "照片3": AMBaseAnnexesFileBLL.DeleteEntity(user.F_Picture3); break; case "照片4": AMBaseAnnexesFileBLL.DeleteEntity(user.F_Picture4); break; case "照片5": AMBaseAnnexesFileBLL.DeleteEntity(user.F_Picture5); break; } } else { untCommon.InfoMsg("上传失败!"); } } else { untCommon.InfoMsg("上传失败!"); } //string url = "183.236.45.60"; //if (FaceRecognition.uploadFileByHttp(url, imagefile)) //{ //} } } catch (Exception ex) { untCommon.ErrorMsg("照片上传失败!"); } }
public bool GetUserPermissionBySysCodeAndUserAndModelCode(string SysCode, string menuCode, string userID, string PermissionValue) { bool IsReturn = false; using (SysUserBLL bll = new SysUserBLL()) { IsReturn = bll.GetUserPermissionBySysCodeAndUserAndModelCode(SysCode, menuCode, userID, PermissionValue); } return IsReturn; }
public void SysUserInfoAddORUpdate(T_SYS_USER obj, ref string strMsg) { using (SysUserBLL UserBll = new SysUserBLL()) { //清空即时通讯的缓存 string keyString = "ImInstantLoginUsers"; WCFCache.Current[keyString] = null; UserBll.SysUserInfoAddORUpdate(obj, ref strMsg); } }
public bool GetUserOperationPermission(EntityPermission permission, string employeeid) { using (SysUserBLL bll = new SysUserBLL()) { return bll.GetUserOperationPermission(permission, employeeid); } }
private bool IsExistSysUserInfo(string StrUserName) { using (SysUserBLL UserBll = new SysUserBLL()) { return UserBll.GetSysUserInfoByAdd(StrUserName); } }
public List<FlowUserInfo> GetFlowUserInfoByRoleID(string roleID) { using (SysUserBLL bll = new SysUserBLL()) { Tracer.Debug("流程调用了GetFlowUserInfoByRoleID:"+ roleID); return bll.GetFlowUserInfoByRoleID(roleID); } }
public bool SysUserInfoUpdateNew(T_SYS_USER obj,bool isSupper) { Tracer.Debug("SysUserInfoUpdateNew-修改了用户信息" + obj.USERNAME + obj.EMPLOYEENAME); using (SysUserBLL UserBll = new SysUserBLL()) { string keyString = "GetUserByEmployeeID" + obj.EMPLOYEEID; WCFCache.Current[keyString] = null; //清空即时通讯的缓存 string InstantkeyString = "ImInstantLoginUsers"; WCFCache.Current[InstantkeyString] = null; //Tracer.Debug("修改了用户信息"+obj.USERNAME + obj.EMPLOYEENAME); if (isSupper) { return UserBll.UpdateSysUserInfoForNewSupper(obj, isSupper); } else { return UserBll.UpdateSysUserInfo(obj); } } }
public List<FlowUserInfo> GetSuperiorByPostID(string postID) { using (SysUserBLL bll = new SysUserBLL()) { Tracer.Debug("流程调用了GetSuperiorByPostID:" + postID); return bll.GetSuperiorByPostID(postID); } }
public bool SysUserInfoUpdateForEmployeeLeft(T_SYS_USER obj,string StrOwnerCompanyid,string StrPostid,bool IsMain) { Tracer.Debug("修改了用户信息" + obj.USERNAME + obj.EMPLOYEENAME); using (SysUserBLL UserBll = new SysUserBLL()) { string keyString = "GetUserByEmployeeID" + obj.EMPLOYEEID; WCFCache.Current[keyString] = null; //清空即时通讯的缓存 string InstantkeyString = "ImInstantLoginUsers"; WCFCache.Current[InstantkeyString] = null; //Tracer.Debug("修改了用户信息"+obj.USERNAME + obj.EMPLOYEENAME); return UserBll.UpdateSysUserInfoForEmployeeLeftOffice(obj, StrOwnerCompanyid, StrPostid, IsMain); } }
public List<FlowUserInfo> GetFlowUserByUserID(string userID) { using (SysUserBLL bll = new SysUserBLL()) { Tracer.Debug("流程调用了GetFlowUserByUserID:" + "用户ID:" + userID ); return bll.GetFlowUserByUserID(userID); } }
public bool SysUserInfoUpdateByUserIdandUsername(string userid, string username, string pwd) { using (SysUserBLL UserBll = new SysUserBLL()) { string keyString = "GetUserByEmployeeID" + userid; WCFCache.Current[keyString] = null; //清空即时通讯的缓存 string InstantkeyString = "ImInstantLoginUsers"; WCFCache.Current[InstantkeyString] = null; //Tracer.Debug("修改了用户信息"+obj.USERNAME + obj.EMPLOYEENAME); return UserBll.UpdateSysUserPasswordByUsername(userid,username,pwd); } }
public List<V_SupperFbAdmin> GetSupperAdmins() { using (SysUserBLL bll = new SysUserBLL()) { List<V_SupperFbAdmin> listAdmins = bll.GetSupperAdmins(); return listAdmins; } }
/// <summary> /// 根据权限过滤 /// </summary> /// <param name="filterString"></param> /// <param name="queryParas"></param> /// <param name="userID"></param> /// <param name="entityName"></param> protected void SetOrganizationFilter(ref string filterString, ref System.Collections.Generic.List <object> queryParas, string employeeID, string entityName) { //获取用户 SysUserBLL UserBll = new SysUserBLL(); T_SYS_USER user = UserBll.GetUserByEmployeeID(employeeID); V_EMPLOYEEPOST vemp = personnelclient.GetEmployeeDetailByID(user.EMPLOYEEID); if (vemp == null) { return; } T_HR_EMPLOYEE emp = vemp.EMPLOYEEPOSTS[0].T_HR_EMPLOYEE; //获取正常的角色用户权限 IQueryable <V_Permission> plist = UserBll.GetUserMenuPerms(entityName, user.SYSUSERID); IQueryable <V_Permission> perms = plist; if (perms == null) { return; } //获取查询的权限,值越小,权限越大 int maxPerm = -1; var permlist = perms.Where(p => p.Permission.PERMISSIONVALUE == "3"); if (permlist.Count() > 0) { maxPerm = permlist.Min(p => Convert.ToInt32(p.RoleMenuPermission.DATARANGE)); } //perms.Where(p => p.Permission.PERMISSIONVALUE == "3").Min(p => Convert.ToInt32(p.RoleMenuPermission.DATARANGE)); //var maxPerm = "2"; //if (!emp.T_HR_EMPLOYEEPOST.IsLoaded) //{ // emp.T_HR_EMPLOYEEPOST.Load(); //} //获取自定义权限 int custPerm = GetCustomPerms(entityName, emp); if (custPerm < maxPerm) { maxPerm = custPerm; } //看整个公司的 if (Convert.ToInt32(maxPerm) == Convert.ToInt32(AssignObjectType.Company)) { if (!string.IsNullOrEmpty(filterString)) { filterString += " AND "; } filterString += " ("; int i = 0; foreach (T_HR_EMPLOYEEPOST ep in emp.T_HR_EMPLOYEEPOST) { if (i > 0) { filterString += " OR "; } filterString += "OWNERCOMPANYID==@" + queryParas.Count().ToString(); //暂时先去掉 //if (!ep.T_HR_POSTReference.IsLoaded) // ep.T_HR_POSTReference.Load(); //if (ep.T_HR_POST != null && ep.T_HR_POST.T_HR_DEPARTMENTReference.IsLoaded == false) // ep.T_HR_POST.T_HR_DEPARTMENTReference.Load(); //if (ep.T_HR_POST != null && ep.T_HR_POST.T_HR_DEPARTMENT != null && ep.T_HR_POST.T_HR_DEPARTMENT.T_HR_COMPANYReference.IsLoaded == false) // ep.T_HR_POST.T_HR_DEPARTMENT.T_HR_COMPANYReference.Load(); queryParas.Add(ep.T_HR_POST.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID); i++; } filterString += ") "; } //看部门的 if (Convert.ToInt32(maxPerm) == Convert.ToInt32(AssignObjectType.Department)) { if (!string.IsNullOrEmpty(filterString)) { filterString += " AND "; } filterString += " ("; int i = 0; foreach (T_HR_EMPLOYEEPOST ep in emp.T_HR_EMPLOYEEPOST) { if (i > 0) { filterString += " OR "; } filterString += "OWNERDEPARTMENTID==@" + queryParas.Count().ToString(); if (!ep.T_HR_POSTReference.IsLoaded) { ep.T_HR_POSTReference.Load(); } if (ep.T_HR_POST != null && ep.T_HR_POST.T_HR_DEPARTMENTReference.IsLoaded == false) { ep.T_HR_POST.T_HR_DEPARTMENTReference.Load(); } queryParas.Add(ep.T_HR_POST.T_HR_DEPARTMENT.DEPARTMENTID); i++; } filterString += ") "; } //看岗位的 if (Convert.ToInt32(maxPerm) == Convert.ToInt32(AssignObjectType.Post)) { if (!string.IsNullOrEmpty(filterString)) { filterString += " AND "; } filterString += " ("; int i = 0; foreach (T_HR_EMPLOYEEPOST ep in emp.T_HR_EMPLOYEEPOST) { if (i > 0) { filterString += " OR "; } filterString += "OWNERPOSTID==@" + queryParas.Count().ToString(); if (!ep.T_HR_POSTReference.IsLoaded) { ep.T_HR_POSTReference.Load(); } queryParas.Add(ep.T_HR_POST.POSTID); i++; } filterString += ") "; } //看员工 if (Convert.ToInt32(maxPerm) == Convert.ToInt32(AssignObjectType.Employee)) { if (!string.IsNullOrEmpty(filterString)) { filterString += " AND "; } filterString += "OWNERID==@" + queryParas.Count().ToString(); queryParas.Add(employeeID); } }