//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;
            //    }
            //}
        }
예제 #2
0
        //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);
        }
예제 #5
0
        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);
 }
예제 #7
0
        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);
        }
예제 #8
0
        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);
        }
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }
예제 #11
0
        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);
        }
예제 #12
0
        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);
        }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
        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
            {
            }
        }
예제 #16
0
        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);
 }
예제 #18
0
 private void InitializeCommands()
 {
     FilterCommand = new RellayCommand(FilterCommandExecute, FilterCommandCanExecute);
     HideCommand   = new RellayCommand(HideCommandExecute);
 }
 public AdminViewModelChangePassword()
 {
     ChangeParolCommand = new RellayCommand(ChangeParol);
     ToOrdersCommand    = new RellayCommand(ToOrders);
 }
예제 #20
0
 public ownkabinetViewModel()
 {
     ToAuthorizationCommand = new RellayCommand(ToAuthorization);
     ChangeParolCommand     = new RellayCommand(ChangeParol);
     ToOrdersCommand        = new RellayCommand(ToOrders);
 }
 private void InitializeCommands()
 {
     CheckCommand = new RellayCommand(CheckCommandExecute, CheckCommandCanExecute);
 }
예제 #22
0
 public RegistrationViewModel()
 {
     ToAuthorizationCommand = new RellayCommand(ToAuthorization);
     RegisterCommand        = new RellayCommand(RegisterAction);
 }