Beispiel #1
0
        public void DeleteApplicationHierarchy(ref OperationResult pobjOperationResult, int pintApplicationHierarchyId, List <string> ClientSession)
        {
            //mon.IsActive = true;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                // Obtener la entidad fuente
                var objEntitySource = (from a in dbContext.applicationhierarchy
                                       where a.i_ApplicationHierarchyId == pintApplicationHierarchyId
                                       select a).FirstOrDefault();

                // Crear la entidad con los datos actualizados
                objEntitySource.d_UpdateDate   = DateTime.Now;
                objEntitySource.i_UpdateUserId = Int32.Parse(ClientSession[2]);
                objEntitySource.i_IsDeleted    = 1;

                // Guardar los cambios
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ELIMINACION, "APLICACIÓN JERÁRQUICA", "", 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.ELIMINACION, "APLICACIÓN JERÁRQUICA", "", Success.Failed, ex.Message);
                return;
            }
        }
Beispiel #2
0
        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;
            }
        }
Beispiel #3
0
        public string AddOrganization(ref OperationResult pobjOperationResult, organizationDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;
            string NewId = "(No generado)";

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();
                organization          objEntity = organizationAssembler.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 intNodeId = 9;
                NewId = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 5), "OO");
                objEntity.v_OrganizationId = NewId;


                dbContext.AddToorganization(objEntity);
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
                return(NewId);
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "ORGANIZACIÓN", "i_OrganizationId=" + NewId.ToString(), Success.Failed, pobjOperationResult.ExceptionMessage);
                return(null);
            }
        }
Beispiel #4
0
        public void AddDataHierarchy(ref OperationResult pobjOperationResult, datahierarchyDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();
                datahierarchy         objEntity = datahierarchyAssembler.ToEntity(pobjDtoEntity);


                objEntity.d_InsertDate   = DateTime.Now;
                objEntity.i_InsertUserId = Int32.Parse(ClientSession[2]);
                objEntity.i_IsDeleted    = 0;

                dbContext.AddTodatahierarchy(objEntity);
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "DATA HIERARCHY", "GroupId=" + objEntity.i_GroupId.ToString() + " / Descripción = " + objEntity.v_Value1, 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, "DATA HIERARCHY", "GroupId=" + pobjDtoEntity.i_GroupId.ToString() + " / Descripción = " + pobjDtoEntity.v_Value1, Success.Failed, ex.Message);
                return;
            }
        }
Beispiel #5
0
        public void DeleteSystemParameter(ref OperationResult pobjOperationResult, int pintGroupId, int pintParameterId, List <string> ClientSession)
        {
            //mon.IsActive = true;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                var objEntity = (from a in dbContext.systemparameter
                                 where a.i_GroupId == pintGroupId && a.i_ParameterId == pintParameterId
                                 select a).FirstOrDefault();

                if (objEntity != null)
                {
                    dbContext.DeleteObject(objEntity);
                    dbContext.SaveChanges();
                }

                pobjOperationResult.Success = 1;
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ELIMINACION, "PARÁMETRO", "GroupId=" + objEntity.i_GroupId.ToString() + " / Descripción = " + objEntity.v_Value1, 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.ELIMINACION, "PARÁMETRO", "", Success.Failed, ex.Message);
                return;
            }
        }
Beispiel #6
0
        public void AddSoftwareComponentRelease(ref OperationResult pobjOperationResult, softwarecomponentreleaseDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;
            try
            {
                SigesoftEntitiesModel    dbContext = new SigesoftEntitiesModel();
                softwarecomponentrelease objEntity = softwarecomponentreleaseAssembler.ToEntity(pobjDtoEntity);


                objEntity.d_InsertDate = DateTime.Now;

                dbContext.AddTosoftwarecomponentrelease(objEntity);
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "SOFTWARE COMPONENT RELEASE", "SoftwareComponentId=" + objEntity.i_SoftwareComponentId.ToString() + " / SoftwareComponentVersion = " + objEntity.v_SoftwareComponentVersion, 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, "SOFTWARE COMPONENT RELEASE", "SoftwareComponentId=" + pobjDtoEntity.i_SoftwareComponentId.ToString() + " / SoftwareComponentVersion = " + pobjDtoEntity.v_SoftwareComponentVersion, Success.Failed, ex.Message);
                return;
            }
        }
