public JsonResult SelectAgencyDetail() { AgencyRepository objRep = new AgencyRepository(); DataSet ds = objRep.select_tbl_Agency_detail(Session["Gov_User_id"].ToString()); List <AgencyDetail> _list = new List <AgencyDetail>(); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { AgencyDetail objBasic = new AgencyDetail(); objBasic.id = row["id"].ToString(); objBasic.agencyid = row["agencyid"].ToString(); objBasic.nameofentitlename = row["nameofentitlename"].ToString(); _list.Add(objBasic); } } } return(Json(new { List = _list }, JsonRequestBehavior.AllowGet )); }
public JsonResult SelectAgencyDetail(string ID = "") { AgencyRepository objRep = new AgencyRepository(); DataSet ds = objRep.select_tbl_Agency_detail(TempData.Peek("agencyid").ToString()); TempData.Keep("agencyid"); List <AgencyDetail> _list = new List <AgencyDetail>(); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { AgencyDetail objBasic = new AgencyDetail(); objBasic.id = row["id"].ToString(); objBasic.agencyid = row["agencyid"].ToString(); objBasic.nameofentitlename = row["nameofentitlename"].ToString(); objBasic.fee_g1 = row["fee_g1"].ToString(); objBasic.fee_g2 = row["fee_g2"].ToString(); objBasic.fee_g3 = row["fee_g3"].ToString(); objBasic.fee_g4 = row["fee_g4"].ToString(); objBasic.countryid = row["countryid"].ToString(); objBasic.noofstudent = row["noofstudent"].ToString(); _list.Add(objBasic); } } } return(Json(new { List = _list }, JsonRequestBehavior.AllowGet )); }
public DataSet insert_update_agency_detail(AgencyDetail _obj) { try { _cn.Open(); SqlCommand _cmd = new SqlCommand("insert_update_agency_detail", _cn); // _cmd.Parameters.AddWithValue("@id", _obj.id); _cmd.Parameters.AddWithValue("@agencyid", _obj.agencyid); _cmd.Parameters.AddWithValue("@nameofentitlename", _obj.nameofentitlename); _cmd.Parameters.AddWithValue("@fee_g1", _obj.fee_g1); _cmd.Parameters.AddWithValue("@fee_g2", _obj.fee_g2); _cmd.Parameters.AddWithValue("@fee_g3", _obj.fee_g3); _cmd.Parameters.AddWithValue("@fee_g4", _obj.fee_g4); _cmd.Parameters.AddWithValue("@countryid", _obj.countryid); _cmd.Parameters.AddWithValue("@noofstudent", _obj.noofstudent); _cmd.CommandTimeout = 300; _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 SaveAgencyDetail(AgencyDetail _obj) { AgencyRepository objRepository = new AgencyRepository(); _obj.agencyid = TempData.Peek("agencyid").ToString(); TempData.Keep("agencyid"); DataSet _ds = objRepository.insert_update_agency_detail(_obj); bool flag = false; if (_ds != null) { if (_ds.Tables[0].Rows.Count > 0) { if (_ds.Tables[0].Rows[0]["Counts"].ToString() == "1") { flag = true; } } } return(Json(new { flag = flag }, JsonRequestBehavior.AllowGet )); }