Beispiel #1
0
 /// <summary>
 /// Handles the locus changing so we display the correct alleles for it
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ddlLocus_SelectedIndexChanged(object sender, EventArgs e)
 {
     FST.Common.Business_Interface bi = new FST.Common.Business_Interface();
     // if the locus is blank, don't show an alleles filter
     if (String.IsNullOrEmpty(this.ddlLocus.SelectedValue))
     {
         this.ddlAlleleNo.Items.Clear();
         this.ddlAlleleNo.Items.Add("");
         this.ddlAlleleNo.SelectedIndex = 0;
     }
     else
     {   // otherwise, if a locus is selected
         // get the alleles for that locus
         DataTable dt = bi.GetAlleles(this.ddlLocus.SelectedValue);
         this.ddlAlleleNo.DataSource = dt;
         // add a blank row
         DataRow row = dt.NewRow();
         row["FieldName"]  = DBNull.Value;
         row["FieldValue"] = DBNull.Value;
         dt.Rows.Add(row);
         // and bind it to the allele drop down
         this.ddlAlleleNo.DataTextField  = "FieldName";
         this.ddlAlleleNo.DataValueField = "FieldValue";
         this.ddlAlleleNo.DataBind();
         this.ddlAlleleNo.SelectedIndex = 0;
     }
 }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            FST.Common.Business_Interface bi = new FST.Common.Business_Interface();

            // load the races (or ethnicities) into the page
            DataTable dt = bi.GetRaces();
            this.ddlRace.DataSource = dt;
            DataRow row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlRace.DataTextField  = "FieldName";
            this.ddlRace.DataValueField = "FieldValue";
            this.ddlRace.DataBind();
            this.ddlRace.Text = "";
            dt.Clear();

            // get the loci (for all lab kits)
            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 = "";
            dt.Clear();

            // get the alleles for the selected locus
            dt = bi.GetAlleles(this.ddlLocus.SelectedValue);
            this.ddlAlleleNo.DataSource = dt;
            row = dt.NewRow();
            row["FieldName"]  = DBNull.Value;
            row["FieldValue"] = DBNull.Value;
            dt.Rows.Add(row);
            this.ddlAlleleNo.DataTextField  = "FieldName";
            this.ddlAlleleNo.DataValueField = "FieldValue";
            this.ddlAlleleNo.DataBind();
            this.ddlAlleleNo.Text = "";
            dt.Clear();

            // get the frequencies
            dt = bi.GetFrequencyData();
            this.gvFreqView.DataSource = dt;
            this.gvFreqView.DataBind();
        }
    }