public void SelectArranger()
 {
     if (SelectedSupply.ArrangerId != null)
     {
         Arranger = DataOpers.getUsers().Where(i => i.Id == SelectedSupply.ArrangerId).FirstOrDefault().FamName + " " +
                    DataOpers.getUsers().Where(i => i.Id == SelectedSupply.ArrangerId).FirstOrDefault().FirName;
     }
     else
     {
         Arranger = "Не оформлено";
     }
 }
Пример #2
0
 public LoginViewModel(DbDataOperations db)
 {
     _viewId   = Guid.NewGuid();
     DataOpers = db;
     PosUsers  = DataOpers.getUsers();
     Status    = "Введите свои данные";
 }
 public UpdateWindowViewModel(DbDataOperations DbOps, Supply sup, User CurUser)
 {
     this.DataOpers = DbOps;
     SelectedSupply = sup;
     //Lines = DataOpers.getSupplyLines(sup.Id);
     Title       = "Просмотр поставки";
     CurrentUser = CurUser;
     Applicant   = DataOpers.getUsers().Where(i => i.Id == sup.ApplicantId).FirstOrDefault().FamName + " " +
                   DataOpers.getUsers().Where(i => i.Id == sup.ApplicantId).FirstOrDefault().FirName;
     SelectArranger();
     SelectArrangementDate();
     Provider       = DataOpers.getProviders().Where(i => i.Id == sup.ProviderId).FirstOrDefault().CompanyName;
     Statuses       = DataOpers.getSupplyStatuses();
     SelectedStatus = Statuses.Where(i => i.Id == sup.StatusId).FirstOrDefault();
     StatusChanger  = 0;
     SetStatus();
     Warehouse = DataOpers.getWarehouses().Where(i => i.Id == sup.WarehouseId).FirstOrDefault().Address;
     fileMan   = new FileManager(DataOpers);
 }
Пример #4
0
 public LoginViewModel()
 {
     _viewId = Guid.NewGuid();
     try
     {
         DataOpers = new DbDataOperations();
         PosUsers  = DataOpers.getUsers();
         Status    = "Введите свои данные";
     }
     catch (Exception ex)
     {
         MessageBox.Show("Произошла ошибка! " + ex.Message);
     }
 }