public string Eliminar(string IdValoracion) { try { var DAO = new ValoracionDAO(); DAO.Eliminar(IdValoracion); return("exitoso"); } catch (Exception ex) { return(ex.Message); } }
private string obtenerResumen() { ConsumidorDAO consumidorDAO = new ConsumidorDAO(); TrabajadorDAO trabajadorDAO = new TrabajadorDAO(); ValoracionDAO valoracionDAO = new ValoracionDAO(); DescuentoDAO descuentoDAO = new DescuentoDAO(); LogEmailDAO logEmailDAO = new LogEmailDAO(); UsuarioDAO usuarioDAO = new UsuarioDAO(); TiendaDAO tiendaDAO = new TiendaDAO(); RubroDAO rubroDAO = new RubroDAO(); StringBuilder resumen = new StringBuilder(); resumen.AppendLine("Usuarios "); resumen.AppendLine(); resumen.Append("Total de usuarios registrados: "); resumen.AppendLine(usuarioDAO.getTotalUsuariosRegistrados().ToString()); resumen.Append("Trabajadores registrados: "); resumen.AppendLine(trabajadorDAO.getTotalTrabajadoresRegistrados().ToString()); resumen.Append("Consumidores registrados: "); resumen.AppendLine(consumidorDAO.getTotalConsumidoresRegistrados().ToString()); resumen.AppendLine(); resumen.Append("Correos enviados: "); resumen.AppendLine(logEmailDAO.getTotalLogEmailEnviados().ToString()); resumen.AppendLine(); resumen.Append("Cantidad valoraciones: "); resumen.AppendLine(valoracionDAO.getTotalValoracionesRegistradas().ToString()); resumen.AppendLine(); resumen.AppendLine("Total de descuentos entregados por rubro"); foreach (Rubro rubro in rubroDAO.listarRubros()) { resumen.Append(rubro.nombre); resumen.Append(": "); resumen.AppendLine(descuentoDAO.getTotalDescuentosRegistradosPorRubro(rubro.idRubro).ToString()); } consumidorDAO.getTotalConsumidoresRegistrados(); label1.Text = resumen.ToString(); return(resumen.ToString()); }
public ValoracionDOM Crear(ValoracionDOM Parametro) { try { var DAO = new ValoracionDAO(); //if (DAO.Obtener(Parametro.NumDocumento) != null) // Ya existe //{ //} return(DAO.Crear(Parametro)); } catch (Exception ex) { throw new WebFaultException <RepetidoException> ( new RepetidoException() { Codigo = "400", Descripcion = ex.Message }, System.Net.HttpStatusCode.Conflict ); } }
public ValoracionDOM Obtener(string IdValoracion) { var DAO = new ValoracionDAO(); return(DAO.Obtener(IdValoracion)); }
public ValoracionDOM Modificar(ValoracionDOM Parametro) { var DAO = new ValoracionDAO(); return(DAO.Modificar(Parametro)); }
public List <ValoracionDOM> Listar() { var DAO = new ValoracionDAO(); return(DAO.Listar()); }
private void btnGenerarReporte_Click(object sender, EventArgs e) { try { Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); Workbook wb = excel.Workbooks.Add(XlSheetType.xlWorksheet); Worksheet ws = (Worksheet)excel.ActiveSheet; if (this.dtgTiendas.SelectedRows.Count == 0) { MessageBox.Show("Error: Debe seleccionar una tienda para generar el reporte.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { ValoracionDAO valoracionDAO = new ValoracionDAO(); List <ReporteValoracionVO> listaReporteValoracion = valoracionDAO.getValoracionesTienda(long.Parse(this.dtgTiendas.SelectedRows[0].Cells[0].Value.ToString())); if (listaReporteValoracion.Count == 0) { MessageBox.Show("La Tienda seleccionada no tiene valoraciones asociadas.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { ws.Cells[1, 1] = "Nombre Producto"; ws.Cells[1, 1].Interior.Color = Color.Orange; ws.Cells[1, 2] = "Código producto"; ws.Cells[1, 2].Interior.Color = Color.Orange; ws.Cells[1, 3] = "Precio"; ws.Cells[1, 3].Interior.Color = Color.Orange; ws.Cells[1, 4] = "Rut Consumior"; ws.Cells[1, 4].Interior.Color = Color.Orange; ws.Cells[1, 5] = "Nombre consumidor"; ws.Cells[1, 5].Interior.Color = Color.Orange; ws.Cells[1, 6] = "Fecha Inicio Oferta"; ws.Cells[1, 6].Interior.Color = Color.Orange; ws.Cells[1, 7] = "Fecha fin Oferta"; ws.Cells[1, 7].Interior.Color = Color.Orange; ws.Cells[1, 8] = "Fecha valoración"; ws.Cells[1, 8].Interior.Color = Color.Orange; ws.Cells[1, 9] = "Nota valoración"; ws.Cells[1, 9].Interior.Color = Color.Orange; ws.Cells[1, 10] = "Detalle valoración"; ws.Cells[1, 10].Interior.Color = Color.Orange; for (int f = 1; f < listaReporteValoracion.Count + 1; f++) { for (int j = 0; j < listaReporteValoracion.Count; j++) { ws.Cells[f + 1, j + 1] = listaReporteValoracion[f - 1].nombreProducto; ws.Cells[f + 1, j + 2] = listaReporteValoracion[f - 1].codigoProducto; ws.Cells[f + 1, j + 3] = listaReporteValoracion[f - 1].precioProducto; ws.Cells[f + 1, j + 4] = listaReporteValoracion[f - 1].rutConsumidor; ws.Cells[f + 1, j + 5] = listaReporteValoracion[f - 1].nombreConsumidor; ws.Cells[f + 1, j + 6] = listaReporteValoracion[f - 1].fechaInicioOferta; ws.Cells[f + 1, j + 7] = listaReporteValoracion[f - 1].fechaTerminoOferta; ws.Cells[f + 1, j + 8] = listaReporteValoracion[f - 1].fechaValoracion; ws.Cells[f + 1, j + 9] = listaReporteValoracion[f - 1].notaValoracion; ws.Cells[f + 1, j + 10] = listaReporteValoracion[f - 1].detalleValoracion; } } SaveFileDialog guardarExcel = new SaveFileDialog(); guardarExcel.FileName = "Informe valoracion"; guardarExcel.DefaultExt = "*.xlsx"; //guardarExcel.Filter = "Excel File|*.xlsx"; guardarExcel.Filter = "Archivos de Excel (*.xlsx)|*.xlsx "; guardarExcel.Title = "Guardar Reporte"; guardarExcel.ShowDialog(); ws.SaveAs(guardarExcel.FileName); guardarExcel = null; ws = null; excel.Quit(); MessageBox.Show("El archivo fue descargado con éxito."); } } }catch (Exception ex) { MessageBox.Show("Error grave generando reporte.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public List <Valoracion> RankingDocentes(DateTime FechaInicio, DateTime FechaFina) { var DAO = new ValoracionDAO(); return(DAO.RankingDocentes(FechaInicio, FechaFina)); }