public ActionResult Save() { Position position = new Position(); try { string stated = Request.Form["stated"]; position.Id = Convert.ToInt32(Request.Form["Id"]); position.positionName = Request.Form["positionName"]; PositionBLL pBll = new PositionBLL(); if (stated == "add") { if (pBll.AddEntity(position)) { return(Content("{'success':'ok'}")); } } else if (stated == "update") { if (pBll.ModifyEntity(position)) { return(Content("{'success':'ok'}")); } } } catch { } return(Content("{}")); }