public JsonResult GetCityArr() { clsSubmitModel oSubmit = new clsSubmitModel(); DataTable dtParty; List <clsFilter> lstFilter = new List <clsFilter>(); clsFilter sm1 = new clsFilter(); clsFilter sm = new clsFilter(); lstFilter = new List <clsFilter>(); dtParty = oSubmit.GetData("select cityCode ,cityName from citydet where citytype = 15 order by cityName "); for (int i = 0; i < dtParty.Rows.Count; i++) { sm = new clsFilter(); sm.PartyName = dtParty.Rows[i]["cityName"].ToString(); sm.PartyID = Convert.ToInt32(dtParty.Rows[i]["cityCode"].ToString()); lstFilter.Add(sm); } sm1.lstCity = lstFilter; return(Json(sm1, JsonRequestBehavior.AllowGet)); }
public ActionResult Filter() { clsSubmitModel oSubmit = new clsSubmitModel(); DataTable dtParty; List <clsFilter> lstFilter = new List <clsFilter>(); dtParty = oSubmit.GetData("Select AcctName , acctCode from Account where Compcode =" + SessionMaster.CompCode + " and acctgrou in (21 ,22) order by AcctName "); clsFilter sm1 = new clsFilter(); clsFilter sm = new clsFilter(); clsPoItem Po1 = new clsPoItem(); for (int i = 0; i < dtParty.Rows.Count; i++) { sm = new clsFilter(); sm.PartyName = dtParty.Rows[i]["AcctName"].ToString(); sm.PartyID = Convert.ToInt32(dtParty.Rows[i]["acctCode"].ToString()); lstFilter.Add(sm); } sm1.lstFilter = lstFilter; lstFilter = new List <clsFilter>(); dtParty = oSubmit.GetData("Select AcctName , acctCode from Account where Compcode =" + SessionMaster.CompCode + " and acctgrou = 34 order by AcctName "); for (int i = 0; i < dtParty.Rows.Count; i++) { sm = new clsFilter(); sm.PartyName = dtParty.Rows[i]["AcctName"].ToString(); sm.PartyID = Convert.ToInt32(dtParty.Rows[i]["acctCode"].ToString()); lstFilter.Add(sm); } sm1.lstAgent = lstFilter; lstFilter = new List <clsFilter>(); dtParty = oSubmit.GetData("Select AcctName , acctCode from Account where Compcode =" + SessionMaster.CompCode + " and acctgrou = 28 order by AcctName "); for (int i = 0; i < dtParty.Rows.Count; i++) { sm = new clsFilter(); sm.PartyName = dtParty.Rows[i]["AcctName"].ToString(); sm.PartyID = Convert.ToInt32(dtParty.Rows[i]["acctCode"].ToString()); lstFilter.Add(sm); } sm1.lstEmployee = lstFilter; lstFilter = new List <clsFilter>(); dtParty = oSubmit.GetData("select cityCode ,cityName from citydet where citytype = 15 order by cityName "); for (int i = 0; i < dtParty.Rows.Count; i++) { sm = new clsFilter(); sm.PartyName = dtParty.Rows[i]["cityName"].ToString(); sm.PartyID = Convert.ToInt32(dtParty.Rows[i]["cityCode"].ToString()); lstFilter.Add(sm); } sm1.lstCity = lstFilter; ERPDataContext o = new ERPDataContext(); ViewBag.PartyList = (from a in o.accounts where a.compcode == SessionMaster.CompCode && a.acctgrou == 21 && a.acctgrou == 22 select a).AsEnumerable(); return(View(sm1)); }