示例#1
0
        public static bool CekEkspedisi()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "CEK_EKSPEDISI");

            if (lookupValue == string.Empty)
            {
                lookupValue = "1";
            }

            return(lookupValue == "1");
        }
示例#2
0
        public static bool CekPrintBukuBank()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "PRINT_BUKU_BANK");

            if (lookupValue == string.Empty)
            {
                lookupValue = "1";
            }

            return(lookupValue == "1");
        }
示例#3
0
        public static bool CekIndenTunai()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "INDEN_TUNAI");

            if (lookupValue == string.Empty)
            {
                lookupValue = "0";
            }

            return(lookupValue == "1");
        }
示例#4
0
        public static bool CekPinCetakRegister()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "PIN_CETAK_REGISTER");

            if (lookupValue == string.Empty)
            {
                lookupValue = "1";
            }

            return(lookupValue == "1");
        }
示例#5
0
        public static bool CekValidasiRegister()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "VALIDASI_REGISTER");

            if (lookupValue == string.Empty)
            {
                lookupValue = "1";
            }

            return(lookupValue == "1");
        }
示例#6
0
        public static bool IsPasswordExpired()
        {
            bool expired = false;


            int maxAge = int.Parse(LookupInfo.GetValue("SECURITY", "PASSWORD_AGE"));

            if (maxAge > 0)
            {
                int datediff = DateTime.Now.Subtract(SecurityManager.TglPassword).Days;

                if (datediff > maxAge)
                {
                    expired = true;
                }
            }

            return(expired);
        }
示例#7
0
        public static void RecordLoginAttempt(string userID)
        {
            try
            {
                int maxAttempt = int.Parse(LookupInfo.GetValue("SECURITY", "MAX_LOGIN_ATTEMPT"));

                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_SecurityLoginAttempt_INSERT"));
                    db.Commands[0].Parameters.Add(new Parameter("@userID", SqlDbType.VarChar, userID));
                    db.Commands[0].Parameters.Add(new Parameter("@tglLogin", SqlDbType.DateTime, DateTime.Now));
                    db.Commands[0].Parameters.Add(new Parameter("@ipAddress", SqlDbType.VarChar, SecurityManager.ClientIPAddress));
                    db.Commands[0].ExecuteNonQuery();
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
        }