public DataSet SWAP_tbl_Student_Ch_Choice_Filling(mStudent_Ch_Choice_Filling_Swap _obj) { try { _cn.Open(); SqlCommand _cmd = new SqlCommand("SWAP_tbl_Student_Ch_Choice_Filling", _cn); _cmd.Parameters.AddWithValue("@Created_By", _obj.studentid); _cmd.Parameters.AddWithValue("@Type", _obj.Type); _cmd.Parameters.AddWithValue("@drpformid", _obj.drpformid); _cmd.Parameters.AddWithValue("@drptoid", _obj.drptoid); _cmd.Parameters.AddWithValue("@Created_Ip", _obj.CreatedIp); _cmd.Parameters.AddWithValue("@studentid", _obj.studentid); _cmd.Parameters.AddWithValue("@ApplicationNo", _obj.ApplicationNo); _cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter _adp = new SqlDataAdapter(_cmd); DataSet _ds = new DataSet(); _adp.Fill(_ds); _adp.Dispose(); _cmd.Dispose(); return(_ds); } catch (Exception) { throw; } finally { _cn.Close(); } }
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 )); }