/// <summary>
        /// Creates the dash board view.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="employee">The employee.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="disciplineCollection">The discipline collection.</param>
        /// <param name="leaveRequestModel">The leave request model.</param>
        /// <param name="departmentCollection">The department collection.</param>
        /// <param name="trainingCollection">The training collection.</param>
        /// <param name="trainingRequestCollection">The training request collection.</param>
        /// <param name="leaveRequest">The leave request.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="employmentHistory">The employment history.</param>
        /// <param name="educationHistory">The education history.</param>
        /// <param name="skillSet">The skill set.</param>
        /// <param name="digitalFile">The digital file.</param>
        /// <param name="processingMessage">The processing message.</param>
        /// <returns></returns>
        public IEmployeeProfileView CreateDashBoardView(IUserDetail user, IEmployee employee, IList <ICompanyDetail> companyCollection, IList <IDiscipline> disciplineCollection,
                                                        IList <ILeaveRequestModel> leaveRequestModel, IList <IDepartment> departmentCollection, IList <ITraining> trainingCollection, IList <IEmployeeTrainingModel> trainingRequestCollection, ILeaveRequestModel leaveRequest, IList <IEmployee> employeeCollection,
                                                        IList <IEmploymentHistory> employmentHistory, IList <IEducationHistory> educationHistory, IList <ISkillSetModel> skillSet, IDigitalFile digitalFile, string processingMessage)
        {
            var returnModel = new EmployeeProfileView
            {
                User                      = user,
                EducationHistory          = educationHistory,
                EmploymentHistory         = employmentHistory,
                SkillSet                  = skillSet,
                Employee                  = employee,
                ProfilePictureDetail      = digitalFile,
                QueryCollection           = disciplineCollection,
                LeaveTypeCollection       = leaveRequestModel,
                CompanyCollection         = companyCollection,
                DepartmentCollection      = departmentCollection,
                TrainingCollection        = trainingCollection,
                ProcessingMessage         = processingMessage,
                EmployeeCollection        = employeeCollection,
                TrainingRequestCollection = trainingRequestCollection,
                LeaveRequest              = leaveRequest,
            };

            return(returnModel);
        }
