public LoginViewModel(DbDataOperations db) { _viewId = Guid.NewGuid(); DataOpers = db; PosUsers = DataOpers.getUsers(); Status = "Введите свои данные"; }
public MainWindow(DbDataOperations db, User CurUser) { InitializeComponent(); AppVM = new ApplicationViewModel(this, db, CurUser); Loaded += new RoutedEventHandler(MainWindow_Loaded); //this.SupplyWarehouseComboBox.SelectionChanged += //new SelectionChangedEventHandler(AppVM.SupplyWarehouseComboBoxChanged); // this.CommodityWarehouseComboBox.SelectionChanged += new SelectionChangedEventHandler(AppVM.CommodityWarehouseComboBoxChanged); }
public FileAFormViewModel(FileAFormWindow wind, DbDataOperations DataOpers, User CurUser) { this.win = wind; this.DataOpers = DataOpers; this.Warehouses = DataOpers.getWarehouses(); this.Providers = this.DataOpers.getProviders(); this.NewSupplyLines = new ObservableCollection <SupplyLine>(); NewSupplyLines.CollectionChanged += NewSupplyLines_Changed; this.CurrentUser = CurUser; TotalSum = 0; fileMan = new FileManager(DataOpers); }
public LoginViewModel() { _viewId = Guid.NewGuid(); try { DataOpers = new DbDataOperations(); PosUsers = DataOpers.getUsers(); Status = "Введите свои данные"; } catch (Exception ex) { MessageBox.Show("Произошла ошибка! " + ex.Message); } }
public ApplicationViewModel(MainWindow win, DbDataOperations db, User CurUser) { this.DataOpers = db; //new DbDataOperations(); this.CurrentUser = CurUser; fileMan = new FileManager(); initialize(); CurrentUserString = "Здравствуйте, " + CurrentUser.FirName; try { DataOpers.CheckProviders(); DataOpers.CheckProviders(); DataOpers.CheckProviders(); } catch (DbUpdateException) { MessageBox.Show("Не удалось обновить возможные даты поставок. Рассмотрите возможность сделать это вручную"); } }
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); }
public FileAFormWindow(DbDataOperations db, User CurUser) { InitializeComponent(); VM = new FileAFormViewModel(this, db, CurUser); Loaded += new RoutedEventHandler(FileAFormWindow_Loaded); }
public FileManager(DbDataOperations db) { this.db = db; }
public FileManager() { db = new DbDataOperations(); }
public RegWindow(DbDataOperations db) { InitializeComponent(); VM = new LoginViewModel(db); Loaded += new RoutedEventHandler(RegWindow_Loaded); }
public SupplyUpdateWindow(DbDataOperations db, Supply sup, User CurUser) { InitializeComponent(); VM = new UpdateWindowViewModel(db, sup, CurUser); Loaded += new RoutedEventHandler(SupplyUpdateWindow_Loaded); }