private void ReporteButton_Click(object sender, EventArgs e) { SolicitaLiquidacionDto solicitaLiquidacion = new SolicitaLiquidacionDto(); if (empleadoID == 0) { MessageBox.Show("Por favor elija el empleado"); return; } solicitaLiquidacion.EmpleadoID = empleadoID; solicitaLiquidacion.Desde = InicioDatePicker.Value; solicitaLiquidacion.Hasta = FinDatePicker.Value; var fbd = new FolderBrowserDialog(); DialogResult result = fbd.ShowDialog(); if (result == DialogResult.OK && !string.IsNullOrWhiteSpace(fbd.SelectedPath)) { try { Metodos.SaveStreamAsFile(fbd.SelectedPath, container.GetInstance <IProyectoService>().LiquidacionReporte(solicitaLiquidacion), "Reporte de Liquidacion.pdf"); } catch (Exception exc) { MessageBox.Show("No se pudo hacer la liquidacion. " + exc.Message); } } }
private void LiquidacionButton_Click(object sender, EventArgs e) { SolicitaLiquidacionDto solicitaLiquidacion = new SolicitaLiquidacionDto(); if (empleadoID == 0) { MessageBox.Show("Por favor elija el empleado"); return; } solicitaLiquidacion.EmpleadoID = empleadoID; solicitaLiquidacion.Desde = InicioDatePicker.Value; solicitaLiquidacion.Hasta = FinDatePicker.Value; try { var liquidacion = container.GetInstance <IProyectoService>().Liquidacion(solicitaLiquidacion); AntiguedadLabel.Text = liquidacion.AntiguedadEmpleado.ToString(); HsNoOBLabel.Text = liquidacion.CantidadHsNoOBLiquidados.ToString(); HsOBLabel.Text = liquidacion.CantidadHsOBLiquidados.ToString(); HsTotalesLabel.Text = liquidacion.CantidadHsTotalesLiquidados.ToString(); PerfilesLabel.Text = liquidacion.CantidadPerfiles.ToString(); ProyectosLabel.Text = liquidacion.CantidadProyectosLiquidados.ToString(); TareasLabel.Text = liquidacion.CantidadTareasLiquidados.ToString(); PorcentAntigueadadLabel.Text = liquidacion.PorcentajeAplicadoAntiguedad.ToString(); PorcentHsTotalesLabel.Text = liquidacion.PorcentajeAplicadoCantidadHoras.ToString(); PorcentCantPerfilesLabel.Text = liquidacion.PorcentajeAplicadoCantidadPerfiles.ToString(); TotalLabel.Text = liquidacion.TotalLiquidado.ToString(); } catch (Exception exc) { MessageBox.Show("No se pudo hacer la liquidacion. " + exc.Message); } }
public HttpResponseMessage LiquidacionReporte(HttpRequestMessage request, [FromUri] SolicitaLiquidacionDto dto) { HttpResponseMessage response = null; if (!ModelState.IsValid) { response = request.CreateResponse(HttpStatusCode.BadRequest); } else { Stream pdf = proyectoService.LiquidacionReporte(dto); response = ResponsePDF(request, pdf, "Reporte de Liquidacion"); } return(response); }
public HttpResponseMessage Liquidacion(HttpRequestMessage request, [FromBody] SolicitaLiquidacionDto dto) { HttpResponseMessage response = null; if (!ModelState.IsValid) { response = request.CreateResponse(HttpStatusCode.BadRequest); } else { var dtoUpdated = proyectoService.Liquidacion(dto); response = request.CreateResponse(HttpStatusCode.OK, dtoUpdated); } return(response); }