Beispiel #2
0
        public async Task <IUserDetail> AddNew(IUserDetail entity)
        {
            TUserDetail tEntity = entity as TUserDetail;

            try
            {
                this.StartTransaction();
                var savedEntity = await base.AddNew(entity as TUserDetail);

                var userId       = entity.UserId;
                var userDetailId = savedEntity.Id;
                await this._userQueueRepository.AddNew(entity.SelectedQueues, userId, userDetailId);

                this.CommitTransaction();
                return(savedEntity);
            }
            catch (PostgresException ex)
            {
                throw new EntityUpdateException(ex);
            }
            catch
            {
                throw;
            }
        }
        /// <summary>
        /// Creates the employee view.
        /// </summary>
        /// <param name="employee">The employee.</param>
        /// <param name="user">The user.</param>
        /// <param name="companyColletion">The company colletion.</param>
        /// <param name="discipline">The discipline.</param>
        /// <param name="leaveRequestModel">The leave request model.</param>
        /// <param name="employmentHistory">The employment history.</param>
        /// <param name="educationHistory">The education history.</param>
        /// <param name="skillSet">The skill set.</param>
        /// <param name="digitalFile">The digital file.</param>
        /// <param name="processingMessage">The processing message.</param>
        /// <returns></returns>
        public IEmployeeProfileView CreateEmployeeView(IEmployee employee, IUserDetail user, IList <ICompanyDetail> companyColletion, IList <IDiscipline> discipline, IList <ILeaveRequestModel> leaveRequestModel, IList <IEmploymentHistory> employmentHistory,
                                                       IList <IEducationHistory> educationHistory, IList <ISkillSetModel> skillSet, IDigitalFile digitalFile,
                                                       IList <ISpouseModel> spouseModel, IList <IEmergency> emergency,
                                                       IList <IChildrenModel> childrenModel, IList <IBeneficiariesModel> beneficiariesModel,
                                                       IList <INextOfKin> nextOfKin, string processingMessage)
        {
            var returnModel = new EmployeeProfileView
            {
                Employee             = employee,
                User                 = user,
                EducationHistory     = educationHistory,
                EmploymentHistory    = employmentHistory,
                SkillSet             = skillSet,
                ProfilePictureDetail = digitalFile,
                QueryCollection      = discipline,
                LeaveTypeCollection  = leaveRequestModel,
                CompanyCollection    = companyColletion,
                ProcessingMessage    = processingMessage,
                spouseModel          = spouseModel,
                emergencyModel       = emergency,
                nextOfKinModel       = nextOfKin,
                childrenModel        = childrenModel,
                beneficiaryModel     = beneficiariesModel
            };

            return(returnModel);
        }
        /// <summary>
        /// Creates the admin dash board view.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="company">The company.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="levelCollection">The level collection.</param>
        /// <param name="gradeCollection">The grade collection.</param>
        /// <param name="jobTitleCollection">The job title collection.</param>
        /// <param name="disciplineCollection">The discipline collection.</param>
        /// <param name="leaveRequestModel">The leave request model.</param>
        /// <param name="departmentCollection">The department collection.</param>
        /// <param name="trainingCollection">The training collection.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="employmentHistory">The employment history.</param>
        /// <param name="educationHistory">The education history.</param>
        /// <param name="skillSet">The skill set.</param>
        /// <param name="digitalFile">The digital file.</param>
        /// <param name="pendingLeaveRequests">The pending leave requests.</param>
        /// <param name="pendingLoanRequest">The pending loan request.</param>
        /// <param name="pendingTrainingRequest">The pending training request.</param>
        /// <param name="processingMessage">The processing message.</param>
        /// <returns></returns>
        public IEmployeeProfileView CreateAdminDashBoardView(IUserDetail user, IEmployee employeeInfo, ICompanyDetail company, IList <ICompanyDetail> companyCollection, IList <ILevel> levelCollection, IList <IGrade> gradeCollection,
                                                             IList <IJobTitle> jobTitleCollection, IList <IDiscipline> disciplineCollection, IList <ILeaveRequestModel> leaveRequestModel, IList <IDepartment> departmentCollection,
                                                             IList <ITraining> trainingCollection, IList <IEmployee> employeeCollection, IList <IEmploymentHistory> employmentHistory, IList <IEducationHistory> educationHistory, IList <ISkillSetModel> skillSet,
                                                             IDigitalFile digitalFile, IList <ILeaveRequestModel> pendingLeaveRequests, IList <IEmployeeLoan> pendingLoanRequest, IList <IEmployeeTrainingModel> pendingTrainingRequest, string processingMessage)
        {
            var returnModel = new EmployeeProfileView
            {
                User                   = user,
                Company                = company,
                EducationHistory       = educationHistory,
                EmploymentHistory      = employmentHistory,
                SkillSet               = skillSet,
                ProfilePictureDetail   = digitalFile,
                QueryCollection        = disciplineCollection,
                LeaveTypeCollection    = leaveRequestModel,
                DepartmentCollection   = departmentCollection,
                TrainingCollection     = trainingCollection,
                ProcessingMessage      = processingMessage,
                EmployeeCollection     = employeeCollection,
                LevelCollection        = levelCollection,
                GradeCollection        = gradeCollection,
                JobTitle               = jobTitleCollection,
                PendingLeaveRquest     = pendingLeaveRequests,
                PendingLoanRequest     = pendingLoanRequest,
                PendingTrainingRequest = pendingTrainingRequest,
                CompanyCollection      = companyCollection,
                Employee               = employeeInfo
            };

            return(returnModel);
        }
