示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            Insurance.LabelAttributes.Add("ID", "lblInsurance");
            CountryID.DataBind();
            EmergencyCountryID.DataBind();
            HowHearTextID.DataBind();
            WhereStayID.DataBind();
            DiveLevelID.DataBind();
            DiveOrgID.DataBind();
            LanguageID.DataBind();

            //Add blank item at index 0
            CountryID.Items.Insert(0, new ListItem("--Select--", "0"));
            CountryID.SelectedIndex = -1;
            EmergencyCountryID.Items.Insert(0, new ListItem("--Select--", "0"));
            EmergencyCountryID.SelectedIndex = -1;
            Gender.Items.Insert(0, new ListItem("--Select--", "0"));
            DiveOrgID.Items.Insert(0, new ListItem("--Select--", "0"));
            DiveLevelID.Items.Insert(0, new ListItem("--Select--", "0"));
            WhereStayID.Items.Insert(0, new ListItem("--Select--", "0"));
            HowHearTextID.Items.Insert(0, new ListItem("--Select--", "0"));
            LanguageID.Items.Insert(0, new ListItem("--Select--", "0"));
            //

            var Termsdt = new DataTable();
            Termsdt = SQLTools.GetDataTable("SELECT TermsText, ShowTerms, [Language] FROM GlobalSettings, [Language] WHERE GlobalSettings.LanguageID = [Language].LanguageID");

            if (Termsdt.Rows[0]["ShowTerms"] == "True")
            {
                this.Session["ShowTerms"] = true;
                pTerms.InnerHtml          = Termsdt.Rows[0]["TermsText"].ToString().Replace(System.Environment.NewLine, "<br />");
            }
            else
            {
                this.Session["ShowTerms"] = false;
            }

            string language = Termsdt.Rows[0]["Language"].ToString();
            optLanguage.SelectedValue = language;
            var sectionsdt = new DataTable();
            var fieldsdt   = new DataTable();
            sectionsdt = SQLTools.GetDataTable("SELECT * FROM RegisterFormSection");
            this.Session["sectionsdt"] = sectionsdt;
            fieldsdt = SQLTools.GetDataTable("SELECT * FROM RegisterFormField WHERE RegisterFormSectionID in (Select RegisterFormSectionID From RegisterFormSection WHERE Display=True)");
            this.Session["fieldsdt"] = fieldsdt;
            SetColors();
            ChangeForm();
            if (useCamera == "Yes")
            {
                FileUploadValidator.Enabled = false;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.Session["imgFilePath"] = "";
            Country.InitCountries();
            CountryID.DataSource = Country.Countries;
            CountryID.DataBind();
            Insurance.SelectedValue       = "-1";
            CertifiedDiver.SelectedValue  = "-1";
            EmergencyCountryID.DataSource = Country.Countries;
            EmergencyCountryID.DataBind();
            NationalityCountryID.DataSource = Country.Countries;
            NationalityCountryID.DataBind();
            HowHearTextID.DataBind();
            WhereStayID.DataBind();
            DiveLevelID.DataBind();
            DiveOrgID.DataBind();
            LanguageID.DataBind();
            CheckinInstructorID.DataBind();
            //Add blank item at index 0
            CountryID.Items.Insert(0, new ListItem("--Select--", "0"));
            CountryID.SelectedIndex = -1;
            EmergencyCountryID.Items.Insert(0, new ListItem("--Select--", "0"));
            EmergencyCountryID.SelectedIndex = -1;
            NationalityCountryID.Items.Insert(0, new ListItem("--Select--", "0"));
            NationalityCountryID.SelectedIndex = -1;
            Gender.Items.Insert(0, new ListItem("--Select--", "0"));
            DiveOrgID.Items.Insert(0, new ListItem("--Select--", "0"));
            DiveLevelID.Items.Insert(0, new ListItem("--Select--", "0"));
            WhereStayID.Items.Insert(0, new ListItem("--Select--", "0"));
            HowHearTextID.Items.Insert(0, new ListItem("--Select--", "0"));
            LanguageID.Items.Insert(0, new ListItem("--Select--", "0"));
            CheckinInstructorID.Items.Insert(0, new ListItem("--Select--", "0"));

            var Termsdt = new DataTable();
            Termsdt = OleDbTools.GetDataTable("SELECT TermsText, ShowTerms, [Language] FROM GlobalSettings, [Language] WHERE GlobalSettings.LanguageID = [Language].LanguageID");
            if (Termsdt.Rows[0]["ShowTerms"].ToString() == "True")
            {
                this.Session["ShowTerms"] = true;
                pTerms.InnerHtml          = Termsdt.Rows[0].ItemArray[0].ToString().Replace(System.Environment.NewLine, "<br />");
            }
            else
            {
                this.Session["ShowTerms"] = false;
            }
            SetColors();

            string language = Termsdt.Rows[0]["Language"].ToString();
            optLanguage.SelectedValue = language;

            var sectionsdt = new DataTable();
            sectionsdt = OleDbTools.GetDataTable("SELECT * FROM RegisterFormSection");
            var fieldsdt = new DataTable();
            fieldsdt = OleDbTools.GetDataTable("SELECT * FROM RegisterFormField WHERE RegisterFormSectionID in (Select RegisterFormSectionID From RegisterFormSection WHERE Display=True)");
            this.Session["sectionsdt"] = sectionsdt;
            this.Session["fieldsdt"]   = fieldsdt;
            ChangeForm();
            if (useCamera.ToLower() == "yes")
            {
                FileUploadValidator.Enabled = false;
            }
        }
    }