Exemplo n.º 1
0
        public ActionResult UpdateDeliveryChildrens([DataSourceRequest] DataSourceRequest request, TmcOutCountViewModel dictionary)
        {
            TmcOutCount d = db.TmcOutCounts.First(o => o.Id == dictionary.Id);

            d.StateType = dictionary.StateType;
            d.Note      = dictionary.Note;
            d.Count     = dictionary.Count;
            d.CountFact = dictionary.CountFact;
            db.SaveChanges();


            return(Json(new[] { dictionary }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 2
0
        public ActionResult DestroyDeliveryChildrens([DataSourceRequest] DataSourceRequest request, TmcOutCountViewModel dictionary)
        {
            if (dictionary != null)
            {
                TmcOutCount d = db.TmcOutCounts.First(o => o.Id == dictionary.Id);
                db.TmcOutCounts.Remove(d);
                db.SaveChanges();
            }

            return(Json(new[] { dictionary }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 3
0
        public ActionResult CreateDeliveryChildrens([DataSourceRequest] DataSourceRequest request, TmcOutCountViewModel dictionary)
        {
            TmcOutCount tmc = new TmcOutCount()
            {
                Id        = Guid.NewGuid(),
                StateType = dictionary.StateType,
                Note      = dictionary.Note,
                CountFact = dictionary.CountFact,
                Count     = dictionary.Count,
                TmcOutId  = Guid.Parse(dictionary.TmcOutIdString)
            };

            db.TmcOutCounts.Add(tmc);
            db.SaveChanges();
            dictionary.Id = tmc.Id;


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