public ActionResult Save(Rays rays) { if (!ModelState.IsValid) { var viewModel = new RaysFormViewModel { Rays = rays, RaysType = _raysTypes.GetRecords, }; return(View("RaysForm", viewModel)); } if (rays._Id == Guid.Empty) { _context.InsertRecord(_table, rays); } else { return(HttpNotFound()); } return(RedirectToAction("Index", "Rays")); }
public ActionResult New() { var rays = new Rays(); rays.Id = GenerateUniqueID(); var viewModel = new RaysFormViewModel { Rays = rays, RaysType = _raysTypes.GetRecords, }; return(View("RaysForm", viewModel)); }