/// <summary> /// Retorna un LISTA de registros de la Entidad Presupuesto.Gasto /// En la BASE de DATO la Tabla : [Presupuesto.Gasto] /// <summary> /// <param name="pFiltro"></param> /// <returns></returns> public List <GastoEntity> Listar(Parametro pFiltro) { List <GastoEntity> lstGastoEntity = new List <GastoEntity>(); try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_Gasto(pFiltro.codGasto, pFiltro.codPlantillaDeta, pFiltro.codArea, pFiltro.numAnio); foreach (var item in resul) { GastoEntity objGastoEntity = new GastoEntity(); objGastoEntity.Codigo = item.codGasto; objGastoEntity.codPlantillaDeta = item.codPlantillaDeta; objGastoEntity.monTotal = item.monTotal; objGastoEntity.cntCantidad = item.cntCantidad; objGastoEntity.numDocumento = item.numDocumento; objGastoEntity.gloObservacion = item.gloObservacion; objGastoEntity.fecGasto = item.fecGasto; objGastoEntity.codEmpleadoResp = item.codEmpleadoResp; objGastoEntity.objEmpleadoResp.desNombre = item.codEmpleadoRespNombre; objGastoEntity.segUsuarioEdita = item.segUsuarioEdita; objGastoEntity.segFechaEdita = item.segFechaCrea; objGastoEntity.segUsuarioEdita = item.segUsuarioEdita; objGastoEntity.segFechaEdita = item.segFechaCrea; objGastoEntity.segMaquinaOrigen = item.segMaquinaOrigen; objGastoEntity.objEmpleadoResp.codArea = item.codArea.HasValue ? item.codArea.Value : 0; objGastoEntity.objEmpleadoResp.objArea.desNombre = item.codAreaNombre; objGastoEntity.objPlantillaDeta.objPlantilla.codPresupuesto = item.codPresupuesto.HasValue ? item.codPresupuesto.Value : 0; objGastoEntity.objPlantillaDeta.objPlantilla.objPresupuesto.desNombre = item.codPresupuestoNombre; lstGastoEntity.Add(objGastoEntity); } } } catch (Exception ex) { log.Error(String.Concat("Listar", " | ", ex.Message.ToString())); throw ex; } return(lstGastoEntity); }
/// <summary> /// Retorna un LISTA de registros de la Entidad Presupuesto.Gasto /// En la BASE de DATO la Tabla : [Presupuesto.Gasto] /// <summary> /// <param name="pFiltro"></param> /// <returns></returns> public List<GastoEntity> Listar(Parametro pFiltro) { List<GastoEntity> lstGastoEntity = new List<GastoEntity>(); try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_Gasto(pFiltro.codGasto, pFiltro.codPlantillaDeta, pFiltro.codArea, pFiltro.numAnio); foreach (var item in resul) { GastoEntity objGastoEntity = new GastoEntity(); objGastoEntity.Codigo = item.codGasto; objGastoEntity.codPlantillaDeta = item.codPlantillaDeta; objGastoEntity.monTotal = item.monTotal; objGastoEntity.cntCantidad = item.cntCantidad; objGastoEntity.numDocumento = item.numDocumento; objGastoEntity.gloObservacion = item.gloObservacion; objGastoEntity.fecGasto = item.fecGasto; objGastoEntity.codEmpleadoResp = item.codEmpleadoResp; objGastoEntity.objEmpleadoResp.desNombre = item.codEmpleadoRespNombre; objGastoEntity.segUsuarioEdita = item.segUsuarioEdita; objGastoEntity.segFechaEdita = item.segFechaCrea; objGastoEntity.segUsuarioEdita = item.segUsuarioEdita; objGastoEntity.segFechaEdita = item.segFechaCrea; objGastoEntity.segMaquinaOrigen = item.segMaquinaOrigen; objGastoEntity.objEmpleadoResp.codArea = item.codArea.HasValue ? item.codArea.Value : 0; objGastoEntity.objEmpleadoResp.objArea.desNombre = item.codAreaNombre; objGastoEntity.objPlantillaDeta.objPlantilla.codPresupuesto = item.codPresupuesto.HasValue ? item.codPresupuesto.Value : 0; objGastoEntity.objPlantillaDeta.objPlantilla.objPresupuesto.desNombre = item.codPresupuestoNombre; lstGastoEntity.Add(objGastoEntity); } } } catch (Exception ex) { log.Error(String.Concat("Listar", " | ", ex.Message.ToString())); throw ex; } return lstGastoEntity; }
/// <summary> /// Retorna una ENTIDAD de registro de la Entidad Presupuesto.Gasto /// En la BASE de DATO la Tabla : [Presupuesto.Gasto] /// <summary> /// <param name="pcodGasto"></param> /// <returns></returns> public GastoEntity Buscar(int pcodGasto) { GastoEntity objGastoEntity = null; try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_Gasto(pcodGasto, null, null, null); foreach (var item in resul) { objGastoEntity = new GastoEntity(); objGastoEntity.Codigo = item.codGasto; objGastoEntity.codPlantillaDeta = item.codPlantillaDeta; objGastoEntity.monTotal = item.monTotal; objGastoEntity.cntCantidad = item.cntCantidad; objGastoEntity.numDocumento = item.numDocumento; objGastoEntity.gloObservacion = item.gloObservacion; objGastoEntity.fecGasto = item.fecGasto; objGastoEntity.codEmpleadoResp = item.codEmpleadoResp; objGastoEntity.objEmpleadoResp.desNombre = item.codEmpleadoRespNombre; objGastoEntity.segUsuarioEdita = item.segUsuarioEdita; objGastoEntity.segFechaEdita = item.segFechaCrea; objGastoEntity.segUsuarioEdita = item.segUsuarioEdita; objGastoEntity.segFechaEdita = item.segFechaCrea; objGastoEntity.segMaquinaOrigen = item.segMaquinaOrigen; } } } catch (Exception ex) { log.Error(String.Concat("Buscar", " | ", ex.Message.ToString())); throw ex; } return(objGastoEntity); }
/// <summary> /// Retorna una ENTIDAD de registro de la Entidad Presupuesto.Gasto /// En la BASE de DATO la Tabla : [Presupuesto.Gasto] /// <summary> /// <param name="pcodGasto"></param> /// <returns></returns> public GastoEntity Buscar(int pcodGasto) { GastoEntity objGastoEntity = null; try { using (_DBMLPresupuestoDataContext SQLDC = new _DBMLPresupuestoDataContext(conexion)) { var resul = SQLDC.pa_S_Gasto(pcodGasto, null, null, null); foreach (var item in resul) { objGastoEntity = new GastoEntity(); objGastoEntity.Codigo = item.codGasto; objGastoEntity.codPlantillaDeta = item.codPlantillaDeta; objGastoEntity.monTotal = item.monTotal; objGastoEntity.cntCantidad = item.cntCantidad; objGastoEntity.numDocumento = item.numDocumento; objGastoEntity.gloObservacion = item.gloObservacion; objGastoEntity.fecGasto = item.fecGasto; objGastoEntity.codEmpleadoResp = item.codEmpleadoResp; objGastoEntity.objEmpleadoResp.desNombre = item.codEmpleadoRespNombre; objGastoEntity.segUsuarioEdita = item.segUsuarioEdita; objGastoEntity.segFechaEdita = item.segFechaCrea; objGastoEntity.segUsuarioEdita = item.segUsuarioEdita; objGastoEntity.segFechaEdita = item.segFechaCrea; objGastoEntity.segMaquinaOrigen = item.segMaquinaOrigen; } } } catch (Exception ex) { log.Error(String.Concat("Buscar", " | ", ex.Message.ToString())); throw ex; } return objGastoEntity; }