Beispiel #7
0
        public void AddDeploymentFile(ref OperationResult pobjOperationResult, deploymentfileDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;
            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();
                deploymentfile        objEntity = deploymentfileAssembler.ToEntity(pobjDtoEntity);


                dbContext.AddTodeploymentfile(objEntity);
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "DEPLOYMENT FILE", "DeploymentFileId=" + objEntity.i_DeploymentFileId.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, "DEPLOYMENT FILE", "DeploymentFileId=" + pobjDtoEntity.i_DeploymentFileId.ToString(), Success.Failed, ex.Message);
                return;
            }
        }
Beispiel #8
0
        public void AddProtocolSystemUser(ref OperationResult pobjOperationResult, List <protocolsystemuserDto> ListProtocolSystemUserDto, int?pintSystemUserId, List <string> ClientSession, bool pbRegisterLog)
        {
            int    SecuentialId = -1;
            string newId;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                foreach (var item in ListProtocolSystemUserDto)
                {
                    // Autogeneramos el Pk de la tabla
                    SecuentialId = Utils.GetNextSecuentialId(Int32.Parse(ClientSession[0]), 44);
                    newId        = Common.Utils.GetNewId(int.Parse(ClientSession[0]), SecuentialId, "PU");

                    // Grabar como nuevo
                    var objEntity = protocolsystemuserAssembler.ToEntity(item);

                    objEntity.v_ProtocolSystemUserId = newId;
                    if (pintSystemUserId == null)
                    {
                        objEntity.i_SystemUserId = item.i_SystemUserId;
                    }
                    else
                    {
                        objEntity.i_SystemUserId = pintSystemUserId.Value;
                    }
                    objEntity.d_InsertDate   = DateTime.Now;
                    objEntity.i_InsertUserId = Int32.Parse(ClientSession[2]);
                    objEntity.i_IsDeleted    = 0;
                    dbContext.AddToprotocolsystemuser(objEntity);
                }

                dbContext.SaveChanges();
                pobjOperationResult.Success = 1;

                if (pbRegisterLog == true)
                {
                    // Llenar entidad Log
                    LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION,
                                  "ProtocolSystemUser", null, Success.Ok, null);
                }

                return;
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION,
                              "ProtocolSystemUser", string.Empty, Success.Failed, pobjOperationResult.ExceptionMessage);
                return;
            }
        }
        public string[] AddMultimediaFileComponent(ref OperationResult pobjOperationResult, FileInfoDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;
            string[] IDs = new string[2];
            var      multimediaFileId             = string.Empty;
            var      serviceComponentMultimediaId = string.Empty;

            try
            {
                multimediafileDto multimediaFile = new multimediafileDto();
                multimediaFile.v_PersonId      = pobjDtoEntity.PersonId;
                multimediaFile.v_FileName      = pobjDtoEntity.FileName;
                multimediaFile.b_File          = pobjDtoEntity.ByteArrayFile;
                multimediaFile.b_ThumbnailFile = pobjDtoEntity.ThumbnailFile;

                // Grabar MultimediaFile
                multimediaFileId = AddMultimediaFile(ref pobjOperationResult, multimediaFile, ClientSession, SiNo.NO);
                if (pobjOperationResult.Success == 0)
                {
                    return(null);
                }

                servicecomponentmultimediaDto serviceComponentMultimedia = new servicecomponentmultimediaDto();
                serviceComponentMultimedia.v_ServiceComponentId = pobjDtoEntity.ServiceComponentId;
                serviceComponentMultimedia.v_MultimediaFileId   = multimediaFileId;
                serviceComponentMultimedia.v_Comment            = pobjDtoEntity.Description;

                // Grabar MultimediaFileComponent
                serviceComponentMultimediaId = AddServiceComponentMultimedia(ref pobjOperationResult, serviceComponentMultimedia, ClientSession, SiNo.NO);
                if (pobjOperationResult.Success == 0)
                {
                    return(null);
                }

                IDs[0] = multimediaFileId;
                IDs[1] = serviceComponentMultimediaId;

                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "MULTIMEDIA FILE", null, Success.Ok, null);
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "MULTIMEDIA FILE", null, Success.Failed, pobjOperationResult.ExceptionMessage);
            }

            return(IDs);
        }
        private void UpdateMultimediaFile(ref OperationResult pobjOperationResult, multimediafileDto pobjDtoEntity, List <string> ClientSession, SiNo ExecLog)
        {
            //mon.IsActive = true;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                // Obtener la entidad fuente
                var objEntitySource = (from a in dbContext.multimediafile
                                       where a.v_MultimediaFileId == pobjDtoEntity.v_MultimediaFileId
                                       select a).FirstOrDefault();

                // Crear la entidad con los datos actualizados
                objEntitySource.v_FileName = pobjDtoEntity.v_FileName;
                if (pobjDtoEntity.b_File != null)
                {
                    objEntitySource.b_File = pobjDtoEntity.b_File;
                }
                objEntitySource.b_ThumbnailFile = pobjDtoEntity.b_ThumbnailFile;
                objEntitySource.d_UpdateDate    = DateTime.Now;
                objEntitySource.i_UpdateUserId  = Int32.Parse(ClientSession[2]);

                // Guardar los cambios
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;

                if (ExecLog == SiNo.SI)
                {
                    // Llenar entidad Log
                    LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "MULTIMEDIA FILE", "v_MultimediaFileId=" + pobjDtoEntity.v_MultimediaFileId, Success.Ok, null);
                }
                return;
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "MULTIMEDIA FILE", "v_MultimediaFileId=" + pobjDtoEntity.v_MultimediaFileId, Success.Failed, pobjOperationResult.ExceptionMessage);
                return;
            }
        }
        public void UpdateMultimediaFileComponent(ref OperationResult pobjOperationResult, FileInfoDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;

            try
            {
                multimediafileDto multimediaFile = new multimediafileDto();
                multimediaFile.v_MultimediaFileId = pobjDtoEntity.MultimediaFileId;
                multimediaFile.v_FileName         = pobjDtoEntity.FileName;
                multimediaFile.b_File             = pobjDtoEntity.ByteArrayFile;
                multimediaFile.b_ThumbnailFile    = pobjDtoEntity.ThumbnailFile;

                // Actualizar MultimediaFile
                UpdateMultimediaFile(ref pobjOperationResult, multimediaFile, ClientSession, SiNo.NO);
                if (pobjOperationResult.Success == 0)
                {
                    return;
                }

                servicecomponentmultimediaDto serviceComponentMultimedia = new servicecomponentmultimediaDto();
                serviceComponentMultimedia.v_ServiceComponentMultimediaId = pobjDtoEntity.ServiceComponentMultimediaId;
                serviceComponentMultimedia.v_Comment = pobjDtoEntity.Description;

                // Actualizar MultimediaFileComponent
                UpdateServiceComponentMultimedia(ref pobjOperationResult, serviceComponentMultimedia, ClientSession, SiNo.NO);
                if (pobjOperationResult.Success == 0)
                {
                    return;
                }

                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "MULTIMEDIA FILE", null, Success.Ok, null);
                return;
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "MULTIMEDIA FILE", null, Success.Failed, pobjOperationResult.ExceptionMessage);

                return;
            }
        }
        private string AddServiceComponentMultimedia(ref OperationResult pobjOperationResult, servicecomponentmultimediaDto pobjDtoEntity, List <string> ClientSession, SiNo ExecLog)
        {
            //mon.IsActive = true;
            string NewId = "(No generado)";

            try
            {
                SigesoftEntitiesModel      dbContext = new SigesoftEntitiesModel();
                servicecomponentmultimedia objEntity = servicecomponentmultimediaAssembler.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 intNodeId = 9;// int.Parse(ClientSession[0]);
                NewId = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 46), "FC");
                objEntity.v_ServiceComponentMultimediaId = NewId;


                dbContext.AddToservicecomponentmultimedia(objEntity);
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;

                if (ExecLog == SiNo.SI)
                {
                    // Llenar entidad Log
                    LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "SERVICE COMPONENT MULTIMEDIA", "v_ServiceComponentMultimediaId=" + NewId.ToString(), Success.Ok, null);
                }
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);

                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "SERVICE COMPONENT MULTIMEDIA", "v_ServiceComponentMultimediaId=" + NewId.ToString(), Success.Failed, pobjOperationResult.ExceptionMessage);
            }

            return(NewId);
        }
