protected void ddlMasterCountry_SelectedIndexChanged(object sender, EventArgs e) { try { if (ddlMasterCountry.SelectedValue != "0") { string strSelectedCountry = Convert.ToString(ddlMasterCountry.SelectedValue); var resultCity = _serviceMaster.GetCityMasterData(new MDMSVC.DC_City_Search_RQ() { Country_Id = Guid.Parse(strSelectedCountry) }); if (resultCity != null) { if (resultCity.Count > 0) { ddlMasterCity.Items.Clear(); ddlMasterCity.DataSource = resultCity; ddlMasterCity.DataValueField = "City_Id"; ddlMasterCity.DataTextField = "Name"; ddlMasterCity.DataBind(); ddlMasterCity.Items.Insert(0, new ListItem { Text = "-- ALL --", Value = "0" }); } } } else { ddlMasterCity.Items.Clear(); ddlMasterCity.Items.Insert(0, new ListItem { Text = "-- ALL --", Value = "0" }); } } catch (Exception) { throw; } }
private void fillcities() { MDMSVC.DC_City_Search_RQ RQ = new MDMSVC.DC_City_Search_RQ(); RQ.Country_Id = Guid.Parse(ddlCountry.SelectedValue); RQ.PageNo = 0; RQ.PageSize = int.MaxValue; var result = mastersvc.GetCityMasterData(RQ); ddlCity.DataSource = result; ddlCity.DataTextField = "Name"; ddlCity.DataValueField = "City_Id"; ddlCity.DataBind(); ddlCity.Items.Insert(0, new ListItem("---ALL---", "0")); }
public void ProcessRequest(HttpContext context) { var PrefixText = context.Request.QueryString["term"]; var Country = context.Request.QueryString["country"]; var Source = context.Request.QueryString["source"]; var StateCode = context.Request.QueryString["statecode"]; var StateName = context.Request.QueryString["statename"]; var City_Id = context.Request.QueryString["city_id"]; RQ = new MDMSVC.DC_City_Search_RQ(); if (!string.IsNullOrWhiteSpace(Country)) { RQ.Country_Name = Country.Trim().TrimStart(' '); } if (!string.IsNullOrWhiteSpace(PrefixText)) { RQ.City_Name = PrefixText.Trim(); } if (!string.IsNullOrWhiteSpace(StateName)) { RQ.State_Name = StateName.Trim(); } if (!string.IsNullOrWhiteSpace(City_Id)) { RQ.City_Id = Guid.Parse(City_Id.Trim()); } if (Source != null) { RQ.Status = "ACTIVE"; RQ.PageNo = 0; RQ.PageSize = int.MaxValue; var res = msterdata.GetCityMasterData(RQ); context.Response.Write(new JavaScriptSerializer().Serialize(res)); } else { var res = msterdata.GetCityNameList(RQ); context.Response.Write(new JavaScriptSerializer().Serialize(res)); } }
private void fillmasterdata() { fillMasterRQ(); var res = masterSVc.GetCityMasterData(RQ); if (res != null) { if (res.Count > 0) { grdTLGXMasters.VirtualItemCount = res[0].TotalRecords; lblMasterDataCount.Text = res[0].TotalRecords.ToString(); } else { lblMasterDataCount.Text = "0"; } grdTLGXMasters.DataSource = res; grdTLGXMasters.PageIndex = PageIndexMaster; grdTLGXMasters.PageSize = Convert.ToInt32(ddlPageSizeMaster.SelectedItem.Value); grdTLGXMasters.DataBind(); } }