コード例 #1
0
 public ActionResult Add(MSPLANT model)
 {
     try
     {
         IPlantService svc    = new PlantService();
         var           result = svc.Add(model);
         this.AddNotification("Your Data Has Been Successfully Saved. ", NotificationType.SUCCESS);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         general.AddLogError("Plant Add", ex.Message, ex.StackTrace);
         this.AddNotification("ID exist", NotificationType.ERROR);
         this.ViewBag.cityId   = GetCity();
         this.ViewBag.PROPINSI = new SelectList(this.GetPropinsi(), "Key", "Value");
         this.ViewBag.regionId = GetRegion();
         this.ViewBag.TITLECP  = new SelectList(this.GetCpTitle(), "Key", "Value");
         return(View("~/Views/Master/Plant/Add.cshtml"));
     }
 }