private void SetViewBag(City city)
 {
     if (city == null || city.State == null)
     {
         ViewBag.States = null;
     }
     else
     {
         ViewBag.States = ControllerCommonFunctions.AddFirstItem(
             new SelectList(_citiesService.GetStatesIds(city.State.CountryId), "Id", "Name"));
     }
     ViewBag.Countries = ControllerCommonFunctions.AddFirstItem(
         new SelectList(_citiesService.GetCountriesIds(), "Id", "Name"));
 }
 private void SetViewBag(Company company)
 {
     if (company == null || company.CityId == null)
     {
         ViewBag.Cities = ViewBag.States = null;
     }
     else
     {
         ViewBag.Cities = ControllerCommonFunctions.AddFirstItem(
             new SelectList(_companiesService.GetCitiesIds(company.City.StateId), "Id", "Name"));
         ViewBag.States = ControllerCommonFunctions.AddFirstItem(
             new SelectList(_companiesService.GetStatesIds(company.City.State.CountryId), "Id", "Name"));
     }
     ViewBag.Currencies = ControllerCommonFunctions.AddFirstItem(
         new SelectList(_companiesService.GetCurrenciesIds(), "Id", "Name"));
     ViewBag.Companies = ControllerCommonFunctions.AddFirstItem(
         new SelectList(_companiesService.GetCompaniesIds(), "Id", "Name"));
     ViewBag.Countries = ControllerCommonFunctions.AddFirstItem(
         new SelectList(_companiesService.GetCountriesIds(), "Id", "Name"));
 }
 public void SetViewBag()
 {
     ViewBag.Countries = ControllerCommonFunctions.AddFirstItem(
         new SelectList(_statesService.GetCountriesIds(), "Id", "Name"));
 }
예제 #4
0
 private void SetViewBag()
 {
     ViewBag.People      = ControllerCommonFunctions.AddFirstItem(new SelectList(_employeesService.GetPersonsIds(), "Id", "Name"));
     ViewBag.Departments = ControllerCommonFunctions.AddFirstItem(new SelectList(_employeesService.GetDepartmentsIds(), "Id", "Name"));
     ViewBag.Positions   = ControllerCommonFunctions.AddFirstItem(new SelectList(_employeesService.GetPositionsIds(), "Id", "Name"));
 }
 private async Task SetCommonViewBag(long?id)
 {
     ViewBag.Users     = ControllerCommonFunctions.AddFirstItem(new SelectList(await _peopleService.GetUsersIds(id), "Id", "Name"));
     ViewBag.Companies = ControllerCommonFunctions.AddFirstItem(new SelectList(_peopleService.GetCompaniesIds(), "Id", "Name"));
 }