public ActionResult AddOrEditB(BranchesView BV) { DataManager DM = new DataManager(); if (BV.BranchID == 0) { DM.AddBranch(BV); return(Json(new { success = true, message = "Added Successfully!" }, JsonRequestBehavior.AllowGet)); } else { DM.UpdateBranch(BV); return(Json(new { success = true, message = "Updated Successfully!" }, JsonRequestBehavior.AllowGet)); } }