Exemple #1
0
        private void fillDropdowns()
        {
            DC_Country_Search_RQ _objSearch = new DC_Country_Search_RQ();

            _objSearch.PageNo   = 0;
            _objSearch.PageSize = 5000;
            var result = _objMaster.GetCountryMasterData(_objSearch); //.Select(o => new { o.RegionCode, o.RegionName }).Where(y => y.RegionCode != null).Distinct();

            divEntries.Style.Add(HtmlTextWriterStyle.Display, "block");
            ddlRegion.DataSource     = result.Select(o => new { o.RegionCode, o.RegionName }).Where(y => y.RegionCode != null && y.RegionCode != "").Distinct();
            ddlRegion.DataValueField = "RegionCode";
            ddlRegion.DataTextField  = "RegionName";
            ddlRegion.DataBind();

            ddlKey.DataSource     = result.Select(o => new { o.Key }).Where(y => y.Key != null && y.Key != "").Distinct();
            ddlKey.DataValueField = "Key";
            ddlKey.DataTextField  = "Key";
            ddlKey.DataBind();

            ddlRank.DataSource     = result.Select(o => new { o.Rank }).Where(y => y.Rank != null && y.Rank != "").Distinct();
            ddlRank.DataValueField = "Rank";
            ddlRank.DataTextField  = "Rank";
            ddlRank.DataBind();

            ddlPriority.DataSource     = result.Select(o => new { o.Priority }).Where(y => y.Priority != null && y.Priority != "").Distinct();
            ddlPriority.DataValueField = "Priority";
            ddlPriority.DataTextField  = "Priority";
            ddlPriority.DataBind();
        }
Exemple #2
0
        private void fillgvCountryList()
        {
            DC_Country_Search_RQ _objSearch = new DC_Country_Search_RQ();

            _objSearch.PageNo   = intPageIndex;
            _objSearch.PageSize = PageSize;
            var result = _objMaster.GetCountryMasterData(_objSearch);

            divEntries.Style.Add(HtmlTextWriterStyle.Display, "block");
            grdCurrentCountryList.DataSource = result;
            grdCurrentCountryList.PageIndex  = intPageIndex;
            grdCurrentCountryList.PageSize   = PageSize;
            if (result != null)
            {
                if (result.Count > 0)
                {
                    grdCurrentCountryList.VirtualItemCount = result[0].TotalRecords;
                    if (result[0].TotalRecords < 11)
                    {
                        divEntries.Style.Add(HtmlTextWriterStyle.Display, "none");
                    }
                }
                else
                {
                    divEntries.Style.Add(HtmlTextWriterStyle.Display, "none");
                }
            }
            grdCurrentCountryList.DataBind();
        }
Exemple #3
0
        //private void fillgrdStateList(Guid CountryID, int pageindex)
        //{
        //    dtStateMaster = objMasterDataDAL.GetMasterStateData(CountryID);
        //  //  grdStateList.PageIndex = pageindex;
        //    grdStateList.DataSource = dtStateMaster;
        //    grdStateList.DataBind();


        //    ddlStates.DataSource = dtStateMaster;
        //    ddlStates.DataTextField = "StateName";
        //    ddlStates.DataValueField = "State_Id";
        //    ddlStates.DataBind();


        //}

        //private void fillgvCityyList(Guid CountryID, int pageindex)
        //{
        //    dtCityyMaster = objMasterDataDAL.GetMasterCityData(CountryID);
        //    grdCityList.PageIndex = pageindex;
        //    grdCityList.DataSource = dtCityyMaster;
        //    grdCityList.DataBind();
        //}

        //protected void grdCountryList_SelectedIndexChanged(object sender,  EventArgs e)
        //{
        //    Guid newGuid = new Guid(grdCountryList.SelectedDataKey.Value.ToString());
        //    dvChildtables.Visible=true;
        //    fillgvCityyList(newGuid, 0);
        //    fillgrdStateList(newGuid, 0);

        //    supplierCountryMapping.Country_Id = newGuid;
        //    supplierCountryMapping.SupplierCountryMappingMode = MasterDataDAL.SupplierDataMode.AllSupplierSingleCountry;
        //    supplierCountryMapping.bindSupplierCountryMapping(0);

        //}

        //protected void grdCountryList_PageIndexChanging(object sender, GridViewPageEventArgs e)
        //{
        //    intPageIndex = Convert.ToInt32(e.NewPageIndex);
        //    fillgvCountryList();
        //}

        //protected void grdStateList_PageIndexChanging(object sender, GridViewPageEventArgs e)
        //{
        //    Guid newGuid = new Guid(grdCountryList.SelectedDataKey.Value.ToString());
        //    fillgrdStateList(newGuid,e.NewPageIndex);
        //}

        //protected void grdCityList_PageIndexChanging(object sender, GridViewPageEventArgs e)
        //{
        //    Guid newGuid = new Guid(grdCountryList.SelectedDataKey.Value.ToString());
        //    fillgvCityyList(newGuid, e.NewPageIndex);
        //}

        protected void btnFilter_Click(object sender, EventArgs e)
        {
            // filters search results list based on text field
            DC_Country_Search_RQ _objSearch = new DC_Country_Search_RQ();

            _objSearch.Country_Name = txtCountryNameSearch.Text.Trim();

            if (!string.IsNullOrWhiteSpace(ddlRegion.SelectedValue.Replace("0", "")))
            {
                _objSearch.RegionCode = ddlRegion.SelectedValue;
            }

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

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

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

            _objSearch.PageNo               = intPageIndex;
            _objSearch.PageSize             = PageSize;
            grdCurrentCountryList.PageIndex = intPageIndex;
            var result = _objMaster.GetCountryMasterData(_objSearch);

            divEntries.Style.Add(HtmlTextWriterStyle.Display, "block");
            grdCurrentCountryList.DataSource = result;
            grdCurrentCountryList.PageIndex  = intPageIndex;
            grdCurrentCountryList.PageSize   = PageSize;
            if (result != null)
            {
                if (result.Count > 0)
                {
                    grdCurrentCountryList.VirtualItemCount = result[0].TotalRecords;
                    if (result[0].TotalRecords < 11)
                    {
                        divEntries.Style.Add(HtmlTextWriterStyle.Display, "none");
                    }
                }
                else
                {
                    divEntries.Style.Add(HtmlTextWriterStyle.Display, "none");
                }
            }
            grdCurrentCountryList.DataBind();
        }