/// <summary>
        /// This is the page Load event of the Home page with the default values
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //gets all the Case Types
                FST.Common.Business_Interface bi = new FST.Common.Business_Interface();
                DataTable dt = bi.GetCaseTypes();
                this.ddlCase_Type.DataSource     = dt;
                this.ddlCase_Type.DataTextField  = "FieldName";
                this.ddlCase_Type.DataValueField = "FieldValue";
                this.ddlCase_Type.DataBind();
                this.ddlCase_Type.SelectedIndex = 0;
                this.ddlCase_Type_SelectedIndexChanged(ddlCase_Type, new EventArgs());

                //populates the Theta
                dt.Clear();
                dt = bi.GetTheta();
                this.ddlTheta.DataSource     = dt;
                this.ddlTheta.DataTextField  = "FieldName";
                this.ddlTheta.DataValueField = "FieldValue";
                this.ddlTheta.DataBind();
                this.ddlTheta.SelectedIndex = 2;

                // get the lab kits
                dt.Clear();
                dt = bi.GetLabKits();
                this.ddlLabKit.DataSource     = dt;
                this.ddlLabKit.DataTextField  = "FieldName";
                this.ddlLabKit.DataValueField = "FieldValue";
                this.ddlLabKit.DataBind();
                int cnt = 0;
                if (Session["LabKitID"] != null)
                {
                    this.ddlLabKit.SelectedValue = Session["LabKitID"].ToString();
                }
                else
                {
                    this.ddlLabKit.SelectedIndex = 0;
                }
                Session["LabKitID"]   = this.ddlLabKit.SelectedValue;
                Session["LabKitName"] = this.ddlLabKit.SelectedItem.Text;

                this.ddlDegradedType.SelectedIndex = 0;

                // show the appropriate panels for the first comparison in the list
                this.PnlCaseTypes.Visible    = true;
                this.pnlSuspPrfl1.Visible    = true;
                this.pnlSuspPrfl2.Visible    = false;
                this.pnlKnownPrfl1.Visible   = false;
                this.pnlKnownPrfl2.Visible   = false;
                this.pnlKnownPrfl3.Visible   = false;
                this.pnlKnownPrfl4.Visible   = false;
                this.btnGo.Visible           = true;
                this.btnBulk.Visible         = true;
                this.lblDegradedType.Visible = true;
                this.ddlDegradedType.Visible = true;
                this.pnlUserWarning.Visible  = false;
            }
        }
Ejemplo n.º 2
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();
        }
    }
