public ActionResult UpdateAgent(BlAgent ObjBlAgent) { ObjBlAgent.UserCode = Convert.ToInt64(Session["ID_Agent"]); ObjBlAgent.FK_Company = Convert.ToInt64(Session["ID_Company"]); BlFunction blfunctions = new BlFunction(); string AgentPassword = ""; AgentPassword = blfunctions.EncryptAgent(Convert.ToString(ObjBlAgent.AgPassword.Trim())); ObjBlAgent.AgPassword = AgentPassword; blfunctions = null; long statusCode = 0; if (ObjBlAgent.MasterID == 0) { statusCode = ObjBlAgent.InsertData(); } else { statusCode = ObjBlAgent.UpdateData(); } ObjBlAgent = null; return(Json(new { statusCode = "" + statusCode + "" }, JsonRequestBehavior.AllowGet)); }