Exemplo n.º 1
0
        public static void SaveLog(string pintNodeId, string pintOrganizationId, string pintSystemUserId, LogEventType pEnuEventType, string pstrProcess, string pstrItem, Success pEnuSuccess, string pstrErrorMessage)
        {
            SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();
            log objEntity = new log();

            objEntity.i_NodeLogId = int.Parse(pintNodeId);
            //pintOrganizationId == null ? (int?)null : int.Parse(pintOrganizationId);
            //objEntity.v_OrganizationId = pintOrganizationId;
            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 = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 7), "LV");;
            dbContext.AddTolog(objEntity);
            dbContext.SaveChanges();
        }