Exemple #1
0
        public void AddOrdenReportes(ref OperationResult pobjOperationResult, List <ordenreporteDto> pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;
            string NewId = "(No generado)";

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                foreach (var item in pobjDtoEntity)
                {
                    ordenreporte objEntity = ordenreporteAssembler.ToEntity(item);
                    // Autogeneramos el Pk de la tabla
                    int intNodeId = int.Parse(ClientSession[0]);
                    NewId = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 210), "OZ");
                    objEntity.v_OrdenReporteId = NewId;
                    dbContext.AddToordenreporte(objEntity);
                }

                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
            }
        }