Exemplo n.º 1
0
        private static void CreateRegistry()
        {
            EncryptionDecryption encryption = new EncryptionDecryption();
            RegistryKey          key        = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\InfofixPosBilling");

            //storing the values
            key.SetValue("ExpiryDate", encryption.Encryptdata(DateTime.Now.Date.ToString()));
            key.Close();
        }
Exemplo n.º 2
0
        public bool IsCashierAuthenticated(int cashierID, string cashierPassword)
        {
            EncryptionDecryption passwordEncryptionDecryption = new EncryptionDecryption();
            string EncryptedPassword            = passwordEncryptionDecryption.Encryptdata(cashierPassword);
            List <CashierDetail> allCashierList = cashierDataAccess.GetAllCashiers();

            var cashierDetail = allCashierList.SingleOrDefault(obj => obj.CashierID.Equals(cashierID) && obj.Password.Equals(EncryptedPassword));

            if (cashierDetail != null)
            {
                Task.Run(() => cashierDataAccess.AddLastLoggedInTimedForLoggedCashier(cashierID));
            }

            return(cashierDetail != null);
        }
Exemplo n.º 3
0
        public bool IsAdminAuthenticated(string userId, string password)
        {
            EncryptionDecryption passwordEncryptionDecryption = new EncryptionDecryption();
            string             EncryptedPassword = passwordEncryptionDecryption.Encryptdata(password);
            List <AdminDetail> allAdmins         = accessDB.GetAllAdmin();

            foreach (AdminDetail admin in allAdmins)
            {
                if (userId.Equals(admin.UserId) && EncryptedPassword.Equals(admin.Password))
                {
                    Task.Run(() => accessDB.AddLastoggedInTimeForLoggedAdmin(admin.UserId));
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 4
0
        public bool SaveCashierDetails(string name, int id, string password, string mobileNumber)
        {
            EncryptionDecryption passwordEncrypt = new EncryptionDecryption();
            string        decryptedPassword      = passwordEncrypt.Encryptdata(password);
            CashierDetail newCashier             = new CashierDetail()
            {
                Id           = id,
                CashierName  = name,
                CashierID    = id,
                Password     = decryptedPassword,
                MobileNumber = mobileNumber,
                IsActive     = false,
            };

            return(accessDB.SaveCashier(newCashier));
        }