예제 #1
0
        // /////////////////////////////////////////////////////////////////////////////////////////////////////
        // STEP2 - LOCATION
        //
        // ////////////////////////////////////////////////////////////////////////
        // STEP2 - LOCATION - AUXILIAR EVENTS
        //
        protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
        {
            OfficeList officeList = new OfficeList();
            officeList.LoadByCountryIdAndAddItem(-1, "(Select an office)", int.Parse(ddlCountry.SelectedValue));
            ddlOffice.DataSource = officeList.Table;
            ddlOffice.DataValueField = "OfficeID";
            ddlOffice.DataTextField = "Name";
            ddlOffice.DataBind();
            ddlOffice.SelectedIndex = 0;

            ProvinceList provinceList = new ProvinceList();
            provinceList.LoadByCountryIdAndAddItem(-1, "(Select a province)", int.Parse(ddlCountry.SelectedValue));
            ddlProvince.DataSource = provinceList.Table;
            ddlProvince.DataValueField = "ProvinceID";
            ddlProvince.DataTextField = "Name";
            ddlProvince.DataBind();
            ddlProvince.SelectedIndex = 0;
            ddlCounty.SelectedIndex = 0;
            ddlCity.SelectedIndex = 0;
        }
예제 #2
0
        // ////////////////////////////////////////////////////////////////////////
        // INITIAL EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                // Security check
                if (!(Convert.ToBoolean(Session["sgLFS_PROJECTS_VIEW"]) && Convert.ToBoolean(Session["sgLFS_PROJECTS_ADD"])))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                }

                // Tag page
                hdfCompanyId.Value = Session["companyID"].ToString();

                // Initialize viewstate variables
                ViewState["StepFrom"] = "Out";

                // Store navigator state
                StoreNavigatorState();

                // Prepare initial data

                // ... for country
                CountryList countryList = new CountryList();
                countryList.LoadAndAddItem(-1, "(Select a country)");
                ddlCountry.DataSource = countryList.Table;
                ddlCountry.DataValueField = "CountryID";
                ddlCountry.DataTextField = "Name";
                ddlCountry.DataBind();

                // ... for office
                OfficeList officeList = new OfficeList();
                officeList.LoadByCountryIdAndAddItem(-1, "(Select an office)", -1);
                ddlOffice.DataSource = officeList.Table;
                ddlOffice.DataValueField = "OfficeID";
                ddlOffice.DataTextField = "Name";
                ddlOffice.DataBind();

                // ... for province
                ProvinceList provinceList = new ProvinceList();
                provinceList.LoadByCountryIdAndAddItem(-1, "(Select a province)", -1);
                ddlProvince.DataSource = provinceList.Table;
                ddlProvince.DataValueField = "ProvinceID";
                ddlProvince.DataTextField = "Name";
                ddlProvince.DataBind();

                // ... for county
                CountyList countyList = new CountyList();
                countyList.LoadByProvinceIdAndAddItem(-1, "(Select a county)", -1);
                ddlCounty.DataSource = countyList.Table;
                ddlCounty.DataValueField = "CountyID";
                ddlCounty.DataTextField = "Name";
                ddlCounty.DataBind();

                // ... for city
                CityList cityList = new CityList();
                cityList.LoadByCountyIdAndAddItem(-1, "(Select a city)", -1);
                ddlCity.DataSource = cityList.Table;
                ddlCity.DataValueField = "CityID";
                ddlCity.DataTextField = "Name";
                ddlCity.DataBind();

                // ... for employee
                EmployeeList employeeList = new EmployeeList();
                employeeList.LoadAndAddItem(-1, " ");
                ddlProjectLead.DataSource = employeeList.Table;
                ddlProjectLead.DataValueField = "EmployeeID";
                ddlProjectLead.DataTextField = "FullName";
                ddlProjectLead.DataBind();

                // ... for salesman
                SalesmanList salesmanList = new SalesmanList();
                salesmanList.LoadAndAddItem(-1, "(Select a salesman)");
                ddlSalesman.DataSource = salesmanList.Table;
                ddlSalesman.DataValueField = "SalesmanID";
                ddlSalesman.DataTextField = "FullName";
                ddlSalesman.DataBind();

                // StepLocationIn
                // StepSection1In
                Wizard.ActiveStepIndex = 0;
                StepTypeOfProjectIn();
            }
        }