Esempio n. 1
0
 public bool UserLogin(string username, string password)
 {
     using (var wposContext = new WposContext())
     {
         var isAuthoriz = wposContext.UserAccountRepository.IsAuthorize(username, MiraculousMethods.Sha256Encrypt(password));
         if (isAuthoriz)
         {
             Username = username;
             Permissions = wposContext.UserAccountRepository.GetUserPermissions(username);
             AddDefultPermission();
         }
         return isAuthoriz;
     }
 }
Esempio n. 2
0
 private async void LoadData()
 {
     IsBusy = true;
     await Task.Factory.StartNew(() =>
     {
         using (IWposContext wposContext = new WposContext())
         {
             TotalProductItems = wposContext.ProductRepository.TotalProducts();
             TotalProductinStock = wposContext.StockRepository.TotalStock();
             TotalCustomer = wposContext.CustomerRepository.TotalCustomer();
             TotalSupplier = wposContext.SupplierRepository.TotalSupplier();
             TotalBankAccount = wposContext.BankRepository.TotalBankAcount();
             TotalSalesToday = wposContext.TransactionRepository.TodayTotalSalesItem();
             TotalSalesWeekly = wposContext.TransactionRepository.WeeklySales();
             TotalSalesMonthly = wposContext.TransactionRepository.MonthlySales();
             TodayTotalSalesItem = wposContext.TransactionRepository.TodayTotalSalesItem();
             CompanyInformation = wposContext.CompanyInformation.GetCopmanyInformation();
             var initiallicense = new InitialLicense();
             DaysLeft = initiallicense.DaysLeft().ToString(CultureInfo.InvariantCulture);
             LicenseTo = initiallicense.LicenseTo();
             IsBusy = false;
         }
     });
 }