public static bool CekAccSO(string userId)
        {
            string lookupValue = LookupInfo.GetValue("ACC_SO", userId);

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

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

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

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

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

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

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

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

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

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

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

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

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

            return(lookupValue == "1");
        }
Exemple #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);
        }
Exemple #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);
            }
        }