Ejemplo n.º 3
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 = "";
        }
    }
        protected void btnRunTestNew_Click(object sender, EventArgs e)
        {
            // initialize the page sessions (needs to be done so the pages have a session handle in the subthread)
            FST.Web.frmManualEntry page = new frmManualEntry();
            var    s       = page.Session;
            string version = ConfigurationSettings.AppSettings.Get("FST_VERSION");

            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate
            {
                testName        = txtTestName.Text;
                testIndividual  = chkIndividual.Checked;
                testBulk        = chkBulk.Checked;
                testManualEntry = rbManualEntry.Checked;
                deducible       = rbDeducible.Checked;
                LabKitID        = bi.GetLabKits().Rows[0]["FieldValue"].ToString();

                foreach (ListItem liComparisonType in chkComparisonTypes.Items)
                {
                    if (liComparisonType.Selected)
                    {
                        comparisonTypes.Add(Convert.ToInt32(liComparisonType.Value));
                    }
                }

                comparisonProfiles = bi.GetProfilesFromFile(this.fuComparisonProfiles, Server.MapPath("~/Admin/Upload/"), Guid.Parse(LabKitID));
                known1Profile      = bi.GetProfilesFromFile(this.fuKnown1Profile, Server.MapPath("~/Admin/Upload/"), Guid.Parse(LabKitID));
                known2Profile      = bi.GetProfilesFromFile(this.fuKnown2Profile, Server.MapPath("~/Admin/Upload/"), Guid.Parse(LabKitID));
                known3Profile      = bi.GetProfilesFromFile(this.fuKnown3Profile, Server.MapPath("~/Admin/Upload/"), Guid.Parse(LabKitID));
                evidence           = GetEvidenceFromFile(this.fuEvidence, Server.MapPath("~/Admin/Upload/"));
                saveTableEvidence  = GetSaveTableEvidence(evidence);

                Known2Alleles = new Dictionary <string, Dictionary <int, string> >();

                EvidenceAlleles = new Dictionary <string, Dictionary <int, string> >();
                ReadEvidenceAllelesNew(evidence, EvidenceAlleles);

                testID = Guid.NewGuid();

                foreach (int comparisonType in comparisonTypes)
                {
                    Session["CompareMethod"] = comparisonType.ToString();

                    if (testIndividual)
                    {
                        foreach (DataRow dr in comparisonProfiles.Rows)
                        {
                            dnaEvidenceAmount = 111;
                            subTestID         = Guid.NewGuid();
                            comparisonID      = dr["ID"].ToString();

                            ComparisonData comparisonData  = new ComparisonData(comparisonType);
                            comparisonData.Bulk            = false;
                            comparisonData.Comparison      = "\tes\t";
                            comparisonData.Deducible       = deducible;
                            comparisonData.Degradation     = FST.Common.ComparisonData.enDegradation.None;
                            comparisonData.DNAAmount       = dnaEvidenceAmount = 111;
                            comparisonData.EvidenceAlleles = EvidenceAlleles;
                            comparisonData.FB1             = subTestID.ToString();
                            comparisonData.Item            = comparisonID;
                            comparisonData.LabKitID        = Guid.Parse(LabKitID);
                            comparisonData.LabKitName      = "Indentifiler";
                            comparisonData.Processed       = 'N';
                            comparisonData.Theta           = 0.03f;
                            comparisonData.UserName        = User.Identity.Name;
                            comparisonData.Version         = version;

                            ReadComparisonNew(dr, comparisonData.ComparisonAlleles, 1);

                            if (comparisonData.NumeratorProfiles.KnownCount >= 1 || comparisonData.DenominatorProfiles.KnownCount >= 1)
                            {
                                ReadComparisonNew(known1Profile.Rows[0], comparisonData.KnownsAlleles, 1);
                            }
                            if (comparisonData.NumeratorProfiles.KnownCount >= 2 || comparisonData.DenominatorProfiles.KnownCount >= 2)
                            {
                                ReadComparisonNew(known2Profile.Rows[0], comparisonData.KnownsAlleles, 2);
                            }
                            if (comparisonData.NumeratorProfiles.KnownCount >= 3 || comparisonData.DenominatorProfiles.KnownCount >= 3)
                            {
                                ReadComparisonNew(known3Profile.Rows[0], comparisonData.KnownsAlleles, 3);
                            }

                            saveTableComparison = GetSaveTable(dr, "Suspect");

                            this.comparisonData = comparisonData;

                            WriteTest(testID, subTestID, testName, comparisonID, comparisonType, true, false, LabKitID, dnaEvidenceAmount);

                            page.btnCompare_Click(this, new EventArgs());

                            if (saveTableComparison != null && saveTableComparison.Columns.Contains("guid"))
                            {
                                saveTableComparison.Columns.Remove("guid");
                            }
                            if (comparisonProfiles.Columns.Contains("guid"))
                            {
                                comparisonProfiles.Columns.Remove("guid");
                            }
                            lastUpdated = DateTime.Now;
                        }
                    }
                    if (testBulk)
                    {
                        dnaEvidenceAmount = 111;
                        subTestID         = Guid.NewGuid();

                        ComparisonData comparisonData  = new ComparisonData(comparisonType);
                        comparisonData.Bulk            = true;
                        comparisonData.Comparison      = "\tes\t";
                        comparisonData.Deducible       = deducible;
                        comparisonData.Degradation     = FST.Common.ComparisonData.enDegradation.None;
                        comparisonData.DNAAmount       = dnaEvidenceAmount = 111;
                        comparisonData.EvidenceAlleles = EvidenceAlleles;
                        comparisonData.FB1             = subTestID.ToString();
                        comparisonData.LabKitID        = Guid.Parse(LabKitID);
                        comparisonData.LabKitName      = "Indentifiler";
                        comparisonData.Processed       = 'N';
                        comparisonData.Theta           = 0.03f;
                        comparisonData.UserName        = User.Identity.Name;
                        comparisonData.Version         = version;

                        if (comparisonData.NumeratorProfiles.KnownCount >= 1 || comparisonData.DenominatorProfiles.KnownCount >= 1)
                        {
                            ReadComparisonNew(known1Profile.Rows[0], comparisonData.KnownsAlleles, 1);
                        }
                        if (comparisonData.NumeratorProfiles.KnownCount >= 2 || comparisonData.DenominatorProfiles.KnownCount >= 2)
                        {
                            ReadComparisonNew(known2Profile.Rows[0], comparisonData.KnownsAlleles, 2);
                        }
                        if (comparisonData.NumeratorProfiles.KnownCount >= 3 || comparisonData.DenominatorProfiles.KnownCount >= 3)
                        {
                            ReadComparisonNew(known3Profile.Rows[0], comparisonData.KnownsAlleles, 3);
                        }

                        foreach (DataRow dr in comparisonProfiles.Rows)
                        {
                            WriteTest(testID, subTestID, testName, dr["ID"].ToString(), comparisonType, true, true, LabKitID, dnaEvidenceAmount);
                        }

                        this.comparisonData = comparisonData;

                        page.btnCompare_Click(this, new EventArgs());

                        if (saveTableComparison != null && saveTableComparison.Columns.Contains("guid"))
                        {
                            saveTableComparison.Columns.Remove("guid");
                        }
                        if (comparisonProfiles.Columns.Contains("guid"))
                        {
                            comparisonProfiles.Columns.Remove("guid");
                        }
                        lastUpdated = DateTime.Now;
                    }
                }
            }));
        }