Exemple #1
0
        IShowWindowService showWindow; //for show messages in mvvm pattern order

        public MainViewModel(Window mainWindow, DefaultShowWindowService showWindow, int userId)
        {
            Records = new ObservableCollection <Records>();

            showWindow    = new DefaultShowWindowService();
            dialogService = new DefaultDialogService();

            Usver = FindeUser(userId);
            if (Usver == null)
            {
                dialogService.ShowMessage("Проблема с авторизацией подвязкой пользователя к оформлению заказа");
                return;
            }
            UsrOps     = new UserOps(userId, 0);
            PersoneOps = new PersoneOps();

            EndDateReception   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 0, 0);
            StartDateReception = EndDateReception.AddDays(-10);

            _Filters                 = new _Filters();
            _Filters.DateParam1      = EndDateReception;
            _Filters.StartDateparam  = StartDateReception;
            _Filters.StartDateparam2 = StartDateReception;
            _Filters.StartDateparam3 = StartDateReception;
            _Filters.EndtDateparam   = EndDateReception;
            _Filters.EndtDateparam2  = EndDateReception;
            _Filters.EndtDateparam3  = EndDateReception;

            //EndDateReception = DateTime.Now;
            LoadData();
            this.mainWindow = mainWindow;
            this.showWindow = showWindow;
        }
        public void ValidateCard(int CardNo, int Pin)
        {
            UserOps userOps      = new UserOps();
            User    user         = userOps.getUserInfo(CardNo, Pin);
            bool    validateUser = userOps.ValidateUser(user);

            _validateUser = validateUser;
            _userID       = user.Id;
        }
Exemple #3
0
        public Article(List <object> articleParams)
        {
            Title       = articleParams[0].ToString();
            Image       = articleParams[1] == null || articleParams[1].ToString() == "" ? "/img/placeholder.jpg" : articleParams[1].ToString();
            Description = articleParams[2].ToString();
            var setDate = articleParams[3].ToString().Split(' ', ':', '.').Select(x => int.Parse(x)).ToArray();

            Date       = new DateTime(setDate[2], setDate[1], setDate[0]);
            Article_id = int.Parse(articleParams[4].ToString());
            var id = articleParams[5].ToString();

            if (id != null && id != "")
            {
                User_Name = UserOps.GetUser(int.Parse(id)).Login;
            }
            else
            {
                User_Name = "Admin";
            }
        }
 public LoginModel Login(LoginModel loginModel)
 {
     return(UserOps.Login(loginModel));
 }