protected void populatedrpdowns() { try { if (!IsPostBack) { var mastpuj = (from q in db.Siddeswari_Master_Puja select new { q.SiddOrgPujaName, q.PriceCurrency }).ToList(); Drpmastpuj.DataSource = mastpuj; Drpmastpuj.DataTextField = "SiddOrgPujaName"; Drpmastpuj.DataValueField = "SiddOrgPujaName"; Drpmastpuj.DataBind(); Drpmastpuj.Items.Insert(0, new ListItem("Select Puja Name", "0")); Drpprice.DataSource = mastpuj; Drpprice.DataTextField = "PriceCurrency"; Drpprice.DataValueField = "PriceCurrency"; Drpprice.DataBind(); Drpprice.Items.Insert(0, new ListItem("Select Currency", "0")); var cntryname = (from q in db.Siddeswari_Master_Country select new { q.SiddOrgCountryName, q.SiddOrg_TelCode }).ToList(); Drpcntry.DataSource = cntryname; Drpcntry.DataTextField = "SiddOrgCountryName"; Drpcntry.DataValueField = "SiddOrgCountryName"; Drpcntry.DataBind(); Drpcntry.Items.Insert(0, new ListItem("Select Country Name", "0")); Drpcntrcode.DataSource = cntryname; Drpcntrcode.DataTextField = "SiddOrg_TelCode"; Drpcntrcode.DataValueField = "SiddOrg_TelCode"; Drpcntrcode.DataBind(); Drpcntrcode.Items.Insert(0, new ListItem("Select Code", "0")); Dropcntrcod.DataSource = cntryname; Dropcntrcod.DataTextField = "SiddOrg_TelCode"; Dropcntrcod.DataValueField = "SiddOrg_TelCode"; Dropcntrcod.DataBind(); Dropcntrcod.Items.Insert(0, new ListItem("Select Code", "0")); } } catch (Exception ex) { throw (ex); } }
protected void populatedonschemescurr() { try { var getschemes = (from q in db.Siddeswari_Master_OrgDonationScheme select new { q.SiddOrgDonschemename, q.Amtcurrency }).ToList(); Drppujlst.DataSource = getschemes; Drppujlst.DataTextField = "SiddOrgDonschemename"; Drppujlst.DataValueField = "SiddOrgDonschemename"; Drppujlst.DataBind(); Drppujlst.Items.Insert(0, new ListItem("Select Scheme Name", "0")); var getcurr = (from q in db.Siddeswari_Master_OrgDonationScheme select new { q.Amtcurrency }).ToList().Distinct(); Drpcurrency.DataSource = getcurr; Drpcurrency.DataTextField = "Amtcurrency"; Drpcurrency.DataValueField = "Amtcurrency"; Drpcurrency.DataBind(); Drpcurrency.Items.Insert(0, new ListItem("Select Currency", "0")); var cntryname = (from q in db.Siddeswari_Master_Country select new { q.SiddOrgCountryName, q.SiddOrg_TelCode }).ToList(); Drpcntry.DataSource = cntryname; Drpcntry.DataTextField = "SiddOrgCountryName"; Drpcntry.DataValueField = "SiddOrgCountryName"; Drpcntry.DataBind(); Drpcntry.Items.Insert(0, new ListItem("Select Country Name", "0")); Drpcntcode.DataSource = cntryname; Drpcntcode.DataTextField = "SiddOrg_TelCode"; Drpcntcode.DataValueField = "SiddOrg_TelCode"; Drpcntcode.DataBind(); Drpcntcode.Items.Insert(0, new ListItem("Select Code", "0")); } catch (Exception ex) { throw (ex); } }