コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // load number of persons involved from DB and bind to gridview
            DataTable dt = bi.GetNoOfPersonsInvolved();
            this.ddlNoOfPersons.DataSource     = dt;
            this.ddlNoOfPersons.DataTextField  = "FieldName";
            this.ddlNoOfPersons.DataValueField = "FieldValue";
            this.ddlNoOfPersons.DataBind();
            this.ddlNoOfPersons.SelectedIndex = 0;
            dt.Clear();

            // load lab kits from db and bind to gridview
            dt = bi.GetLabKits();
            this.ddLabKit.DataSource = dt;
            this.ddLabKit.DataBind();
            string firstLabKitID = dt.Rows[0]["FieldValue"].ToString();
            dt.Clear();

            // load loci for the lab kit from DB and bind to gridview
            dt = bi.GetLocus(Guid.Parse(firstLabKitID));
            this.ddlLocus.DataSource = dt;
            DataRow row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlLocus.DataTextField  = "FieldName";
            this.ddlLocus.DataValueField = "FieldValue";
            this.ddlLocus.DataBind();
            this.ddlLocus.Text = "";
            dt.Clear();

            // set some defaults
            this.ddlDropOutType.Text   = "";
            this.ddlDeducible.Text     = Convert.ToString("Yes", CultureInfo.CurrentCulture);
            this.txtDropOutOption.Text = Convert.ToString("6.25 pg", CultureInfo.CurrentCulture);

            // get dropout rates for page defaults from DB and databind to gridview
            dt = ReadDropoutRate(this.txtDropOutOption.Text, Convert.ToInt16(this.ddlNoOfPersons.Text, CultureInfo.CurrentCulture), this.ddlDeducible.Text, firstLabKitID);
            this.gvDropOut.DataSource = dt;
            this.gvDropOut.DataBind();
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // get options for number of persons involved from the database and bind to our dropdown
            DataTable dt = bi.GetNoOfPersonsInvolved();
            this.ddlNoOfPersons.DataSource = dt;
            DataRow row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlNoOfPersons.DataTextField  = "FieldName";
            this.ddlNoOfPersons.DataValueField = "FieldValue";
            this.ddlNoOfPersons.DataBind();
            this.ddlNoOfPersons.Text = "";
            dt.Clear();

            // get dropout rate types from the database and bind to our dropdown (PHET1, PHET2, PHOM)
            dt = bi.GetDropOutTypes();
            this.ddlDropOutType.DataSource = dt;
            row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlDropOutType.DataTextField  = "FieldName";
            this.ddlDropOutType.DataValueField = "FieldValue";
            this.ddlDropOutType.DataBind();
            this.ddlDropOutType.Text = "";
            dt.Clear();

            // get drop out options from the database and bind to our dropdown
            // these are the rate points, so 6.25pg, 12.5pg, 25pg, etc. and also refered to as DNA template amount in the UI
            dt = bi.getDropOutOptions();
            this.ddlDropOutOption.DataSource = dt;
            row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlDropOutOption.DataTextField  = "FieldName";
            this.ddlDropOutOption.DataValueField = "FieldValue";
            this.ddlDropOutOption.DataBind();
            this.ddlDropOutOption.Text = "";
            dt.Clear();

            // get the labk kits from the database and bind to our dropdown
            dt = bi.GetLabKits();
            this.gvLabKits.DataSource = dt;
            this.gvLabKits.DataBind();
            dt.Clear();

            // get the list of loci from the database and bind to our dropdown
            dt = bi.GetLocus(Guid.Empty);
            this.ddlLocus.DataSource = dt;
            row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlLocus.DataTextField  = "FieldName";
            this.ddlLocus.DataValueField = "FieldValue";
            this.ddlLocus.DataBind();
            this.ddlLocus.Text = "";

            this.ddlDeducible.Text = "";
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataTable dt = bi.GetNoOfPersonsInvolved();
            this.ddlNoOfPersons.DataSource = dt;
            DataRow row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlNoOfPersons.DataTextField  = "FieldName";
            this.ddlNoOfPersons.DataValueField = "FieldValue";
            this.ddlNoOfPersons.DataBind();
            this.ddlNoOfPersons.Text = "";

            dt.Clear();
            dt = bi.GetDropOutTypes();
            this.ddlDropOutType.DataSource = dt;
            row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlDropOutType.DataTextField  = "FieldName";
            this.ddlDropOutType.DataValueField = "FieldValue";
            this.ddlDropOutType.DataBind();
            this.ddlDropOutType.Text = "";

            dt.Clear();
            dt = bi.getDropOutOptions();
            this.ddlDropOutOption.DataSource = dt;
            row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlDropOutOption.DataTextField  = "FieldName";
            this.ddlDropOutOption.DataValueField = "FieldValue";
            this.ddlDropOutOption.DataBind();
            this.ddlDropOutOption.Text = "";

            dt.Clear();
            dt = bi.GetLocus(Guid.Empty);
            this.ddlLocus.DataSource = dt;
            row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlLocus.DataTextField  = "FieldName";
            this.ddlLocus.DataValueField = "FieldValue";
            this.ddlLocus.DataBind();
            this.ddlLocus.Text = "";

            this.ddlDeducible.Text       = "";
            this.ddlDegradationType.Text = "";


            dt.Clear();
            dt = bi.GetDegradedDropOutData();
            this.gvDropOut.DataSource = dt;
            this.gvDropOut.DataBind();
        }
    }