Пример #1
0
 public RequestItemViewModel()
 {
     _requestService       = new RequestServiceImpl.RequestService(AppSettings.DbConnection);
     ServiceList           = new ObservableCollection <ServiceDto>();
     MasterList            = new ObservableCollection <WorkerDto>(_requestService.GetMasters(null));
     ExecuterList          = new ObservableCollection <WorkerDto>(_requestService.GetExecuters(null));
     EquipmentList         = new ObservableCollection <EquipmentDto>(_requestService.GetEquipments());
     ParentServiceList     = new ObservableCollection <ServiceDto>(_requestService.GetServices(null));
     SelectedParentService = ParentServiceList.FirstOrDefault();
     PeriodList            = new ObservableCollection <PeriodDto>(_requestService.GetPeriods());
     SelectedPeriod        = PeriodList.FirstOrDefault();
     CompanyList           = new ObservableCollection <ServiceCompanyDto>(_requestService.GetServiceCompanies());
     SelectedCompany       = CompanyList.FirstOrDefault();
     Rating      = new RequestRatingDto();
     GarantyList = new ObservableCollection <GarantyDto>(new GarantyDto[] {
         new GarantyDto {
             Id = 0, Name = "Обычная"
         },
         new GarantyDto {
             Id = 1, Name = "Гарантия"
         },
         new GarantyDto {
             Id = 2, Name = "Возможно гарантия"
         },
     });
     SelectedGaranty = GarantyList.FirstOrDefault();
 }