Esempio n. 1
0
 public void Update(AirGroundViewModel model)
 {
     var entity = new GraficaAirGround
         {
             id = model.id,
             FedexAirGraundAyer = model.FedexAirGraundAyer,
             TotalinShip = model.TotalinShip,
             FechaDia = model.FechaDia,
             Porcentaje=model.Porcentaje,
             actualAir=model.FedExAir,
             NewScans =model.NewScans,
             actualGround=model.FedExGround
         };
         BD.GraficaAirGround.Add(entity);
         BD.Entry(entity).State = EntityState.Modified;
         BD.SaveChanges();
 }
        // GET: Grafica
        public ActionResult IndexGrafica()
        {
            AirGroundViewModel model = new AirGroundViewModel();
            var consulta             = BD.GraficaAirGround.Where(w => w.FechaDia.Day == DateTime.Today.Day && w.FechaDia.Month == DateTime.Today.Month && w.FechaDia.Year == DateTime.Today.Year)
                                       .FirstOrDefault();

            if (consulta == null)
            {
                _ServiceAG.UpdateAyer();
                model.Variable = true;
            }
            else
            {
                model.Variable = false;
            }

            return(View(model));
        }
        public ActionResult UpdateTotalsInShip([DataSourceRequest] DataSourceRequest request, AirGroundViewModel Datos)
        {
            _ServiceAG.Update(Datos);

            return(Json(new[] { Datos }.ToDataSourceResult(request, ModelState)));
        }