Beispiel #5
0
        /// <summary>
        /// Creates the user role view.
        /// </summary>
        /// <param name="userDetail">The user detail.</param>
        /// <param name="userAppCollection">The user application collection.</param>
        /// <param name="appRoleCollection">The application role collection.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// userDetail
        /// or
        /// userAppCollection
        /// or
        /// appRoleCollection
        /// </exception>
        public IUsersView CreateUserRoleViewList(IUserDetail userDetail, IList <IUserAppRole> userAppCollection,
                                                 IList <IAppRole> appRoleCollection)
        {
            if (userDetail == null)
            {
                throw new ArgumentNullException(nameof(userDetail));
            }

            if (userAppCollection == null)
            {
                throw new ArgumentNullException(nameof(userAppCollection));
            }

            if (appRoleCollection == null)
            {
                throw new ArgumentNullException(nameof(appRoleCollection));
            }

            var appRoleDropDown = GetDropDownList.AppRoleListItems(appRoleCollection, -1);


            var returnView = new UsersView
            {
                UserId            = userDetail.UserId,
                Username          = userDetail.Username,
                IsUserVerified    = userDetail.IsUserVerified,
                FirstName         = userDetail.FirstName,
                LastName          = userDetail.LastName,
                Email             = userDetail.Email,
                AppRoleCollection = userAppCollection,
                RoleDropDown      = appRoleDropDown
            };

            return(returnView);
        }
Beispiel #6
0
        /// <summary>
        /// Saves the company admin.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">user</exception>
        public string SaveCompanyAdmin(IUserDetail user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            var result = string.Empty;

            var newRecord = new CompanyAdministrator
            {
                CompanyId = user.CompanyId,
                Username  = user.Username,
                IsActive  = true,
            };

            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    dbContext.CompanyAdministrators.Add(newRecord);

                    dbContext.SaveChanges();
                }
            }
            catch (Exception e)
            {
                result = string.Format("UpdateUserCompany - {0} , {1}", e.Message,
                                       e.InnerException != null ? e.InnerException.Message : "");
            }

            return(result);
        }
Beispiel #7
0
        public async Task <IUserDetail> Update(IUserDetail entity)
        {
            TUserDetail tEntity = entity as TUserDetail;

            try
            {
                this.StartTransaction();
                await base.Update(tEntity, x => new
                {
                    x.EmailAddress,
                    x.FirstName,
                    x.LastName,
                    x.ChangePasswordAtLogOn,
                    x.ChangePasswordAtSixtyDays,
                    x.EnforcePasswordHistory,
                    x.UserName
                });

                this.CommitTransaction();
                return(tEntity);
            }
            catch (PostgresException ex)
            {
                throw new EntityUpdateException(ex);
            }
            catch
            {
                throw;
            }
        }
Beispiel #8
0
        /// <summary>
        /// Updates the user company.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">user</exception>
        public string UpdateUserCompany(IUserDetail user)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            var result = string.Empty;

            try
            {
                using (
                    var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS))
                {
                    var dbModel = dbContext.Users.SingleOrDefault(p => p.UserId.Equals(user.UserId));

                    dbModel.CompanyId = user.CompanyId;

                    dbContext.SaveChanges();
                }
            }
            catch (Exception e)
            {
                result = string.Format("UpdateUserCompany - {0} , {1}", e.Message,
                                       e.InnerException != null ? e.InnerException.Message : "");
            }

            return(result);
        }
