Exemplo n.º 1
0
        public static bool CekAccSO(string userId)
        {
            string lookupValue = LookupInfo.GetValue("ACC_SO", userId);

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

            return(lookupValue == "1");
        }
Exemplo n.º 2
0
        public static bool CekFixAreaEnable(string kodeGudang)
        {
            string lookupValue = LookupInfo.GetValue("FIX_AREA_ENABLE", kodeGudang);

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

            return(lookupValue == "1");
        }
Exemplo n.º 3
0
        public static bool CekBmkPos()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "POS_VALIDASI_BMK");

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

            return(lookupValue == "1");
        }
Exemplo n.º 4
0
        public static bool CekHpp11()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "HPP_DARI_11");

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

            return(lookupValue == "1");
        }
Exemplo n.º 5
0
        public static bool CekEditAccDo()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "EDIT_ACC_DO");

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

            return(lookupValue == "1");
        }
Exemplo n.º 6
0
        public static bool CekRekonHarian()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "REKON_HARIAN");

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

            return(lookupValue == "1");
        }
Exemplo n.º 7
0
        public static bool CekPrintSj()
        {
            string lookupValue = LookupInfo.GetValue("RULE_TOGGLE", "PRINT_SJ");

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

            return(lookupValue == "1");
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
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);
            }
        }