コード例 #1
0
        public int Login(string Id, string pass, string storeId)
        {
            DataTable getCashierpass = getGui.GetEmployeePass(Id);

            if (getCashierpass.Rows.Count == 0)
            {
                return(0);
            }
            else
            {
                string cashierPass = getCashierpass.Rows[0][1].ToString();
                string adminPass   = getGui.GetAdminPass(storeId).Rows[0][1].ToString();
                if (pass.ToLower() == cashierPass.ToLower() || pass.ToLower() == adminPass.ToLower())
                {
                    if (pass.ToLower() == cashierPass.ToLower())
                    {
                        StaticClass.isAdmin = false;
                    }
                    else
                    {
                        StaticClass.isAdmin = true;
                    }
                    StaticClass.cashierId = Id;
                    DataTable thongTinNV = getGui.GetEmpById(Id);
                    StaticClass.thongTinNV = thongTinNV.Rows[0];
                    return(2);
                }
                else
                {
                    return(1);
                }
            }
        }
コード例 #2
0
        public int Login(string Id, string pass, string storeId)
        {
            DataTable getCashierpass = getGui.GetEmployeePass(Id);

            if (getCashierpass.Rows.Count == 0)
            {
                return(0);
            }
            else
            {
                string    cashierPass = getCashierpass.Rows[0][1].ToString();
                string    adminPass   = getGui.GetAdminPass(storeId).Rows[0][1].ToString();
                string    adminSwipe  = getGui.GetAdminPass(storeId).Rows[0][2].ToString();
                DataTable thongTinNV  = getGui.GetEmployeeByID(storeId, Id);
                if (Convert.ToBoolean(thongTinNV.Rows[0][Employee_Prop.Disabled]))
                {
                    return(3);
                }
                if (pass.ToLower() == cashierPass.ToLower() || pass.ToLower() == adminPass.ToLower() || (pass.ToLower() == adminSwipe.ToLower() && adminSwipe != ""))
                {
                    if (pass.ToLower() == cashierPass.ToLower())
                    {
                        StaticClass.isAdmin = false;
                    }
                    else
                    {
                        StaticClass.isAdmin = true;
                    }
                    StaticClass.cashierId = Id;
                    //DataTable thongTinNV = getGui.GetEmployeeByID(storeId,Id);
                    StaticClass.thongTinNV = thongTinNV.Rows[0];
                    return(2);
                }
                else
                {
                    return(1);
                }
            }
        }