예제 #1
0
        public ActionResult New(Vehicle vehicle)
        {
            if (ModelState.IsValid)
            {
                if (base.genericMgr.FindAll<long>(duiplicateVerifyStatement, new object[] { vehicle.Code })[0] > 0)
                {
                    SaveErrorMessage(Resources.SYS.ErrorMessage.Errors_Existing_Code, vehicle.Code);
                }
                else
                {
                    base.genericMgr.Create(vehicle);
                    SaveSuccessMessage(Resources.TMS.Vehicle.Vehicle_Added);
                    return RedirectToAction("Edit/" + vehicle.Code);
                }
            }

            return View(vehicle);
        }
예제 #2
0
        public ActionResult Edit(Vehicle vehicle)
        {
            if (ModelState.IsValid)
            {
                base.genericMgr.Update(vehicle);
                SaveSuccessMessage(Resources.TMS.Vehicle.Vehicle_Updated);
            }

            return View(vehicle);
        }