Esempio n. 1
0
 public static int numcantidad2()
 {
     using (var db = new HuelladeCarbonoEntities1())
     {
         return(db.informes.Count());
     }
 }
Esempio n. 2
0
 public static double sumatodo()
 {
     using (var db = new HuelladeCarbonoEntities1())
     {
         double total = 0;
         var    lista = db.informes.ToList();
         foreach (var i in lista)
         {
             total += i.sumatoria;
         }
         total /= numcantidad();
         return(total);
     }
 }
Esempio n. 3
0
 // GET: Calculo
 public ActionResult Index()
 {
     try
     {
         using (var db = new HuelladeCarbonoEntities1())
         {
             List <informes> info = db.informes.ToList();
             return(View());
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
        public ActionResult Index(informes ing)
        {
            if (!ModelState.IsValid)
            {
                return(View());
            }

            try
            {
                using (var db = new HuelladeCarbonoEntities1())
                {
                    db.informes.Add(ing);
                    db.SaveChanges();

                    return(View(ing));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }