private void BindCountryDropDown()
        {
            SupplierController controller = new SupplierController();

            CountryDropDown.DataSource     = controller.ListCountries();
            CountryDropDown.DataTextField  = nameof(Country.Name);
            CountryDropDown.DataValueField = nameof(Country.Name);
            CountryDropDown.DataBind();
            CountryDropDown.Items.Insert(0, "[Select a country]");
        }
예제 #2
0
        private void BindCountryDropDown()
        {
            var countryRepository = IoC.Resolve <ICountryRepository>();
            var country           = countryRepository.GetAll();

            CountryDropDown.DataSource     = country;
            CountryDropDown.DataTextField  = DDL_TEXT_NAME;
            CountryDropDown.DataValueField = DDL_VALUE_ID;
            CountryDropDown.DataBind();
            CountryDropDown.Items.Insert(0, new ListItem("Select Country", "0"));
        }
예제 #3
0
    private void BindCountryDropDown()
    {
        InventoryPurchasingController controller = new InventoryPurchasingController();

        CountryDropDown.DataSource     = controller.ListAllCountries();
        CountryDropDown.DataTextField  = "Country";
        CountryDropDown.DataValueField = "Country";
        CountryDropDown.DataBind();
        CountryDropDown.Items.Insert(0, new ListItem("[Select a Country]", "-1"));
        CountryDropDown.Items.Insert(1, new ListItem("[no Country]", ""));
    }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if ((Session["role"].ToString() == "Teacher") || (Session["role"].ToString() == "Incharge"))
                {
                    if (!IsPostBack)
                    {
                        buildBarChart("All", "All", DateTime.Parse("1-1-1753"), DateTime.Parse("1-1-9999"));
                        buildPieChart("All");
                        buildHorizontalChart("All");
                        buildLineChart("All", "All");

                        Chart1.Series[0]["PieLabelStyle"] = "Outside";
                        Chart1.Legends.Add("Legend1");
                        Chart1.Legends[0].Enabled   = true;
                        Chart1.Series[0].LegendText = "#PERCENT{P1}";



                        TripDAO       tripDao     = new TripDAO();
                        List <String> countryList = tripDao.getCountry();
                        CountryDropDown.DataSource = countryList;
                        CountryDropDown.DataBind();
                        CountryDropDown.Items.Insert(0, new ListItem("All", "All"));

                        DropDownListCountryPieChart.DataSource = countryList;
                        DropDownListCountryPieChart.DataBind();
                        DropDownListCountryPieChart.Items.Insert(0, new ListItem("All", "All"));
                    }
                }
                else
                {
                    Response.Redirect("./Oops.aspx");
                }
            }
            catch (Exception)
            {
                Response.Redirect("./Oops.aspx");
            }
        }
예제 #5
0
        private void FillStates()
        {
            var stateRepository   = IoC.Resolve <IStateRepository>();
            var countryRepository = IoC.Resolve <ICountryRepository>();

            var countries = countryRepository.GetAll();

            CountryDropDown.DataTextField  = "Name";
            CountryDropDown.DataValueField = "Id";
            CountryDropDown.DataSource     = countries;
            CountryDropDown.DataBind();

            CountryDropDown.Items.Insert(0, new ListItem("-- Select --", "0"));

            var states = stateRepository.GetAllStates();

            var javascriptSerializer = new JavaScriptSerializer();
            var serialized           = javascriptSerializer.Serialize(states);

            //pcp State-Country
            pcpCountryDropDown.DataTextField  = "Name";
            pcpCountryDropDown.DataValueField = "Id";
            pcpCountryDropDown.DataSource     = countries;
            pcpCountryDropDown.DataBind();

            pcpCountryDropDown.Items.Insert(0, new ListItem("-- Select --", "0"));


            pcpMailingcountryDropDown.DataTextField  = "Name";
            pcpMailingcountryDropDown.DataValueField = "Id";
            pcpMailingcountryDropDown.DataSource     = countries;
            pcpMailingcountryDropDown.DataBind();

            pcpMailingcountryDropDown.Items.Insert(0, new ListItem("-- Select --", "0"));

            ClientScript.RegisterStartupScript(Page.GetType(), "js_Country_State", " var stateCountryList = " + serialized + ";", true);
        }