Ejemplo n.º 1
0
        public async Task <IActionResult> EmergencyContact()
        {
            var contact = await _accountManageService.GetEmergencyContactAsync(User.Identity.Name);

            var countries = _mapper.Map <List <CountryViewModel> >(await _nomenclatureService.GetCountries());
            var cities    = _mapper.Map <List <CityViewModel> >(await _nomenclatureService.GetCitiesByCountryId(countries[0].Id));

            if (contact == null)
            {
                contact = new EmergencyContactServiceModel();
            }

            var model = _mapper.Map <EmergencyContactViewModel>(contact);

            model.Countries = countries;

            if (contact.Location == null)
            {
                model.Cities = cities;
            }
            else
            {
                model.Cities    = _mapper.Map <List <CityViewModel> >(await _nomenclatureService.GetCitiesByCountryId(contact.Location.City.Country.Id));
                model.CityId    = contact.Location.City.Id;
                model.CountryId = contact.Location.City.Country.Id;
            }
            model.StatusMessage = StatusMessage;

            return(View(model));
        }
Ejemplo n.º 2
0
        public IActionResult OnGet()
        {
            string usesId = _userService.GetUserId(User);

            var registrant = _registrantService.GetRegistrantByUserId(int.Parse(usesId));

            if (registrant == null)
            {
                StatusMessage = "No personal info was found, please enter it now";

                Input = new InputModel();
            }
            else
            {
                Input = new InputModel()
                {
                    Adress    = registrant.Address,
                    FirstName = registrant.FirstName,
                    LastName  = registrant.LastName,
                    CountryId = registrant.Country
                };
            }

            var countryServiceModels = _nomenclatureService.GetCountries();

            Countries = _mapper.Map <List <CountryModel> >(countryServiceModels);

            return(Page());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Страница с адреси
        /// </summary>
        /// <returns></returns>
        public IActionResult IndexAddress()
        {
            ViewBag.AddressTypeId_ddl = nomenclatureService.GetDropDownList <AddressType>();
            ViewBag.CountryCode_ddl   = nomenclatureService.GetCountries();
            var model = new AddressFilterVM()
            {
                CountryCode = NomenclatureConstants.CountryBG
            };

            return(View(model));
        }
 void SetViewbag(int courtId)
 {
     ViewBag.showButtons             = true;
     ViewBag.FromCourtId_ddl         = commonService.CourtForDelivery_SelectDDL(courtId);
     ViewBag.CourtId_ddl             = ViewBag.FromCourtId_ddl;
     ViewBag.AddressTypesDDL         = nomService.GetDropDownList <AddressType>();
     ViewBag.CountriesDDL            = nomService.GetCountries();
     ViewBag.NotificationStateId_ddl = nomService.GetDDL_NotificationStateFromDeliveryGroup(
         NomenclatureConstants.NotificationDeliveryGroup.WithSummons, -1
         );
     ViewBag.NotificationDeliveryGroupId_ddl = service.NotificationDeliveryGroupSelect();
 }
Ejemplo n.º 5
0
        public IActionResult CreateRegistrantView(int id)
        {
            var registrantModel = new RegistrantModel
            {
                UserId = id
            };

            var countriesServiceModel = _nomenclatureService.GetCountries();

            var countriesModel = _mapper.Map <List <CountryModel> >(countriesServiceModel);

            TempData.Put("Countries", countriesModel);

            return(View(registrantModel));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> CreateDepartment()
        {
            var countries = _mapper.Map <List <CountryViewModel> >(await _nomenclatureService.GetCountries());
            var companies = _mapper.Map <List <CompanyViewModel> >(await _adminService.GetCompanies());

            var model = new CreateDepartmentViewModel
            {
                Cities    = _mapper.Map <List <CityViewModel> >(await _nomenclatureService.GetCitiesByCountryId(countries[0].Id)),
                Countries = countries,
                Companies = companies
            };


            return(View(model));
        }
Ejemplo n.º 7
0
        public IActionResult AllWalletsWithSums(AllWalletsWithSumsViewModel model, string prevFilters, string sortBy = "", int pageIndex = 1)
        {
            var countries = _mapper.Map <List <CountryModel> >(_nomenclatureService.GetCountries()).OrderBy(x => x.Name).ToList();

            pageIndex = pageIndex > 0 ? pageIndex : 1;

            model.Countries   = countries;
            model.CurrentPage = pageIndex;
            model.CurrentSort = sortBy;

            if (prevFilters != null)
            {
                model.Filters = JsonConvert.DeserializeObject <AllWalletsWithSumsFilters>(prevFilters);
            }

            model.IdSort            = sortBy.Equals("Id") ? "Id_desc" : "Id";
            model.ClientNameSort    = sortBy.Equals("ClientName") ? "ClientName_desc" : "ClientName";
            model.ClientCountrySort = sortBy.Equals("ClientCountry") ? "ClientCountry_desc" : "ClientCountry";
            model.BalanceSort       = sortBy.Equals("Balance") ? "Balance_desc" : "Balance";
            model.CurrencySort      = sortBy.Equals("Currency") ? "Currency_desc" : "Currency";

            var filterServiceModel = _mapper.Map <AllWalletsWithSumsFiltersServiceModel>(model.Filters);

            var test = _administraionService.GetAllWalletsWithSums(sortBy, filterServiceModel);

            model.Data = test.ToPagedList(pageIndex, 10);

            return(View(model));
        }
Ejemplo n.º 8
0
        public void SetViewBagInstitutionAddress(int institutionId)
        {
            var institution = commonService.GetById <Institution>(institutionId);

            ViewBag.institutionName = institution.FullName;

            ViewBag.CountriesDDL    = nomService.GetCountries();
            ViewBag.AddressTypesDDL = nomService.GetDropDownList <AddressType>();
        }
Ejemplo n.º 9
0
        public void SetViewBagLawUnitAddress(int lawUnitId)
        {
            var lawUnit = commonService.GetById <LawUnit>(lawUnitId);

            ViewBag.lawUnitName = lawUnit.FullName;

            ViewBag.CountriesDDL    = nomService.GetCountries();
            ViewBag.AddressTypesDDL = nomService.GetDropDownList <AddressType>();
        }
Ejemplo n.º 10
0
        public IActionResult IndexEkStreet(string CityCodeInput)
        {
            ViewBag.CountryCode_ddl  = nomenclatureService.GetCountries();
            ViewBag.StreetTipeId_ddl = nomenclatureService.GetDDL_StreetType();

            var model = new EkStreetFilterVM()
            {
                CountryCode = NomenclatureConstants.CountryBG,
                CityCode    = (string.IsNullOrEmpty(CityCodeInput)) ? NomenclatureConstants.EkattCitySofiq : CityCodeInput
            };

            return(View(model));
        }
Ejemplo n.º 11
0
        void SetViewbag(string returnUrl, int courtId)
        {
            ViewBag.CourtTypeId_ddl   = nomService.GetDropDownList <CourtType>();
            ViewBag.CourtRegionId_ddl = regionService.CourtRegionSelectDDL();
            ViewBag.returnUrl         = returnUrl;
            if (returnUrl == "/")
            {
                ViewBag.breadcrumbs = commonService.Breadcrumbs_GetForCurrentCourt(courtId, returnUrl).DeleteOrDisableLast();
            }
            else
            {
                ViewBag.breadcrumbs = commonService.Breadcrumbs_GetForCourt(courtId, returnUrl).DeleteOrDisableLast();
            }

            ViewBag.CountriesDDL    = nomService.GetCountries();
            ViewBag.AddressTypesDDL = nomService.GetDropDownList <AddressType>();
        }
Ejemplo n.º 12
0
 public void SetViewBagPersonAddress()
 {
     ViewBag.CountriesDDL    = nomService.GetCountries();
     ViewBag.AddressTypesDDL = nomService.GetDropDownList <AddressType>();
 }