Exemplo n.º 1
0
        public int insert(LoginLog loginLog, MySqlConnection conn)
        {
            conn.Open();
            MySqlCommand cmd = new MySqlCommand("INSERT INTO `employee_login_log`(`Employee_ID`, `Success`, `Password_Incorrect`, `Locked`, `Unlocked_By`, `Ac_Status_Temp_Lock`, `Time`) VALUES (@accountID,@success,@passwordIncorrect,@locked,@unlockedBy,@acStatusTempLock,@time)", conn);

            cmd.Parameters.AddWithValue("@accountID", loginLog.getAccountID());
            cmd.Parameters.AddWithValue("@success", loginLog.getSuccess());
            cmd.Parameters.AddWithValue("@passwordIncorrect", loginLog.getPasswordIncorrect());
            cmd.Parameters.AddWithValue("@locked", loginLog.getLocked());
            cmd.Parameters.AddWithValue("@unlockedBy", loginLog.getUnlockedByEmpID());
            cmd.Parameters.AddWithValue("@acStatusTempLock", loginLog.getAcStatusTempLock());
            cmd.Parameters.AddWithValue("@time", loginLog.getTime().ToString("yyyy-MM-dd HH:mm:ss"));
            cmd.Prepare();
            int i = cmd.ExecuteNonQuery();

            conn.Close();
            return(i);
        }
Exemplo n.º 2
0
        public int insert(LoginLog loginLog, MySqlConnection conn)
        {
            conn.Open();
            MySqlCommand cmd = new MySqlCommand("INSERT INTO `customer_login_log`(`Customer_ID`, `Success`, `Password_Incorrect`, `Locked`, `Ac_Status_Temp_Lock`, `Ac_Status_Non_Active`, `Time`, `Unlocked_By`, `OS`, `Browser`, `IP`) VALUES (@accountID,@success,@passwordIncorrect,@locked,@acStatusTempLock,@acStatusTempNonActive,@time,@unlockedBy,@os,@browser,@ip)", conn);

            cmd.Parameters.AddWithValue("@accountID", loginLog.getAccountID());
            cmd.Parameters.AddWithValue("@success", loginLog.getSuccess());
            cmd.Parameters.AddWithValue("@passwordIncorrect", loginLog.getPasswordIncorrect());
            cmd.Parameters.AddWithValue("@locked", loginLog.getLocked());
            cmd.Parameters.AddWithValue("@acStatusTempLock", loginLog.getAcStatusTempLock());
            cmd.Parameters.AddWithValue("@acStatusTempNonActive", loginLog.getAcStatusNonActive());
            cmd.Parameters.AddWithValue("@time", loginLog.getTime());
            cmd.Parameters.AddWithValue("@unlockedBy", loginLog.getUnlockedByEmpID());
            cmd.Parameters.AddWithValue("@os", loginLog.getOs());
            cmd.Parameters.AddWithValue("@browser", loginLog.getBrowser());
            cmd.Parameters.AddWithValue("@ip", loginLog.getIp());
            cmd.Prepare();
            int i = cmd.ExecuteNonQuery();

            conn.Close();
            return(i);
        }