Exemplo n.º 1
0
		public ClientUserViewModel(ClientUser clientUser, string companyState = null, string branchState = null)
		{
			User = new UserViewModel();
			User.Email = clientUser.User.Email;
			User.FirstName = clientUser.User.FirstName;
			User.LastName = clientUser.User.LastName;
			RoleType = clientUser.User.PrimaryRole.RoleType;
			Status = clientUser.Status;
			PhoneNumber = clientUser.PhoneNumber;
			IsViewAllCompanyOrders = clientUser.IsViewAllCompanyOrders;
			IsUserLocked = clientUser.IsUserLocked;

			if (clientUser.Company != null)
			{
				Company = new ClientCompanyViewModel(clientUser.Company, companyState);
				CompanyName = clientUser.Company.CompanyName;
				CompanyID = clientUser.Company.Id;

				if (clientUser.Branch != null)
				{
					Branch = new BrancheViewModel(clientUser.Branch, clientUser.Company.Status, branchState, false, null);
					BranchID = clientUser.Branch.Id;
				}
			}
		}
Exemplo n.º 2
0
		private Dictionary<string, string> GetClientUserRoles(ClientCompanyViewModel company)
		{
			Dictionary<string, string> roles = new Dictionary<string, string>();
			if (company != null)
			{
				if (company.IsLender || company.IsOtherBusinessType)
				{
					roles = _refManager.GetLenderAndOtherCompanyRolesForClientUsers();
				}
				else if (company.IsBroker)
				{
					roles = _refManager.GetBrokerCompanyRolesForClientUsers();
				}
				else if (company.IsAppraiserManagementCompany)
				{
					roles = _refManager.GetAppraiserManagementCompanyRolesForClientUsers();
				}
			}

			return roles;
		}