Exemplo n.º 1
0
        public void LogUserSessionRecord(typeModulo Modulo, typeUserActions UserAction, int iduser, string description)
        {
            string        qryIns     = "INSERT INTO UserSessionRecords(userID,moduleID,useractionID,timestamp,description) VALUES (@userID,@moduleID, @useractionID, @timestamp, @description)";
            SqlConnection conGaribay = new SqlConnection(myConfig.ConnectionInfo);
            SqlCommand    cmdIns     = new SqlCommand(qryIns, conGaribay);

            try
            {
                cmdIns.Parameters.Add("@userID", SqlDbType.Int).Value         = iduser;
                cmdIns.Parameters.Add("@moduleID", SqlDbType.Int).Value       = (int)Modulo;
                cmdIns.Parameters.Add("@useractionID", SqlDbType.Int).Value   = (int)UserAction;
                cmdIns.Parameters.Add("@timestamp", SqlDbType.DateTime).Value = Utils.getNowFormattedDate();
                cmdIns.Parameters.Add("@description", SqlDbType.Text).Value   = description;
                conGaribay.Open();
                int numregistros = cmdIns.ExecuteNonQuery();
                if (numregistros != 1)
                {
                    throw new Exception(myConfig.StrFromMessages("LOGGERACTIONFAILED"));
                }
            }
            catch (Exception err3)
            {
                this.LogMessage(Logger.typeLogMessage.CRITICAL, UserAction, iduser, err3.Message, "Error enviado desde LogUserSessionRecords");
            }
            finally
            {
                conGaribay.Close();
            }
        }
Exemplo n.º 2
0
 public void LogUserSessionRecord(typeModulo Modulo, typeUserActions UserAction, string description)
 {
     LogUserSessionRecord(Modulo, UserAction, new BasePage().UserID, description);
 }