Exemplo n.º 1
0
 private void PBsecDesign_Click(object sender, EventArgs e)
 {
     eglist = new inEGList(this);
     eglist.Show();
 }
Exemplo n.º 2
0
        //유전자는 24개 이상 들어 갈 수 없다.
        private void BTinsert_Click(object sender, EventArgs e)
        {
            int checkcount = 0;
            if (secInsertedEG[indexOfCircle].cnt <= 24)
            {

                for (int i = 0; i < DGVlist.Rows.Count; i++)
                {
                    if ((bool)DGVlist.Rows[i].Cells["CLcheck"].Value == true)
                    {
                        checkcount++;
                    }
                }
                if (checkcount <= 24)
                {
                    if (secInsertedEG[indexOfCircle].cnt + checkcount <= 24)
                    {
                        for (int i = 0; i < DGVlist.Rows.Count; i++)
                        {
                            if ((bool)DGVlist.Rows[i].Cells["CLcheck"].Value == true)
                            {
                                //update totally inserted EG
                                String s = DGVlist.Rows[i].Cells["CLsynb_uid"].Value.ToString();
                                String f = DGVlist.Rows[i].Cells["CLfreq"].Value.ToString();
                                String g = DGVlist.Rows[i].Cells["CLGOTerm"].Value.ToString();
                                String p = DGVlist.Rows[i].Cells["CLproduct"].Value.ToString();
                                String c = DGVlist.Rows[i].Cells["CLCOG"].Value.ToString();
                                String q = DGVlist.Rows[i].Cells["STRAND"].Value.ToString();

                                insertedEG.insertEG(s, f, g, p, c, q);
                                PBdesign.Value = insertedEG.cnt;
                                LBcurrEG.Text = "" + PBdesign.Value;

                                //update sectionly inserted EG
                                secInsertedEG[indexOfCircle].insertEG(s, f, g, p, c, q);
                                PBsecDesign.Value = secInsertedEG[indexOfCircle].cnt;
                                LBsecCurEG.Text = "" + PBsecDesign.Value;

                                DGVlist.Rows.Remove(DGVlist.Rows[i]);
                                ViewerData.cnt--;
                                i--;
                            }
                        }
                        deleteListAll();
                        ViewerData.selectEGList(indexOfCircle);
                        reloadList();
                        eglist = new inEGList(this);
                    }
                    else
                    {
                        MessageBox.Show("Max 24 genomes!");
                    }
                }

                else
                {
                    if (secInsertedEG[indexOfCircle].cnt < 24)
                    {
                        for (int i = 0; i < DGVlist.Rows.Count; i++)
                        {
                            if (secInsertedEG[indexOfCircle].cnt > 23)
                                break;
                            if ((bool)DGVlist.Rows[i].Cells["CLcheck"].Value == true)
                            {
                                //update totally inserted EG
                                String s = DGVlist.Rows[i].Cells["CLsynb_uid"].Value.ToString();
                                String f = DGVlist.Rows[i].Cells["CLfreq"].Value.ToString();
                                String g = DGVlist.Rows[i].Cells["CLGOTerm"].Value.ToString();
                                String p = DGVlist.Rows[i].Cells["CLproduct"].Value.ToString();
                                String c = DGVlist.Rows[i].Cells["CLCOG"].Value.ToString();
                                String q = DGVlist.Rows[i].Cells["STRAND"].Value.ToString();

                                insertedEG.insertEG(s, f, g, p, c, q);
                                PBdesign.Value = insertedEG.cnt;
                                LBcurrEG.Text = "" + PBdesign.Value;

                                //update sectionly inserted EG
                                secInsertedEG[indexOfCircle].insertEG(s, f, g, p, c, q);
                                PBsecDesign.Value = secInsertedEG[indexOfCircle].cnt;
                                LBsecCurEG.Text = "" + PBsecDesign.Value;

                                DGVlist.Rows.Remove(DGVlist.Rows[i]);
                                ViewerData.cnt--;
                                i--;
                            }
                        }
                        deleteListAll();
                        ViewerData.selectEGList(indexOfCircle);
                        reloadList();
                        eglist = new inEGList(this);
                    }
                    //MessageBox.Show("Max 24 genomes!");
                }
            }
            else
            {
                MessageBox.Show("Max 24 genomes!");
            }

            PieBox.Invalidate();
            if (PBdesign.Value == PBdesign.Maximum)
            {
                BTdesign.Enabled = true;
                MessageBox.Show("Insertion is all done! If you want to confirm your design, press \"Design\" Button!");
            }
        }