//private double allcol3 = 0; //private double allfulcost3 = 0; public AdminViewModelStatistika() { ToOrdersCommand = new RellayCommand(ToOrders); var outter = from dict in _db.Orders select dict;//linq foreach (var item in outter) { Allfulcost = Allfulcost + item.FullCost; Allcol = Allcol + item.Amount; } foreach (var item in outter) { if (item.When.Month == DateTime.Now.Month) { Allfulcost2 = Allfulcost2 + item.FullCost; Allcol2 = Allcol2 + item.Amount; } } //foreach (var item in outter) //{ // if (item.When.Month == DateTime.Now.Month - 1) // { // Allfulcost3 = Allfulcost3 + item.FullCost; // Allcol3 = Allcol3 + item.Amount; // } //} }
//private double allcol3 = 0; //private double allfulcost3 = 0; public statistikaViewModel() { ToAuthorizationCommand = new RellayCommand(ToAuthorization); ToOrdersCommand = new RellayCommand(ToOrders); var currentUserId = CurrentUser.GetUserId(); var outter = from dict in _db.Orders where dict.UserId == currentUserId orderby dict.OrderId descending select dict;//linq foreach (var item in outter) { Allfulcost = Allfulcost + item.FullCost; Allcol = Allcol + item.Amount; } foreach (var item in outter) { if (item.When.Month == DateTime.Now.Month) { Allfulcost2 = Allfulcost2 + item.FullCost; Allcol2 = Allcol2 + item.Amount; } } //foreach (var item in outter) //{ // if (item.When.Month == DateTime.Now.Month - 1) // { // Allfulcost3 = Allfulcost3 + item.FullCost; // Allcol3 = Allcol3 + item.Amount; // } //} }
protected virtual void InitializeCommands() { CommitCommand = new RellayCommand(CommitCommandExecute, CommitCommandCanExecute); ReturnCommand = new RellayCommand(ReturnCommandExecute, ReturnCommandCanExecute); AddCommand = new RellayCommand(AddCommandExecute, AddCommandCanExecute); RemoveCommand = new RellayCommand(RemoveCommandExecute); }
protected override void InitializeCommands() { base.InitializeCommands(); VehicleUpperTypeCommand = new RellayCommand(VehicleUpperTypeCommandExecute); UnitUpperTypeCommand = new RellayCommand(UnitUpperTypeCommandExecute); }
protected override void InitializeCommands() { base.InitializeCommands(); OperationTypeCommand = new RellayCommand(OperationTypeCommandExecute); ActualPhaseCommand = new RellayCommand(ActualPhaseCommandExecute); }
private void InitializeCommands() { HideCommand = new RellayCommand(HideCommandExecute); AcceptCommand = new RellayCommand(AcceptCommandExecute, AcceptCommandCanExecute); CancelCommand = new RellayCommand(CancelCommandExecute, CancelCommandCanExecute); FinishCommand = new RellayCommand(FinishCommandExecute, FinishCommandCanExecute); AddAdditionalCommand = new RellayCommand(AddAdditionalCommandExecute, AddAdditionalCommandCanExecute); }
public AddOrderViewModel() { AddOrderCommand = new RellayCommand(AddOrder); ToOrdersCommand = new RellayCommand(ToOrders); var outter = from dict in _db.Dists select dict;//linq Distss = new ObservableCollection <Distiplina>(outter); }
private void InitializeCommands() { CreateCommand = new RellayCommand(CreateCommandExecute); FilterCommand = new RellayCommand(FilterCommandExecute); ClearFilterCommand = new RellayCommand(ClearFilterCommandExecute, ClearFilterCommandCanExecute); OperationStateCommand = new RellayCommand(OperationStateCommandExecute, OperationStateCommandCanExecute); OperationTypeCommand = new RellayCommand(OperationTypeCommandExecute, OperationCommandCanExecute); }
public zapisiViewModel() { Updatecommand = new RellayCommand(Update); ToOrdersCommand = new RellayCommand(ToOrders); RefreshCommand = new RellayCommand(refresh); var outter = from dict in _db.Orders select dict;//linq Orders = new ObservableCollection <Order>(outter); }
public AddOrderViewModel() { LogOutCommand = new RellayCommand(ToAuthorization); AddOrderCommand = new RellayCommand(AddOrder); ToOrdersCommand = new RellayCommand(ToOrders); var outter = from dict in _db.Fuels select dict;//linq Fuels = new ObservableCollection <Fuel>(outter); }
public HomeViewModel() { TozapasiCommand = new RellayCommand(Tozapisi); AddDistsCommand = new RellayCommand(AddDists); AddOrderCommand = new RellayCommand(AddOrder); DeleteComand = new RellayCommand(Delete); var outter = from dict in _db.Orders select dict;//linq Orders = new ObservableCollection <Order>(outter); }
public AdminViewModel() { Updatecommand = new RellayCommand(Update); ToOrdersCommand = new RellayCommand(ToOrders); Addcommand = new RellayCommand(Add); RefreshCommand = new RellayCommand(refresh); DeleteCommand = new RellayCommand(Delete); var outter = from dict in _db.Dists select dict;//linq Dists = new ObservableCollection <Distiplina>(outter); }
public AdminViewModel() { Updatecommand = new RellayCommand(Update); ToAuthorizationCommand = new RellayCommand(ToAuthorization); ToFuelsCommand = new RellayCommand(ToFuels); ToUsersCommand = new RellayCommand(ToUsers); SearchCommand = new RellayCommand(Search); RefreshCommand = new RellayCommand(Refresh); ToStatistikaCommand = new RellayCommand(ToStatistika); ChangePasswordCommand = new RellayCommand(ToChangePassword); Deleteordercommand = new RellayCommand(deleteorders); var outter = from dict in _db.Orders select dict;//linq Orders = new ObservableCollection <Order>(outter); }
public AdminViewModel2() { Updatecommand = new RellayCommand(Update); ToOrderscommand = new RellayCommand(Toorders); Addfuelcommand = new RellayCommand(Addfuel); ToAuthorizationCommand = new RellayCommand(Toauthorization); ToUsersCommand = new RellayCommand(Tousers); Deletefuelcommand = new RellayCommand(Delete); Searchfuelcommand = new RellayCommand(Search); RefreshCommand = new RellayCommand(Refresh); Zapolnitfuelcommand = new RellayCommand(Zapolnit); ToStatistikaCommand = new RellayCommand(ToStatistika); ChangePasswordCommand = new RellayCommand(ToChangePassword); var outter = from dict in _db.Fuels select dict;//linq Fuels = new ObservableCollection <Fuel>(outter); }
public HomeViewModel() { RefreshCommand = new RellayCommand(RefreshPage); LogOutCommand = new RellayCommand(LogOut); AddOrderCommand = new RellayCommand(AddOrder); OwnkabinetCommand = new RellayCommand(Toownkabinet); StatistikaCommand = new RellayCommand(ToStatistika); OpoveshCommand = new RellayCommand(opovesh); var currentUserId = CurrentUser.GetUserId(); var outter = from dict in _db.Orders where dict.UserId == currentUserId orderby dict.OrderId descending select dict;//linq Orders = new ObservableCollection <Order>(outter); var d = from dict in _db.Orders where dict.UserId == currentUserId select dict; int o = 0; if (d.Count() > 0) { foreach (var item in d) { if (item.Opovesh > 0) { o++; } } if (o > 0) { Message = "ОПОВЕЩАНИЕ!!!\nстатус заказов был\nизменен админом"; } else { } } else { } }
public AuthorizationViewModel() { LoginCommand = new RellayCommand(EnterAction); RegisterCommand = new RellayCommand(RegisterAction); var outher = from dict in _db.Admins select dict; if (outher.Count() == 0) { var admin = new Admin() { Name = "admin", Password = "******" }; _db.Admins.Add(admin); _db.SaveChanges();//сохраняем Message = "Админ создан"; } else { return; } }
private void InitializeCommands() { EditCommand = new RellayCommand(EditCommandExecute, EditCommandCanExecute); DetailCommand = new RellayCommand(DetailCommandExecute, DetailCommandCanExecute); }
private void InitializeCommands() { FilterCommand = new RellayCommand(FilterCommandExecute, FilterCommandCanExecute); HideCommand = new RellayCommand(HideCommandExecute); }
public AdminViewModelChangePassword() { ChangeParolCommand = new RellayCommand(ChangeParol); ToOrdersCommand = new RellayCommand(ToOrders); }
public ownkabinetViewModel() { ToAuthorizationCommand = new RellayCommand(ToAuthorization); ChangeParolCommand = new RellayCommand(ChangeParol); ToOrdersCommand = new RellayCommand(ToOrders); }
private void InitializeCommands() { CheckCommand = new RellayCommand(CheckCommandExecute, CheckCommandCanExecute); }
public RegistrationViewModel() { ToAuthorizationCommand = new RellayCommand(ToAuthorization); RegisterCommand = new RellayCommand(RegisterAction); }