Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     Models.Reports.Ganancias reporte = new Models.Reports.Ganancias();
     using (reporte)
     {
         List <Models.Reports.Ganancias> ganancia = reporte.getganancias(fInicial.Text, fFinal.Text);
         if (ganancia.Count > 0)
         {
             dtGanancias.Rows.Clear();
             foreach (Models.Reports.Ganancias item in ganancia)
             {
                 dtGanancias.Rows.Add(item.Producto, item.Costo, item.Ganancia, item.Bruto);
             }
         }
     }
 }
Esempio n. 2
0
        DataTable maketable()
        {
            DataTable inventario = new DataTable();

            inventario.Columns.Add("Producto");
            inventario.Columns.Add("Costo");
            inventario.Columns.Add("Ganancia");
            inventario.Columns.Add("Bruto");

            Models.Reports.Ganancias reporte = new Models.Reports.Ganancias();
            using (reporte)
            {
                List <Models.Reports.Ganancias> ganancia = reporte.getganancias(fInicial.Text, fFinal.Text);
                if (ganancia.Count > 0)
                {
                    dtGanancias.Rows.Clear();
                    foreach (Models.Reports.Ganancias item in ganancia)
                    {
                        inventario.Rows.Add(item.Producto, item.Costo, item.Ganancia, item.Bruto);
                    }
                }
                return(inventario);
            }
        }