public void AddApplicationHierarchy(ref OperationResult pobjOperationResult, applicationhierarchyDto pobjDtoEntity, List <string> ClientSession) { //mon.IsActive = true; try { SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel(); applicationhierarchy objEntity = applicationhierarchyAssembler.ToEntity(pobjDtoEntity); objEntity.d_InsertDate = DateTime.Now; objEntity.i_InsertUserId = Int32.Parse(ClientSession[2]); objEntity.i_IsDeleted = 0; //// Autogeneramos el Pk de la tabla int SecuentialId = Utils.GetNextSecuentialId(int.Parse(ClientSession[0].ToString()), 1); objEntity.i_ApplicationHierarchyId = SecuentialId; dbContext.AddToapplicationhierarchy(objEntity); dbContext.SaveChanges(); pobjOperationResult.Success = 1; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "APLICACIÓN JERÁRQUICA", "i_ApplicationHierarchyId=" + objEntity.i_ApplicationHierarchyId.ToString(), Success.Ok, null); return; } catch (Exception ex) { pobjOperationResult.Success = 0; pobjOperationResult.ExceptionMessage = ex.Message; // Llenar entidad Log LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "APLICACIÓN JERÁRQUICA", "i_ApplicationHierarchyId=" + pobjDtoEntity.i_ApplicationHierarchyId.ToString(), Success.Failed, ex.Message); return; } }