Exemplo n.º 1
0
        public int LogInsertar(LogBE be)
        {
            try
            {
                String sCadena = Utilities.GetConnectionStringSeguridad();

                String sqlLogInsertar;

                sqlLogInsertar = "uspi_TalLog";
                SqlParameter[] ArrSqlParameter = new SqlParameter[3];

                ArrSqlParameter[0] = new SqlParameter();
                ArrSqlParameter[0].ParameterName = "@Descripcion";
                ArrSqlParameter[0].SqlDbType     = SqlDbType.VarChar;
                ArrSqlParameter[0].Size          = 900;
                ArrSqlParameter[0].Value         = be.Descripcion;

                ArrSqlParameter[1] = new SqlParameter();
                ArrSqlParameter[1].ParameterName = "@UsuarioId";
                ArrSqlParameter[1].SqlDbType     = SqlDbType.Int;
                ArrSqlParameter[1].Value         = be.UsuarioId;



                SqlHelper.ExecuteNonQuery(sCadena, CommandType.StoredProcedure, sqlLogInsertar, ArrSqlParameter);



                return(1);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public int GuardarError(LogBE be)
        {
            LogBC bc = new LogBC();

            if (!Blindaje.InvalidString(be.Descripcion) && !Blindaje.InvalidString(be.Id.ToString()) && !Blindaje.InvalidString(be.UsuarioId.ToString()))
            {
                return(bc.LogInsertar(be));
            }
            else
            {
                return(-1);
            }
        }
Exemplo n.º 3
0
        public void SaveLog(string pintNodeId, string pintOrganizationId, string pintSystemUserId, LogEventType pEnuEventType, string pstrProcess, string pstrItem, Success pEnuSuccess, string pstrErrorMessage)
        {
            LogBE oLogBE = new LogBE();

            oLogBE.i_NodeLogId      = int.Parse(pintNodeId);
            oLogBE.i_SystemUserId   = pintSystemUserId == null ? (int?)null : int.Parse(pintSystemUserId);
            oLogBE.i_EventTypeId    = (int)pEnuEventType;
            oLogBE.v_ProcessEntity  = pstrProcess;
            oLogBE.v_ElementItem    = pstrItem;
            oLogBE.i_Success        = (int)pEnuSuccess;
            oLogBE.v_ErrorException = pstrErrorMessage;
            oLogBE.d_Date           = DateTime.Now;

            int intNodeId = int.Parse(pintNodeId);

            oLogBE.v_LogId = new Utils().GetPrimaryKey(intNodeId, 7, "LV");

            ctx.Log.Add(oLogBE);
            ctx.SaveChanges();
        }
Exemplo n.º 4
0
        public static void SaveLog(string pintNodeId, string pintOrganizationId, string pintSystemUserId, Enumeratores.LogEventType pEnuEventType, string pstrProcess, string pstrItem, Enumeratores.Success pEnuSuccess, string pstrErrorMessage)
        {
            using (var dbContext = new DatabaseContext())
            {
                LogBE objEntity = new LogBE();

                objEntity.i_NodeLogId      = int.Parse(pintNodeId);
                objEntity.i_SystemUserId   = pintSystemUserId == null ? (int?)null : int.Parse(pintSystemUserId);
                objEntity.i_EventTypeId    = (int)pEnuEventType;
                objEntity.v_ProcessEntity  = pstrProcess;
                objEntity.v_ElementItem    = pstrItem;
                objEntity.i_Success        = (int)pEnuSuccess;
                objEntity.v_ErrorException = pstrErrorMessage;
                objEntity.d_Date           = DateTime.Now;

                //Autogeneramos el Pk de la tabla
                int intNodeId = int.Parse(pintNodeId);
                objEntity.v_LogId = new Common.Utils().GetPrimaryKey(intNodeId, 7, "LV");

                dbContext.SaveChanges();
            }
        }
Exemplo n.º 5
0
        public int LogInsertar(LogBE be)
        {
            LogDALC dalc = new LogDALC();

            return(dalc.LogInsertar(be));
        }