Beispiel #9
0
        public async Task <IActionResult> SignIn(SignInAddressModel model)
        {
            var provider = _authProviders.SingleOrDefault(t => t.GetName().ToLower() == model.ProviderName.ToLower());

            if (provider == null)
            {
                return(NotFound());
            }
            var         oauthModel = model.BuildOAuthInfo();
            IUserDetail info       = null;

            try
            {
                info = await provider.GetUserDetail(model.Code);
            }
            catch (AiurAPIModelException)
            {
                var refreshlink = provider.GetSignInRedirectLink(new AiurUrl("", new FinishAuthInfo
                {
                    AppId       = oauthModel.AppId,
                    RedirectUri = oauthModel.RedirectUri,
                    State       = oauthModel.State,
                }));
                return(Redirect(refreshlink));
            }
            var account = await _dbContext
                          .ThirdPartyAccounts
                          .Include(t => t.Owner)
                          .ThenInclude(t => t.Emails)
                          .Where(t => t.Owner != null)
                          .Where(t => t.OpenId != null)
                          .FirstOrDefaultAsync(t => t.OpenId == info.Id);

            var app = (await _apiService.AppInfoAsync(oauthModel.AppId)).App;

            if (account != null)
            {
                await _authLogger.LogAuthRecord(account.OwnerId, HttpContext, true, app.AppId);

                await _signInManager.SignInAsync(account.Owner, true);

                return(await _authManager.FinishAuth(account.Owner, oauthModel, app.ForceConfirmation, app.TrustedApp));
            }
            var viewModel = new SignInViewModel
            {
                RedirectUri  = oauthModel.RedirectUri,
                State        = oauthModel.State,
                AppId        = oauthModel.AppId,
                UserDetail   = info,
                ProviderName = model.ProviderName,
                AppImageUrl  = app.IconPath,
                CanFindAnAccountWithEmail = await _dbContext.UserEmails.AnyAsync(t => t.EmailAddress.ToLower() == info.Email.ToLower()),
                Provider = provider
            };

            return(View(viewModel));
        }
Beispiel #10
0
        /// <summary>
        /// Creates the header view.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="company">The company.</param>
        /// <param name="companyLogo">The company logo.</param>
        /// <returns></returns>
        public IHeaderViewModel CreateHeaderView(IUserDetail user, ICompanyDetail company, IDigitalFile companyLogo)
        {
            var result = new HeaderViewModel
            {
                User        = user,
                Company     = company,
                CompanyLogo = companyLogo
            };

            return(result);
        }
Beispiel #11
0
        public async Task <bool> UpdateAboutIntro(string profileUrl, IUserDetail userDetail)
        {
            using (var conn = await Connection.OpenConnectionAsync())
            {
                var param = new { userDetail.UserId, userDetail.About, ProfileAddress = profileUrl };

                await SqlMapper.ExecuteAsync(conn, SpNames.UserDetail.UpdateAboutAndProfileAddress, param, commandType : CommandType.StoredProcedure);

                return(true);
            }
        }
Beispiel #12
0
        public IHomeView GetDashBoardOption(IUserDetail userInfo, IList <ICompanyDetail> companyCollection)
        {
            var companyDDL = GetDropDownList.CompanyListItems(companyCollection, -1);

            var result = new HomeModelView
            {
                CompanyCollection = companyCollection,
                CompanyDropDown   = companyDDL,
                User = userInfo
            };

            return(result);
        }
        public IUserDetail GetUserDetail(Guid userDetailId)
        {
            IUserDetail data = null;

            using (var context = new Data.ScheduleContext())
            {
                var item = context.UserDetails.FirstOrDefault(x => x.UserDetailId == userDetailId.ToString());
                if (item != null)
                {
                    data = Mapper.Map <UserDetailDto>(item);
                }
            }

            return(data);
        }
        /// <summary>
        /// Creates the profile view.
        /// </summary>
        /// <param name="profileInfo">The profile information.</param>
        /// <param name="users">The users.</param>
        /// <param name="genderCollection">The gender collection.</param>
        /// <param name="countryCollection">The country collection.</param>
        /// <param name="processingMesage">The processing mesage.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentException">genderCollection</exception>
        public IProfileView CreateProfileView(IProfileView profileInfo, IUserDetail users, IList <IYourGender> genderCollection, IList <ICountry> countryCollection, string processingMesage)
        {
            if (genderCollection == null)
            {
                throw new ArgumentException(nameof(genderCollection));
            }

            var genderDLL  = GetDropDownList.GenderListItems(genderCollection, profileInfo.GenderId);
            var countryDLL = GetDropDownList.CountryListItem(countryCollection, profileInfo.CountryId);

            profileInfo.GenderDropDown    = genderDLL;
            profileInfo.CountryDropDown   = countryDLL;
            profileInfo.User              = users;
            profileInfo.ProcessingMessage = processingMesage;


            return(profileInfo);
        }
