Ejemplo n.º 1
0
        public bool BTCreate(BTCreate model)
        {
            BulkTechSamples entity = new BulkTechSamples()
            {
                DueOnDate  = model.DueOnDate,
                IsComplete = false
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.BulkTechSamples.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
Ejemplo n.º 2
0
        public ActionResult Create(BTCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            if (service.BTCreate(model))
            {
                TempData["SaveBTResult"] = $"Bulk/Tech Sample {model.DueOnDate.ToLongDateString()} was created.";
                return(RedirectToAction("Index"));
            }

            ModelState.AddModelError("", "Could not create Bulk/Tech Sample Date.");

            return(View(model));
        }