public virtual PlanillaDetalle GetFromReader(IDataReader reader) { PlanillaDetalle p = new PlanillaDetalle(); p.Id = int.Parse(reader["IdPlanillaDetalle"].ToString()); p.Planilla = new Planilla() { Id = int.Parse(reader["IdPlanilla"].ToString()) }; p.Persona = new Persona() { Id = int.Parse(reader["IdPersona"].ToString()) }; p.CentroCosto = reader["IdCentroCosto"] != DBNull.Value ? new CentroCosto() { Id = int.Parse(reader["IdCentroCosto"].ToString()) } : null; p.RelacionActividad = reader["IdRelacion"] != DBNull.Value ? new OrdenProduccionActividad() { Id = int.Parse(reader["IdRelacion"].ToString()), Actividad = new Actividad(), OrdenProduccion = new OrdenProduccion() } : null; p.Novedad = new Novedad() { Id = int.Parse(reader["IdNovedad"].ToString()) }; p.Inicio = TimeSpan.Parse(reader["FeInicio"].ToString()); p.Fin = TimeSpan.Parse(reader["FeFin"].ToString()); p.EstaActivo = bool.Parse(reader["FlActivo"].ToString()); return(p); }
public override bool Actualizar(PlanillaDetalle planillaDetalle) { using (SqlConnection cn = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("pa_Actualizar_PlanillaDetalle", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@IdPlanillaDetalle", SqlDbType.Int).Value = planillaDetalle.Id; cmd.Parameters.Add("@IdNovedad", SqlDbType.Int).Value = planillaDetalle.Novedad.Id; cmd.Parameters.Add("@IdCentroCosto", SqlDbType.Int).Value = planillaDetalle.CentroCosto != null ? planillaDetalle.CentroCosto.Id : 0; cmd.Parameters.Add("@IdRelacion", SqlDbType.Int).Value = planillaDetalle.RelacionActividad != null ? planillaDetalle.RelacionActividad.Id : 0; cmd.Parameters.Add("@FeInicio", SqlDbType.Time).Value = planillaDetalle.Inicio; cmd.Parameters.Add("@FeFin", SqlDbType.Time).Value = planillaDetalle.Fin; cn.Open(); int ret = ExecuteNonQuery(cmd); return(ret == 1); } }
public abstract bool Actualizar(PlanillaDetalle planillaDetalle);
public abstract bool Insertar(PlanillaDetalle planillaDetalle, int idPlanilla);
public Task <string> ProcesarDocumentosLiquidados(DatosConsultaArchivos datosConsultaArchivos) { List <PlanillaEstadoDto> _planillaEstadoList = new List <PlanillaEstadoDto>(); List <PREMIUM_MO> _reciboAbonoList = null; PlanillaDetalle _planillaDetalle = null; List <DetallePlanillaCobro> _listaRecibos = null; PlanillaEstado _planillaEstado = null; string _sMessage = string.Empty; datosConsultaArchivos.FechaDesde = Convert.ToDateTime(datosConsultaArchivos.FechaDesde).ToShortDateString(); datosConsultaArchivos.FechaHasta = Convert.ToDateTime(datosConsultaArchivos.FechaHasta).ToShortDateString(); try { //1.Obtiene información de las planillas conciliadas var _obj0 = _generacionexactusRepository.ListarPlanillaConciliada(datosConsultaArchivos); _planillaEstadoList = _mapper.Map <List <PlanillaEstadoDto> >(_obj0); if (_planillaEstadoList.Count > 0) { foreach (PlanillaEstadoDto e in _planillaEstadoList) { var _obj1 = _mapper.Map <PlanillaEstado>(e); //Registra Planilla Detalle - Nuevo SP _obj1.VcUsuariocreacion = e.VcUsuariocreacion.ToString(); _generacionexactusRepository.RegistrarPlanillaDetalle(_obj1); //Obtiene los recibos _listaRecibos = new List <DetallePlanillaCobro>(); _listaRecibos = _generacionexactusRepository.ListarPlanillaCertificado(_obj1); //Obtiene datos del abono foreach (DetallePlanillaCobro c in _listaRecibos) { _planillaDetalle = new PlanillaDetalle(); _planillaDetalle.IdProforma = c.IdProforma; _reciboAbonoList = new List <PREMIUM_MO>(); _reciboAbonoList = _generacionexactusRepository.ListarReciboAbonado(_planillaDetalle); //Registra en PREMIUM_MO foreach (PREMIUM_MO p in _reciboAbonoList) { _generacionexactusRepository.RegistrarReciboAbonado(p); } } //Registra estados _planillaEstado = new PlanillaEstado(); _planillaEstado.IdPlanilla = e.IdPlanilla; _planillaEstado.IddgEstadoplanilla = 1104; //Documentos Liquidados _planillaEstado.IddgEstado = 1001; //Registro activo _planillaEstado.VcUsuariocreacion = e.VcUsuariocreacion.ToString(); //Agregado 16/07/2018 _planillaRepository.RegistrarEstadoPlanilla(_planillaEstado); } _sMessage = "1"; } else { _sMessage = "2"; } } catch (Exception ex) { _sMessage = "0"; _logger.LogError(ex.InnerException.ToString()); } return(Task.FromResult <string>(_sMessage)); }
public static bool Actualizar(PlanillaDetalle planillaDetalle) { return(AppProvider.PlanillaDetalle.Actualizar(planillaDetalle)); }
//public static List<PlanillaDetalle> ObtenerTodo() //{ // return AppProvider.Planilla.(); //} public static bool Insertar(PlanillaDetalle planillaDetalle, int idPlanilla) { return(AppProvider.PlanillaDetalle.Insertar(planillaDetalle, idPlanilla)); }