Beispiel #15
0
        public UserFacade(UserManager <IdentityUser> _userManager, SignInManager <IdentityUser> _signInManager)
        {
            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration    = builder.Build();
            string             connectionString = configuration.GetConnectionString("DefaultConnection").ToString();

            var optionsBuilder = new DbContextOptionsBuilder <ljgbContext>();

            optionsBuilder.UseSqlServer(connectionString);
            userManager   = _userManager;
            signInManager = _signInManager;

            db      = new ljgbContext(optionsBuilder.Options);
            dep     = new UserProfileRepository(db);
            IDetail = new UserDetailRepository(db);
        }
        /// <summary>
        /// Edits the profile view.
        /// </summary>
        /// <param name="profileInfo">The profile information.</param>
        /// <param name="userDetail">The user detail.</param>
        /// <param name="genderCollection">The gender collection.</param>
        /// <param name="countryCollection">The country collection.</param>
        /// <param name="processingMessage">The processing message.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentException">genderCollection</exception>
        /// <exception cref="ArgumentNullException">
        /// profileInfo
        /// or
        /// userDetail
        /// </exception>
        public IProfileView EditProfileView(IProfile profileInfo, IUserDetail userDetail, IList <IYourGender> genderCollection, IList <ICountry> countryCollection, string processingMessage)
        {
            if (genderCollection == null)
            {
                throw new ArgumentException(nameof(genderCollection));
            }

            if (profileInfo == null)
            {
                throw new ArgumentNullException(nameof(profileInfo));
            }

            if (userDetail == null)
            {
                throw new ArgumentNullException(nameof(userDetail));
            }

            var genderDLL  = GetDropDownList.GenderListItems(genderCollection, profileInfo.GenderId);
            var CountryDLL = GetDropDownList.CountryListItem(countryCollection, profileInfo.CountryId);

            var viewModel = new ProfileModelView
            {
                User                 = userDetail,
                ProfileId            = profileInfo.ProfileId,
                CountryId            = profileInfo.CountryId,
                Address              = profileInfo.Address,
                DateOfBirth          = profileInfo.DateOfBirth,
                Nationality          = profileInfo.Nationality,
                StateOfOrigin        = profileInfo.StateOfOrigin,
                Gender               = profileInfo.Gender,
                GenderId             = profileInfo.GenderId,
                ProfileSummary       = profileInfo.ProfileSummary,
                DateCreated          = profileInfo.DateCreated,
                PictureDigitalFileId = profileInfo.PictureDigitalFileId,
                CVDigitalFileId      = profileInfo.CVDigitalFileId,
                GenderDropDown       = genderDLL,
                CountryDropDown      = CountryDLL,
                ProcessingMessage    = processingMessage ?? string.Empty
            };

            return(viewModel);
        }
        /// <summary>
        /// Creates the profile view.
        /// </summary>
        /// <param name="userInfo">The user information.</param>
        /// <param name="genderCollection">The gender collection.</param>
        /// <param name="countrycollection">The countrycollection.</param>
        /// <param name="processingMesage">The processing mesage.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentException">genderCollection</exception>
        public IProfileView CreateProfileView(IUserDetail userInfo, IList <IYourGender> genderCollection, IList <ICountry> countrycollection, string processingMesage)
        {
            if (genderCollection == null)
            {
                throw new ArgumentException(nameof(genderCollection));
            }


            var genderDLL  = GetDropDownList.GenderListItems(genderCollection, -1);
            var CountryDDL = GetDropDownList.CountryListItem(countrycollection, 161);

            var viewModel = new ProfileModelView
            {
                User              = userInfo,
                GenderDropDown    = genderDLL,
                CountryDropDown   = CountryDDL,
                ProcessingMessage = processingMesage ?? string.Empty,
                CountryId         = 161
            };

            return(viewModel);
        }
