public ActionResult Registration(SisterMaster obj, string SubmitBtn) { obj.CMD = SubmitBtn == "Save" ? "Save" : SubmitBtn == "Update" ? "Update" : "Delete"; obj.hid = Convert.ToInt32(Session["hospital"].ToString()); switch (obj.CMD) { case "Save": string[] str = obj.PerformAction(); ViewBag.msg = str[1]; return(View("Registration", obj)); case "Update": string[] str1 = obj.PerformAction(); ViewBag.msg = str1[2]; return(View("Registration", obj)); case "Delete": string[] str2 = obj.PerformAction(); ViewBag.msg = str2[3]; return(View("Registration", obj)); default: return(View(obj)); } }