コード例 #1
0
        private async Task <IRoleObjectViewModel> PopulateInitialValuesAsync(IRoleObjectViewModel model, CancellationToken cancellationToken)
        {
            if (model == null)
            {
                model = new RoleObjectViewModel();
            }
            model.DDLRoleList = await _ddlDAL.GetRoleListAsync(userId, cancellationToken, true);

            return(model);
        }
コード例 #2
0
        private async Task <IHireThingsUser> PopulateInitialValuesAsync(IHireThingsUser model, CancellationToken cancellationToken)
        {
            long securityQuestionId = 0;

            try
            {
                _userId = Convert.ToInt64(model.Id);
            }
            catch (Exception ex)
            {
                _userId = 0;
            }

            model.CountryList = await _ddlDAL.GetCountryListAsync(userId, cancellationToken, true);

            if (model.CountryId > 0)
            {
                model.LocationList = await _ddlDAL.GetLocationListAsync(userId, model.LocationId, cancellationToken, true);
            }
            else
            {
                model.LocationList = await _ddlDAL.GetLocationListAsync(userId, -1, cancellationToken, true);
            }


            model.SecurityQuestionList = await _ddlDAL.GetSecurityQuestionListAsync(userId, cancellationToken, securityQuestionId, true);

            model.RoleList = await _ddlDAL.GetRoleListAsync(userId, cancellationToken, true);

            model.GenderList = await _ddlDAL.GetGenderListAsync(userId, cancellationToken, true);


            model.CountryList[0].Identifier  = "ddlCountry";
            model.CountryList[0].SavedValue  = model.CountryId;
            model.LocationList[0].Identifier = "ddlLocation";
            model.LocationList[0].SavedValue = model.LocationId;



            return(model);
        }