| | |
| | | private readonly ISys_MenuService _menuService; |
| | | private readonly IRepository<Dt_FaceRecognition> _faceServer; |
| | | private readonly IRepository<Dt_Loginhsy> _LoginhsyServer; |
| | | public Sys_UserService(IRepository<Dt_Loginhsy> LoginhsyServer,IRepository<Dt_FaceRecognition> faceServer, IRepository<Sys_User> repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService) : base(repository) |
| | | private readonly IRepository<Dt_Maintenance> _MainServer; |
| | | public Sys_UserService(IRepository<Dt_Loginhsy> LoginhsyServer,IRepository<Dt_FaceRecognition> faceServer, IRepository<Sys_User> repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService, IRepository<Dt_Maintenance> MainServer) : base(repository) |
| | | { |
| | | _faceServer = faceServer; |
| | | _LoginhsyServer = LoginhsyServer; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _cacheService = cacheService; |
| | | _menuService = menuService; |
| | | |
| | | _MainServer = MainServer; |
| | | } |
| | | |
| | | |
| | |
| | | Enable = addUserDTO.enable, |
| | | UserPwd = "j79rYYvCz4vdhcboB1Ausg==", |
| | | Userteam = addUserDTO.userteam, |
| | | Dept_Id=addUserDTO.dept_Id, |
| | | CardNumber = addUserDTO.carnuber, |
| | | CreateDate = DateTime.Now |
| | | }; |
| | | BaseDal.AddData(sys); |
| | | //å建Dt_Maintenance表ä¸çæ°æ® |
| | | var Main = new Dt_Maintenance |
| | | { |
| | | UserAccount = addUserDTO.username, |
| | | }; |
| | | _MainServer.AddData(Main); |
| | | |
| | | |
| | | return new WebResponseContent { Status = true, Data = sys }; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | // 1. æ¥è¯¢ç¨æ· |
| | | var userList = BaseDal.QueryData(); |
| | | var sys = userList.FirstOrDefault(x => x.User_Id == addUserDTO.id); |
| | | //æ¥æ¾Dt_MaintenanceTeamä¸çæ°æ® |
| | | var team = _MainServer.QueryData(x => x.UserAccount == sys.UserName).FirstOrDefault(); |
| | | if (sys == null) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "没æ¾å°è¯¥ç¨æ·" }; |
| | |
| | | sys.CardNumber = addUserDTO.carnuber; |
| | | sys.Userteam = addUserDTO.userteam; |
| | | sys.Enable = addUserDTO.enable; |
| | | sys.Dept_Id = addUserDTO.dept_Id; |
| | | //å¦æäººè¸è¯å«æ·»å äºè¿éå°±æ³¨éæ |
| | | sys.HeadImageUrl = addUserDTO.path; |
| | | |
| | |
| | | // 8. æ´æ°æ°æ®åº |
| | | BaseDal.UpdateData(sys); |
| | | |
| | | //æ´æ°Dt_Maintenance表ä¸çæ°æ®åuser表ä¸ä¿®æ¹ç䏿 · |
| | | team.UserAccount = addUserDTO.username;//è´¦å· |
| | | _MainServer.UpdateData(team); |
| | | |
| | | return new WebResponseContent { Status = true, Data = sys }; |
| | | } |
| | | catch (Exception ex) |