Пример #1
0
        private void WellCutoffButton_Click(object sender, EventArgs e)
        {
            Point        tempWellId;
            int          cutoffPercent, wellCount = 0;
            double       tempRate;
            Identifiable selectedPlate;

            string []     pos;
            GetNumberForm inputForm;

            try
            {
                inputForm = new GetNumberForm();
                if (inputForm.GetNumber(this, "Well Cutoff", 0, 100, 80, "Select well success rate cutoff: ", out cutoffPercent) == false)
                {
                    //User cancelled.
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                //Get the selected plate.
                selectedPlate = (Identifiable)PlateComboBox.SelectedItem;
                //Clear any previous selections.
                MyDataServer.ClearPlateSelection();

                for (int i = 0; i < MyWellTable.Rows.Count; i++)
                {
                    //Read information from the DataTable variable to be able
                    //to get the success rate properly.
                    pos = MyWellTable.Rows[i]["well_id"].ToString().Split(new char[1] {
                        ','
                    });
                    tempWellId = new Point(Convert.ToInt32(pos[0]), Convert.ToInt32(pos[1]));
                    tempRate   = Convert.ToDouble(MyWellTable.Rows[i]["Genotyping success excluding controls"]);
                    //Add to rejection list if below cutoff.
                    if ((100.0 * tempRate) < (double)cutoffPercent)
                    {
                        MyDataServer.AddPlateWell(tempWellId.X, tempWellId.Y);
                        wellCount++;
                    }
                }
                this.Cursor = Cursors.Default;

                if (wellCount < 1)
                {
                    MessageManager.ShowInformation("No results to reject.", this);
                    return;
                }
                if (MessageManager.ShowQuestion("Reject genotypes from the " + wellCount + " wells below " +
                                                "the cutoff in the selected plate?") == DialogResult.No)
                {
                    return;
                }

                MyDataServer.RejectPlateWells(selectedPlate.ID);
            }
            catch (Exception ex)
            {
                MessageManager.ShowError(ex, "Error when rejecting.", this);
            }
        }
Пример #2
0
        private void ItemCutoffButton_Click(object sender, System.EventArgs e)
        {
            int           tempItemId, cutoffPercent, itemCount = 0;
            double        tempRate;
            Identifiable  selectedPlate;
            GetNumberForm inputForm;

            try
            {
                inputForm = new GetNumberForm();
                if (inputForm.GetNumber(this, "Item Cutoff", 0, 100, 80, "Select item success rate cutoff: ", out cutoffPercent) == false)
                {
                    //User cancelled.
                    return;
                }
                this.Cursor = Cursors.WaitCursor;
                //Get the selected plate.
                selectedPlate = (Identifiable)PlateComboBox.SelectedItem;
                //Clear any previous selections.
                MyDataServer.ClearPlateSelection();

                for (int i = 0; i < MyItemTable.Rows.Count; i++)
                {
                    //Read information from the DataTable variable to be able
                    //to get the success rate properly.
                    tempItemId = Convert.ToInt32(MyItemTable.Rows[i]["item_id"]);
                    tempRate   = Convert.ToDouble(MyItemTable.Rows[i]["Genotyping success excluding controls"]);
                    //Add to rejection list if below cutoff.
                    if ((100.0 * tempRate) < (double)cutoffPercent)
                    {
                        MyDataServer.AddPlateItem(tempItemId);
                        itemCount++;
                    }
                }
                this.Cursor = Cursors.Default;

                if (itemCount < 1)
                {
                    MessageManager.ShowInformation("No results to reject.", this);
                    return;
                }
                if (MessageManager.ShowQuestion("Reject genotypes from the " + itemCount + " items below " +
                                                "the cutoff in the selected plate?") == DialogResult.No)
                {
                    return;
                }

                MyDataServer.RejectPlateItems(selectedPlate.ID, MySessionSettings);
            }
            catch (Exception ex)
            {
                MessageManager.ShowError(ex, "Error when rejecting.", this);
            }
        }