public ActionResult Create(PlanModel model) { if (ModelState.IsValid) { if (model.PLAN_ID == 0) { PlanModel.insertPlan(model); ModelState.Clear(); return(Json("Save Plan Successfully.", JsonRequestBehavior.AllowGet)); } else { PlanModel.updatePlan(model); ModelState.Clear(); return(Json("Update Plan successfully.", JsonRequestBehavior.AllowGet)); } } else { return(Json("Please fill all fields.", JsonRequestBehavior.AllowGet)); } }