Beispiel #18
0
        /// <summary>
        /// Creates the edit user view.
        /// </summary>
        /// <param name="userDetail">The user detail.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="appRoleCollection">The application role collection.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// userDetail
        /// or
        /// companyCollection
        /// or
        /// appRoleCollection
        /// </exception>
        public IUserViewModel CreateEditUserView(IUserDetail userDetail, IList <ICompanyDetail> companyCollection,
                                                 IList <IAppRole> appRoleCollection)
        {
            if (userDetail == null)
            {
                throw new ArgumentNullException(nameof(userDetail));
            }

            if (companyCollection == null)
            {
                throw new ArgumentNullException(nameof(companyCollection));
            }

            if (appRoleCollection == null)
            {
                throw new ArgumentNullException(nameof(appRoleCollection));
            }

            var companyDropDown = GetDropDownList.CompanyListItems(companyCollection, -1);

            var appRoleDropDown = GetDropDownList.AppRoleListItems(appRoleCollection, -1);


            var returnView = new UserViewModel
            {
                UserId          = userDetail.UserId,
                Username        = userDetail.Username,
                IsUserVerified  = userDetail.IsUserVerified,
                FirstName       = userDetail.FirstName,
                LastName        = userDetail.LastName,
                Email           = userDetail.Email,
                CompanyDropDown = companyDropDown,
                RoleDropDown    = appRoleDropDown
            };

            return(returnView);
        }
