public async Task <DResult <int> > AddSystemInfo([FromBody] SystemAddDto systemAddDto)
 {
     try
     {
         return(DResult.Succ(businessSystem.AddSystemInfo(systemAddDto)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <int>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <PagedList <OrganizationDto> > > GetOrganizationsByDNameAsPage(string TypeId, string Name, string SystemId, string OrganizationId, string TypeName = null, string SystemCode = null, int Page = 0, int Size = 0)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetOrganizationsByDNameAsPage(TypeId, Name, SystemId, OrganizationId, TypeName, SystemCode, Page, Size)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <PagedList <OrganizationDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
예제 #3
0
 public async Task <DResult <string> > AddUser([FromBody] UserAddDto vUser)
 {
     try
     {
         return(DResult.Succ(businessUser.AddUser(vUser)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <string>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <IList <OrganizationDto> > > GetOrganizationsByDName(string TypeId, string Name, string SystemId, string OrganizationId)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetOrganizationsByDName(TypeId, Name, SystemId, OrganizationId)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <IList <OrganizationDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
예제 #5
0
 public async Task <DResult <int> > DeleteUser(string UserId)
 {
     try
     {
         return(DResult.Succ(businessUser.DeleteUser(UserId)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <int>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
예제 #6
0
 public async Task <DResult <bool> > IsHasPrivilege(string UserId, string PrivilegeId = null, string PrivilegeCode = null)
 {
     try
     {
         return(DResult.Succ(businessUser.IsHasPrivilege(UserId, PrivilegeId, PrivilegeCode)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <bool>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <long> > GetOrganizationUserCount(string OrganizationId, int HierarchyType)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetOrganizationUserCount(OrganizationId, HierarchyType)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <long>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <int> > UpdatePosition([FromBody] PositionUpdateDto positionUpdateDto)
 {
     try
     {
         return(DResult.Succ(businessOrganization.UpdatePosition(positionUpdateDto)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <int>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <OrganizationAbstractDto> > AddPosition([FromBody] PositionAddDto positionAddDto)
 {
     try
     {
         return(DResult.Succ(businessOrganization.AddPosition(positionAddDto)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <OrganizationAbstractDto>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <PagedList <OrganizationDto> > > GetOrganizationOfTypeAsPage(string TypeId, int Page, int Size, bool IsLoadAll = false)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetOrganizationOfType(TypeId, Page, Size, IsLoadAll)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <PagedList <OrganizationDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <string> > AddOrganizationType([FromBody] OrganizationTypeAddDto organizationTypeAddDto)
 {
     try
     {
         return(DResult.Succ(businessOrganization.AddOrganizationType(organizationTypeAddDto)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <string>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <PagedList <OrganizationDto> > > GetSubOrganizationAsPageAndParent(string ParentId, int Page, int Size)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetSubOrganizationAndParent(ParentId, Page, Size)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <PagedList <OrganizationDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <int> > DeleteSystemInfoById(string SystemId)
 {
     try
     {
         return(DResult.Succ(businessSystem.DeleteInfoById(SystemId)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <int>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <PagedList <OrganizationDto> > > GetSubOrganizationsNoChildren(string organizationId, int page = 0, int size = 0)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetSubOrganizationsNoChildren(organizationId, page, size)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <PagedList <OrganizationDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <int> > DeleteOrganizationType(string OrganizationTypeId)
 {
     try
     {
         return(DResult.Succ(businessOrganization.DeleteOrganizationType(OrganizationTypeId)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <int>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <PagedList <OrganizationDto> > > QueryOrganizationAsPage([FromBody] OrganizationQueryPageDto queryPageDto)
 {
     try
     {
         return(DResult.Succ(businessOrganization.QueryOrganizations(queryPageDto.keyValues, queryPageDto.Page, queryPageDto.Size, queryPageDto.TypeId, queryPageDto.SystemId, queryPageDto.SystemCode)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <PagedList <OrganizationDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <OrganizationInfoMoreDto> > GetOrganizationInfoOfId(string OrganizationId)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetOrganizationInfo(OrganizationId)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <OrganizationInfoMoreDto>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <IList <OrganizationTypeDto> > > GetOrganizationType(string SystemId, string SystemCode)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetOrganizationType(SystemId, SystemCode)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <IList <OrganizationTypeDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <IList <IList <OrganizationDto> > > > GetParentListAll(string OrganizationId)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetParentListAll(OrganizationId)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <IList <IList <OrganizationDto> > >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
예제 #20
0
 public async Task <DResult <int> > UpdateUser([FromBody] UserUpdateDto userUpdateDto)
 {
     try
     {
         return(DResult.Succ(businessUser.UpdateUser(userUpdateDto)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <int>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <IList <AttributionTypeQueryInfoDto> > > GetOrganizationTypeQueryAttributionType(string TypeId)
 {
     try
     {
         return(DResult.Succ(businessOrganization.GetOrganizationTypeQueryAttributionType(TypeId)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <IList <AttributionTypeQueryInfoDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
예제 #22
0
 public async Task <DResult <IList <UserInfoDto> > > GetUsers(IList <string> UserIds)
 {
     try
     {
         return(DResult.Succ(businessUser.GetUsers(UserIds)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <IList <UserInfoDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
예제 #23
0
 public async Task <DResult <PagedList <UserInfoDto> > > QueryUser([FromBody] UserQueryPageDto userQueryDto)
 {
     try
     {
         return(DResult.Succ(businessUser.GetUsersOfInfo(userQueryDto)));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <PagedList <UserInfoDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <IList <SystemDto> > > GetSystemInfoAll()
 {
     try
     {
         return(DResult.Succ(businessSystem.GetSystemInfoAll()));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <IList <SystemDto> >(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
 public async Task <DResult <OrganizationAbstractDto> > AddOrganization([FromBody] OrganizationAddAbstractDto organization)
 {
     try
     {
         var r = businessOrganization.AddOrganization(organization);
         if (r == null)
         {
             return(DResult.Error <OrganizationAbstractDto>("机构名重复", 500));
         }
         return(DResult.Succ(r));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <OrganizationAbstractDto>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }
예제 #26
0
 public async Task <DResult <int> > UpdatePasswordNew([FromBody] UserUpdatePasswordNewDto passwordDto)
 {
     try
     {
         string userId = passwordDto.UserId;
         if (passwordDto.UserId.IsNullOrEmpty())
         {
             UserSessionInfo session = IocUnity.Get <SessionManager>().GetSessionByRequest(Request);
             userId = session.id;
         }
         int r = businessUser.UpdatePassword(passwordDto, userId);
         if (r == -1)
         {
             return(DResult.Error <int>("原始密码错误!", 503));
         }
         return(DResult.Succ(r));
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(DResult.Error <int>(ExceptionParse.ParseString(ex.Message), 500));
     }
 }