Beispiel #13
0
        public void UpdateApplicationHierarchy(ref OperationResult pobjOperationResult, applicationhierarchyDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                // Obtener la entidad fuente
                var objEntitySource = (from a in dbContext.applicationhierarchy
                                       where a.i_ApplicationHierarchyId == pobjDtoEntity.i_ApplicationHierarchyId
                                       select a).FirstOrDefault();

                // Crear la entidad con los datos actualizados
                //pobjDtoEntity.i_ApplicationHierarchyId = pintApplicationHierarchyId;
                pobjDtoEntity.d_UpdateDate   = DateTime.Now;
                pobjDtoEntity.i_UpdateUserId = Int32.Parse(ClientSession[2]);
                applicationhierarchy objEntity = applicationhierarchyAssembler.ToEntity(pobjDtoEntity);

                // Copiar los valores desde la entidad actualizada a la Entidad Fuente
                dbContext.applicationhierarchy.ApplyCurrentValues(objEntity);

                // Guardar los cambios
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "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.ACTUALIZACION, "APLICACIÓN JERÁRQUICA", "i_ApplicationHierarchyId=" + pobjDtoEntity.i_ApplicationHierarchyId.ToString(), Success.Failed, ex.Message);
                return;
            }
        }
Beispiel #14
0
        public void UpdateOrganization(ref OperationResult pobjOperationResult, organizationDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                // Obtener la entidad fuente
                var objEntitySource = (from a in dbContext.organization
                                       where a.v_OrganizationId == pobjDtoEntity.v_OrganizationId
                                       select a).FirstOrDefault();

                // Crear la entidad con los datos actualizados
                pobjDtoEntity.d_UpdateDate   = DateTime.Now;
                pobjDtoEntity.i_IsDeleted    = 0;
                pobjDtoEntity.i_UpdateUserId = Int32.Parse(ClientSession[2]);
                organization objEntity = organizationAssembler.ToEntity(pobjDtoEntity);

                // Copiar los valores desde la entidad actualizada a la Entidad Fuente
                dbContext.organization.ApplyCurrentValues(objEntity);

                // Guardar los cambios
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "ORGANIZACIÓN", "i_OrganizationId=" + objEntity.v_OrganizationId.ToString(), Success.Ok, null);
                return;
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "ORGANIZACIÓN", "i_OrganizationId=" + pobjDtoEntity.v_OrganizationId.ToString(), Success.Failed, pobjOperationResult.ExceptionMessage);
                return;
            }
        }
