/// <summary> /// Retorna un LISTA de registros de la Entidad Presupuesto.PlantillaDeta /// En la BASE de DATO la Tabla : [Presupuesto.PlantillaDeta] /// <summary> /// <returns>List</returns> public List <PlantillaDetaEntity> Listar(Parametro pFiltro) { List <PlantillaDetaEntity> lstPlantillaDetaEntity = new List <PlantillaDetaEntity>(); try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_PlantillaDeta(pFiltro.codPlantillaDeta, pFiltro.numAnio, pFiltro.codArea, pFiltro.codRegEstado); foreach (var item in resul) { PlantillaDetaEntity objPlantillaDetaEntity = new PlantillaDetaEntity(); objPlantillaDetaEntity.Codigo = item.codPlantillaDeta; objPlantillaDetaEntity.codPlantilla = item.codPlantilla; objPlantillaDetaEntity.codEmpleadoAprueba = item.codEmpleadoAprueba.HasValue ? item.codEmpleadoAprueba.Value : 0; objPlantillaDetaEntity.gloDescripcion = item.gloDescripcion; objPlantillaDetaEntity.monEstimado = item.monEstimado; objPlantillaDetaEntity.cntCantidad = item.cntCantidad; objPlantillaDetaEntity.codRegEstado = item.codRegEstado; objPlantillaDetaEntity.fecEjecucion = item.fecEjecucion; objPlantillaDetaEntity.codPartida = item.codPartida; objPlantillaDetaEntity.numPartida = item.numPartida; objPlantillaDetaEntity.objEmpleadoAprueba.desNombre = item.codEmpleadoApruebaNombre; objPlantillaDetaEntity.codEmpleadoRespon = item.codEmpleadoRespon.HasValue?item.codEmpleadoRespon.Value:0; objPlantillaDetaEntity.objPlantilla.Codigo = item.codEmpleadoRespon.HasValue?item.codEmpleadoRespon.Value:0; objPlantillaDetaEntity.objPlantilla.objEmpleado.desNombre = item.codEmpleadoResponRespon; objPlantillaDetaEntity.objPartida.desNombre = item.codPartidaNombre; objPlantillaDetaEntity.indPlantilla = item.indPlantillaTipo; objPlantillaDetaEntity.codRegEstadoNombre = item.codRegEstadoNombre; objPlantillaDetaEntity.objPlantilla.codArea = item.codArea; objPlantillaDetaEntity.objPlantilla.objArea.desNombre = item.codAreaNombre; objPlantillaDetaEntity.segUsuarioCrea = item.segUsuarioCrea; objPlantillaDetaEntity.segFechaCrea = item.segFechaCrea; objPlantillaDetaEntity.segUsuarioEdita = item.segUsuarioEdita; objPlantillaDetaEntity.segFechaEdita = item.segFechaEdita; objPlantillaDetaEntity.segMaquinaOrigen = item.segMaquinaOrigen; lstPlantillaDetaEntity.Add(objPlantillaDetaEntity); } } } catch (Exception ex) { log.Error(String.Concat("Listar", " | ", ex.Message.ToString())); throw ex; } return(lstPlantillaDetaEntity); }
/// <summary> /// Retorna un LISTA de registros de la Entidad Presupuesto.PlantillaDeta /// En la BASE de DATO la Tabla : [Presupuesto.PlantillaDeta] /// <summary> /// <returns>List</returns> public List <PlantillaDetaEntityDTO> Listar(Parametro pFiltro) { List <PlantillaDetaEntityDTO> lstPlantillaDetaEntityDTO = new List <PlantillaDetaEntityDTO>(); try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_PlantillaDeta(pFiltro.codPlantillaDeta, pFiltro.numAnio, pFiltro.codArea, pFiltro.codRegEstado); foreach (var item in resul) { lstPlantillaDetaEntityDTO.Add(new PlantillaDetaEntityDTO() { codPlantillaDeta = item.codPlantillaDeta, codPlantilla = item.codPlantilla, codEmpleadoAprueba = item.codEmpleadoAprueba.HasValue ? item.codEmpleadoAprueba.Value : 0, gloDescripcion = item.gloDescripcion, monEstimado = Convert.ToDecimal(item.monEstimado), cntCantidad = Convert.ToDecimal(item.cntCantidad), codRegEstado = item.codRegEstado, fecEjecucion = item.fecEjecucion.HasValue ? item.fecEjecucion.Value.ToShortDateString() : string.Empty, indPlantilla = item.indPlantilla, codPartida = item.codPartida, numPartida = item.numPartida, segMaquinaOrigen = item.segMaquinaOrigen, codEmpleadoApruebaNombre = item.codEmpleadoApruebaNombre, codEmpleadoResponNombre = item.codEmpleadoResponRespon, codEmpleadoRespon = item.codEmpleadoRespon, codPartidaNombre = item.codPartidaNombre, indPlantillaNombre = item.indPlantillaTipo, codRegEstadoNombre = item.codRegEstadoNombre, codArea = item.codArea, codAreaNombre = item.codAreaNombre, segUsuarioEdita = string.IsNullOrEmpty(item.segUsuarioEdita) ? item.segUsuarioCrea : item.segUsuarioEdita, segFechaEdita = item.segFechaEdita.HasValue ? item.segFechaEdita.Value.ToString() : item.segFechaCrea.ToString(), }); } } } catch (Exception ex) { throw ex; } return(lstPlantillaDetaEntityDTO); }
/// <summary> /// Retorna un LISTA de registros de la Entidad Presupuesto.PlantillaDeta /// En la BASE de DATO la Tabla : [Presupuesto.PlantillaDeta] /// <summary> /// <returns>List</returns> public List<PlantillaDetaEntity> Listar(Parametro pFiltro) { List<PlantillaDetaEntity> lstPlantillaDetaEntity = new List<PlantillaDetaEntity>(); try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_PlantillaDeta(pFiltro.codPlantillaDeta, pFiltro.numAnio, pFiltro.codArea, pFiltro.codRegEstado); foreach (var item in resul) { PlantillaDetaEntity objPlantillaDetaEntity= new PlantillaDetaEntity(); objPlantillaDetaEntity.Codigo = item.codPlantillaDeta; objPlantillaDetaEntity.codPlantilla = item.codPlantilla; objPlantillaDetaEntity.codEmpleadoAprueba = item.codEmpleadoAprueba.HasValue ? item.codEmpleadoAprueba.Value : 0; objPlantillaDetaEntity.gloDescripcion = item.gloDescripcion; objPlantillaDetaEntity.monEstimado = item.monEstimado; objPlantillaDetaEntity.cntCantidad = item.cntCantidad; objPlantillaDetaEntity.codRegEstado = item.codRegEstado; objPlantillaDetaEntity.fecEjecucion = item.fecEjecucion; objPlantillaDetaEntity.codPartida = item.codPartida; objPlantillaDetaEntity.numPartida = item.numPartida; objPlantillaDetaEntity.objEmpleadoAprueba.desNombre = item.codEmpleadoApruebaNombre; objPlantillaDetaEntity.codEmpleadoRespon = item.codEmpleadoRespon.HasValue?item.codEmpleadoRespon.Value:0; objPlantillaDetaEntity.objPlantilla.Codigo = item.codEmpleadoRespon.HasValue?item.codEmpleadoRespon.Value:0; objPlantillaDetaEntity.objPlantilla.objEmpleado.desNombre = item.codEmpleadoResponRespon; objPlantillaDetaEntity.objPartida.desNombre = item.codPartidaNombre; objPlantillaDetaEntity.indPlantilla = item.indPlantillaTipo; objPlantillaDetaEntity.codRegEstadoNombre = item.codRegEstadoNombre; objPlantillaDetaEntity.objPlantilla.codArea = item.codArea; objPlantillaDetaEntity.objPlantilla.objArea.desNombre = item.codAreaNombre; objPlantillaDetaEntity.segUsuarioCrea = item.segUsuarioCrea; objPlantillaDetaEntity.segFechaCrea = item.segFechaCrea; objPlantillaDetaEntity.segUsuarioEdita = item.segUsuarioEdita; objPlantillaDetaEntity.segFechaEdita = item.segFechaEdita; objPlantillaDetaEntity.segMaquinaOrigen = item.segMaquinaOrigen; lstPlantillaDetaEntity.Add(objPlantillaDetaEntity); } } } catch (Exception ex) { log.Error(String.Concat("Listar", " | ", ex.Message.ToString())); throw ex; } return lstPlantillaDetaEntity; }
/// <summary> /// Retorna un LISTA de registros de la Entidad Presupuesto.PlantillaDeta /// En la BASE de DATO la Tabla : [Presupuesto.PlantillaDeta] /// <summary> /// <returns>List</returns> public List<PlantillaDetaEntityDTO> Listar(Parametro pFiltro) { List<PlantillaDetaEntityDTO> lstPlantillaDetaEntityDTO = new List<PlantillaDetaEntityDTO>(); try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_PlantillaDeta(pFiltro.codPlantillaDeta, pFiltro.numAnio, pFiltro.codArea, pFiltro.codRegEstado); foreach (var item in resul) { lstPlantillaDetaEntityDTO.Add(new PlantillaDetaEntityDTO() { codPlantillaDeta = item.codPlantillaDeta, codPlantilla = item.codPlantilla, codEmpleadoAprueba = item.codEmpleadoAprueba.HasValue ? item.codEmpleadoAprueba.Value : 0, gloDescripcion = item.gloDescripcion, monEstimado = Convert.ToDecimal(item.monEstimado), cntCantidad = Convert.ToDecimal(item.cntCantidad), codRegEstado = item.codRegEstado, fecEjecucion = item.fecEjecucion.HasValue ? item.fecEjecucion.Value.ToShortDateString() : string.Empty, indPlantilla = item.indPlantilla, codPartida = item.codPartida, numPartida = item.numPartida, segMaquinaOrigen = item.segMaquinaOrigen, codEmpleadoApruebaNombre = item.codEmpleadoApruebaNombre, codEmpleadoResponNombre = item.codEmpleadoResponRespon, codEmpleadoRespon = item.codEmpleadoRespon, codPartidaNombre = item.codPartidaNombre, indPlantillaNombre = item.indPlantillaTipo, codRegEstadoNombre = item.codRegEstadoNombre, codArea = item.codArea, codAreaNombre = item.codAreaNombre, segUsuarioEdita = string.IsNullOrEmpty(item.segUsuarioEdita) ? item.segUsuarioCrea : item.segUsuarioEdita, segFechaEdita = item.segFechaEdita.HasValue ? item.segFechaEdita.Value.ToString() : item.segFechaCrea.ToString(), }); } } } catch (Exception ex) { throw ex; } return lstPlantillaDetaEntityDTO; }
/// <summary> /// Retorna una ENTIDAD de registro de la Entidad Presupuesto.PlantillaDeta /// En la BASE de DATO la Tabla : [Presupuesto.PlantillaDeta] /// <summary> /// <returns>Entidad</returns> public PlantillaDetaEntityDTO Buscar(int pId) { PlantillaDetaEntityDTO objPlantillaDetaEntityDTO = new PlantillaDetaEntityDTO(); try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_PlantillaDeta(pId, null, null, null); foreach (var item in resul) { objPlantillaDetaEntityDTO = new PlantillaDetaEntityDTO() { codPlantillaDeta = item.codPlantillaDeta, codPlantilla = item.codPlantilla, codEmpleadoAprueba = item.codEmpleadoAprueba.HasValue ? item.codEmpleadoAprueba.Value : 0, gloDescripcion = item.gloDescripcion, monEstimado = Convert.ToDecimal(item.monEstimado), cntCantidad = Convert.ToDecimal(item.cntCantidad), codRegEstado = item.codRegEstado, fecEjecucion = item.fecEjecucion.HasValue ? item.fecEjecucion.Value.ToString() : string.Empty, indPlantilla = item.indPlantilla, codPartida = item.codPartida, numPartida = item.numPartida, segUsuarioCrea = item.segUsuarioCrea, segUsuarioEdita = item.segUsuarioEdita, segFechaCrea = item.segFechaCrea.ToString(), segFechaEdita = item.segFechaEdita.HasValue ? item.segFechaEdita.Value.ToString() : string.Empty, segMaquinaOrigen = item.segMaquinaOrigen, codEmpleadoApruebaNombre = item.codEmpleadoApruebaNombre, codEmpleadoResponNombre = item.codEmpleadoResponRespon, codEmpleadoRespon = item.codEmpleadoRespon, codPartidaNombre = item.codPartidaNombre, indPlantillaNombre = item.indPlantillaTipo, codRegEstadoNombre = item.codRegEstadoNombre }; } } } catch (Exception ex) { throw ex; } return(objPlantillaDetaEntityDTO); }
/// <summary> /// Retorna una ENTIDAD de registro de la Entidad Presupuesto.PlantillaDeta /// En la BASE de DATO la Tabla : [Presupuesto.PlantillaDeta] /// <summary> /// <returns>Entidad</returns> public PlantillaDetaEntityDTO Buscar(int pId) { PlantillaDetaEntityDTO objPlantillaDetaEntityDTO = new PlantillaDetaEntityDTO(); try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_PlantillaDeta(pId,null,null,null); foreach (var item in resul) { objPlantillaDetaEntityDTO = new PlantillaDetaEntityDTO() { codPlantillaDeta = item.codPlantillaDeta, codPlantilla = item.codPlantilla, codEmpleadoAprueba = item.codEmpleadoAprueba.HasValue ? item.codEmpleadoAprueba.Value : 0, gloDescripcion = item.gloDescripcion, monEstimado = Convert.ToDecimal(item.monEstimado), cntCantidad = Convert.ToDecimal(item.cntCantidad), codRegEstado = item.codRegEstado, fecEjecucion = item.fecEjecucion.HasValue ? item.fecEjecucion.Value.ToString() : string.Empty, indPlantilla = item.indPlantilla, codPartida = item.codPartida, numPartida = item.numPartida, segUsuarioCrea = item.segUsuarioCrea, segUsuarioEdita = item.segUsuarioEdita, segFechaCrea = item.segFechaCrea.ToString(), segFechaEdita = item.segFechaEdita.HasValue ? item.segFechaEdita.Value.ToString() : string.Empty, segMaquinaOrigen = item.segMaquinaOrigen, codEmpleadoApruebaNombre = item.codEmpleadoApruebaNombre, codEmpleadoResponNombre = item.codEmpleadoResponRespon, codEmpleadoRespon = item.codEmpleadoRespon, codPartidaNombre = item.codPartidaNombre, indPlantillaNombre = item.indPlantillaTipo, codRegEstadoNombre = item.codRegEstadoNombre }; } } } catch (Exception ex) { throw ex; } return objPlantillaDetaEntityDTO; }