Esempio n. 1
0
        protected void ddlAddState_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlAddState.SelectedIndex == 0)
            {
                ddlAddCity.Items.Clear();
                fillcitydropdown(ddlAddCountry.SelectedValue);
            }
            else
            {
                Guid ddlstate_id = Guid.Parse(ddlAddState.SelectedValue);
                var  result      = _objMasterData.GetCityMasterData(new MDMSVC.DC_City_Search_RQ()
                {
                    State_Id = ddlstate_id
                });

                if (result != null)
                {
                    ddlAddCity.Items.Clear();

                    ddlAddCity.DataSource     = result;
                    ddlAddCity.DataValueField = "City_Id";
                    ddlAddCity.DataTextField  = "Name";
                    ddlAddCity.DataBind();
                    ddlAddCity.Items.Insert(0, new ListItem("--ALL--", ""));
                }
                else
                {
                    fillcitydropdown(ddlAddCountry.SelectedValue);
                }
            }
        }
Esempio n. 2
0
 private void fillgvCityyList(Guid CountryID)
 {
     try
     {
         var result = _objMaster.GetCityMasterData(new MDMSVC.DC_City_Search_RQ()
         {
             Country_Id = CountryID, PageNo = intpageindexCity, PageSize = pagesizeCity
         });
         grdCityList.PageIndex  = intpageindexCity;
         grdCityList.PageSize   = pagesizeCity;
         grdCityList.DataSource = result;
         if (result != null)
         {
             if (result.Count > 0)
             {
                 grdCityList.VirtualItemCount = result[0].TotalRecords;
             }
         }
         grdCityList.DataBind();
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 3
0
        private void fillgvCityyList(Guid CountryID, int pageindex)
        {
            intPageSize = Convert.ToInt32(ddlShowEntries.SelectedValue);
            string CityName  = string.Empty;
            string _Key      = string.Empty;
            string _Rank     = string.Empty;
            string _Priority = string.Empty;

            if (!string.IsNullOrWhiteSpace(txtCityName.Text))
            {
                CityName = txtCityName.Text;
            }

            if (!string.IsNullOrWhiteSpace(ddlKey.SelectedValue.Replace("0", "")))
            {
                _Key = ddlKey.SelectedValue;
            }

            if (!string.IsNullOrWhiteSpace(ddlRank.SelectedValue.Replace("0", "")))
            {
                _Rank = ddlRank.SelectedValue;
            }

            if (!string.IsNullOrWhiteSpace(ddlPriority.SelectedValue.Replace("0", "")))
            {
                _Priority = ddlPriority.SelectedValue;
            }

            var result = _objMasterData.GetCityMasterData(new MDMSVC.DC_City_Search_RQ()
            {
                Country_Id = CountryID, City_Name = CityName, Key = _Key, Rank = _Rank, Priority = _Priority, Status = "ACTIVE", PageNo = pageindex, PageSize = intPageSize
            });

            grdCityList.DataSource = result;
            if (result != null && result.Count > 0)
            {
                cityResult.Style.Add(HtmlTextWriterStyle.Display, "block");
                grdCityList.VirtualItemCount = result[0].TotalRecords;
            }
            grdCityList.PageIndex = pageindex;
            grdCityList.PageSize  = intPageSize;
            grdCityList.DataBind();
        }
        private void BindCity(Guid?Country_Id)
        {
            var resultCity = _objMaster.GetCityMasterData(new MDMSVC.DC_City_Search_RQ()
            {
                Country_Id = Country_Id
            });

            if (resultCity != null)
            {
                if (resultCity.Count > 0)
                {
                    ddlCityEdit.DataSource     = resultCity;
                    ddlCityEdit.DataValueField = "City_Id";
                    ddlCityEdit.DataTextField  = "Name";
                    ddlCityEdit.DataBind();
                    ddlCityEdit.Items.Insert(0, new ListItem {
                        Selected = true, Text = "- ALL -", Value = "0"
                    });
                }
            }
        }