private void BindGrid() { try { grdCountry.DataSource = CountryService.Country_GetByAll(); grdCountry.DataBind(); } catch (Exception ex) { WebMsgBox.Show(ex.Message); } }
private void LoadFilterCountryDropDownList() { ddlFilterCountry.Items.Clear(); ddlFilterCountry.Items.Add(new ListItem(" -- View all -- ", "")); var dt = new DataTable(); dt = CountryService.Country_GetByAll(); for (int i = 0; i < dt.Rows.Count; i++) { ddlFilterCountry.Items.Add(new ListItem(Common.StringClass.ShowNameLevel(dt.Rows[i]["NameCo"].ToString(), "0"), dt.Rows[i]["CouId"].ToString())); } ddlFilterCountry.DataBind(); }
private void ViewCountry() { ddlCouId_Update.Items.Clear(); ddlCouId_Update.Items.Add(new ListItem("=== Choose Country ===", "0")); var dt = new DataTable(); dt = CountryService.Country_GetByAll(); for (int i = 0; i < dt.Rows.Count; i++) { ddlCouId_Update.Items.Add(new ListItem(Common.StringClass.ShowNameLevel(dt.Rows[i]["NameCo"].ToString(), ""), dt.Rows[i]["CouId"].ToString())); } ddlCouId_Update.DataBind(); dt.Rows.Clear(); }
private void LoadFilterNewsNameAutocomplete() { try { string strName = ""; var dt = new DataTable(); dt = CountryService.Country_GetByAll(); for (int i = 0; i < dt.Rows.Count; i++) { strName += dt.Rows[i]["NameCo"].ToString() + "|"; } ListCountry = Common.StringClass.Check(strName) && strName.Substring(strName.Length - 1).Contains("|") ? strName.Substring(0, strName.Length - 1) : strName; } catch (Exception ex) { WebMsgBox.Show(ex.Message); } }