Beispiel #15
0
        public void UpdateSystemParameter(ref OperationResult pobjOperationResult, systemparameterDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                // Obtener la entidad fuente
                var objEntitySource = (from a in dbContext.systemparameter
                                       where a.i_GroupId == pobjDtoEntity.i_GroupId && a.i_ParameterId == pobjDtoEntity.i_ParameterId
                                       select a).FirstOrDefault();

                // Crear la entidad con los datos actualizados
                pobjDtoEntity.d_UpdateDate   = DateTime.Now;
                pobjDtoEntity.i_UpdateUserId = Int32.Parse(ClientSession[2]);
                systemparameter objEntity = systemparameterAssembler.ToEntity(pobjDtoEntity);

                // Copiar los valores desde la entidad actualizada a la Entidad Fuente
                dbContext.systemparameter.ApplyCurrentValues(objEntity);

                // Guardar los cambios
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;

                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "PARÁMETRO", "GroupId=" + objEntity.i_GroupId.ToString() + " / Descripción = " + objEntity.v_Value1, 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.ACTUALIZACION, "PARÁMETRO", "GroupId=" + pobjDtoEntity.i_GroupId.ToString() + " / Descripción = " + pobjDtoEntity.v_Value1, Success.Failed, ex.Message);
                return;
            }
        }
Beispiel #16
0
        public void UpdateSoftwareComponentRelease(ref OperationResult pobjOperationResult, softwarecomponentreleaseDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;
            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                // Obtener la entidad fuente
                var objEntitySource = (from a in dbContext.softwarecomponentrelease
                                       where a.i_SoftwareComponentId == pobjDtoEntity.i_SoftwareComponentId && a.v_SoftwareComponentVersion == pobjDtoEntity.v_SoftwareComponentVersion
                                       select a).FirstOrDefault();

                // Crear la entidad con los datos actualizados
                pobjDtoEntity.d_UpdateDate = DateTime.Now;
                softwarecomponentrelease objEntity = softwarecomponentreleaseAssembler.ToEntity(pobjDtoEntity);

                // Copiar los valores desde la entidad actualizada a la Entidad Fuente
                dbContext.softwarecomponentrelease.ApplyCurrentValues(objEntity);

                // Guardar los cambios
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;

                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "SOFTWARE COMPONENT RELEASE", "SoftwareComponentId=" + objEntity.i_SoftwareComponentId.ToString() + " / SoftwareComponentVersion = " + objEntity.v_SoftwareComponentVersion, 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.ACTUALIZACION, "SOFTWARE COMPONENT RELEASE", "SoftwareComponentId=" + pobjDtoEntity.i_SoftwareComponentId.ToString() + " / SoftwareComponentVersion = " + pobjDtoEntity.v_SoftwareComponentVersion, Success.Failed, ex.Message);
                return;
            }
        }