Beispiel #19
0
        private void Initialie(DetailByIdParameter parameter)
        {
            _categoryService.UpdateCategory();
            if (parameter == null)
            {
                // オフライン
                IsFollowing = new ReactiveProperty <bool>(false);
                _isOffline  = true;
                return;
            }
            _id        = string.IsNullOrWhiteSpace(parameter.Id) ? _accountService.LoggedInAccount.Id : parameter.Id;
            _pixivUser = new PixivDetail(_id, SearchType.Users, _pixivClient, _queryCacheService);
            var observer = _pixivUser.ObserveProperty(w => w.UserDetail).Where(w => w != null).Publish();

            observer.ObserveOnUIDispatcher().Subscribe(w =>
            {
                _userDetail   = w;
                Thumbnailable = new PixivUserImage(w.User, _imageStoreService);
                if (string.IsNullOrWhiteSpace(w.Profile.BackgroundImageUrl))
                {
                    Thumbnailable2 = new PixivUserImage(w.User, _imageStoreService);
                }
                else
                {
                    Thumbnailable2 = new PixivUrlImage(w.Profile.BackgroundImageUrl, _imageStoreService);
                }
                var param1 = new UserDetailParameter
                {
                    Detail      = w,
                    ProfileType = ProfileType.Work,
                    ContentType = ContentType.Illust
                };
                Parameter = ParamGen.GenerateRaw(param1, v => v.ProfileType).Cast <object>().Skip(1).ToList();
            });
            Username    = observer.Select(w => w.User.Name).ToReadOnlyReactiveProperty().AddTo(this);
            ScreenName  = observer.Select(w => $"@{w.User.AccountName}").ToReadOnlyReactiveProperty().AddTo(this);
            Url         = observer.Select(w => w.Profile.Webpage).ToReadOnlyReactiveProperty().AddTo(this);
            NavigateUrl = observer.Select(w => w.Profile.Webpage)
                          .Where(w => !string.IsNullOrWhiteSpace(w))
                          .Select(w => new Uri(w))
                          .ToReadOnlyReactiveProperty()
                          .AddTo(this);
            Gender = observer.Select(w => w.Profile.Gender)
                     .Where(w => !string.IsNullOrWhiteSpace(w))
                     .Select(w => w.ToLower() == "male" ? Resources.GetString("Male") : Resources.GetString("Famale"))
                     .ToReadOnlyReactiveProperty()
                     .AddTo(this);
            Region     = observer.Select(w => w.Profile.Region).ToReadOnlyReactiveProperty().AddTo(this);
            Birthday   = observer.Select(w => w.Profile.Birth).ToReadOnlyReactiveProperty().AddTo(this);
            Job        = observer.Select(w => w.Profile.Job).ToReadOnlyReactiveProperty().AddTo(this);
            Twitter    = observer.Select(w => w.Profile.TwitterAccount).ToReadOnlyReactiveProperty().AddTo(this);
            TwitterUrl = observer.Select(w => w.Profile.TwitterAccount)
                         .Where(w => !string.IsNullOrWhiteSpace(w))
                         .Select(w => new Uri($"https://twitter.com/{w}"))
                         .ToReadOnlyReactiveProperty()
                         .AddTo(this);
            Description = observer.Select(w => w.User.Comment).ToReadOnlyReactiveProperty().AddTo(this);
            Computer    = observer.Select(w => w.Workspace.Pc).ToReadOnlyReactiveProperty().AddTo(this);
            Monitor     = observer.Select(w => w.Workspace.Monitor).ToReadOnlyReactiveProperty().AddTo(this);
            Software    = observer.Select(w => w.Workspace.Tool).ToReadOnlyReactiveProperty().AddTo(this);
            Scanner     = observer.Select(w => w.Workspace.Scanner).ToReadOnlyReactiveProperty().AddTo(this);
            Tablet      = observer.Select(w => w.Workspace.Tablet).ToReadOnlyReactiveProperty().AddTo(this);
            Mouse       = observer.Select(w => w.Workspace.Monitor).ToReadOnlyReactiveProperty().AddTo(this);
            Printer     = observer.Select(w => w.Workspace.Printer).ToReadOnlyReactiveProperty().AddTo(this);
            Desktop     = observer.Select(w => w.Workspace.Desktop).ToReadOnlyReactiveProperty().AddTo(this);
            Bgm         = observer.Select(w => w.Workspace.Music).ToReadOnlyReactiveProperty().AddTo(this);
            Table       = observer.Select(w => w.Workspace.Desk).ToReadOnlyReactiveProperty().AddTo(this);
            Chair       = observer.Select(w => w.Workspace.Chair).ToReadOnlyReactiveProperty().AddTo(this);
            Other       = observer.Select(w => w.Workspace.Comment).ToReadOnlyReactiveProperty().AddTo(this);
            IsFollowing = observer.Select(w => w.User.IsFollowed).ToReactiveProperty().AddTo(this);
            observer.Connect().AddTo(this);

            _pixivUser.Fetch();
        }
 public ChangeResult AddUserDetail(IUserDetail userDetail)
 {
     return(AddUserDetail(new List <IUserDetail> {
         userDetail
     }));
 }
 public UsersController(IUserDetail userDetail, IMapper mapper, IAuthService authService)
 {
     _userDetail  = userDetail;
     _mapper      = mapper;
     _authService = authService;
 }
Beispiel #22
0
        /// <summary>
        /// Creates the user role view.
        /// </summary>
        /// <param name="appRoleCollection">The application role collection.</param>
        /// <param name="userDetail">The user detail.</param>
        /// <param name="loggedInUsername">The logged in username.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">appRoleCollection</exception>
        public IUserAppRoleView CreateUserRoleView(IList <IAppRole> appRoleCollection, IUserDetail userDetail, string loggedInUsername)
        {
            if (appRoleCollection == null)
            {
                throw new ArgumentNullException(nameof(appRoleCollection));
            }

            var appRoleDropDown = GetDropDownList.AppRoleListItems(appRoleCollection, -1);


            var returnView = new UserAppRoleView
            {
                AppRoleCollection = appRoleDropDown,
                Username          = userDetail.Username,
                UserId            = userDetail.UserId,
                CreateByUsername  = loggedInUsername
            };

            return(returnView);
        }
 public ChangeResult UpdateUserDetail(IUserDetail userDetail)
 {
     return(UpdateUserDetail(new List <IUserDetail> {
         userDetail
     }));
 }