public JsonResult SWAPRank(mStudent_Ch_Choice_Filling_Swap obj) { ChoiceFillingRepository objRep = new ChoiceFillingRepository(); //obj.Type = "SWAP"; if (Session["ApplicationNo"] != null) { if (Session["ApplicationNo"].ToString() != "") { obj.ApplicationNo = Session["ApplicationNo"].ToString(); } } string localIP = "?"; localIP = Request.ServerVariables["REMOTE_ADDR"].ToString(); obj.CreatedIp = localIP; obj.studentid = Session["studentid"].ToString(); DataSet _ds = objRep.SWAP_tbl_Student_Ch_Choice_Filling(obj); bool flag = true; if (_ds != null) { if (_ds.Tables[0].Rows.Count > 0) { if (_ds.Tables[0].Rows[0]["FLAG"].ToString() == "0") { flag = false; } } } return(Json(new { flag = flag }, JsonRequestBehavior.AllowGet )); }