Ejemplo n.º 1
0
        public ActionResult Create(Product item)
        {
            if (ModelState.IsValid) {
                using (var session = new SessionScope()) {
                    if (item.Make != MakeEnum.Other) {
                        item.MakeName = item.Make.GetDisplayName ();
                    }
                    item.CreationTime = DateTime.Now;
                    item.CreateAndFlush ();
                }

                System.Diagnostics.Debug.WriteLine ("New CashSession [Id = {0}]", item.Id);

                return RedirectToAction ("Details", new { id = item.Id });
            }

            return View (item);
        }