Exemplo n.º 1
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string val = "";
            int ival = 0, fam = 0;
            if (e.RowIndex > -1)
            {

                switch (_t)
                {
                    case SearchType.Normal:
                        break;
                    case SearchType.BlankLocation:
                        break;
                    case SearchType.BlankSeason:
                        break;
                    case SearchType.BlankColour:
                        break;
                    case SearchType.BlankStatus:
                        break;
                    case SearchType.UnusedGenus:

                        val = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                        ival = int.Parse(val);
                        fam = (int)GenusDataAccess.GetGenusById(ival).FamilyId;
                        GenusSetup g = new GenusSetup(fam);
                        g.Show(this);

                        break;
                    case SearchType.UnusedOrder:

                        val = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                        ival = int.Parse(val);
                        fam = (int)OrderDataAccess.GetOrderById(ival).ClassId;
                        OrderSetup o = new OrderSetup(fam);
                        o.Show(this);

                        break;
                    case SearchType.UnusedFamily:

                        val = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                        ival = int.Parse(val);
                        fam = (int)FamilyDataAccess.GetFamilyById(ival).OrderId;
                        FamilySetup f = new FamilySetup(fam);
                        f.Show(this);

                        break;
                    default:
                        break;
                }
            }
        }
Exemplo n.º 2
0
 private void btnGenus_Click(object sender, EventArgs e)
 {
     GenusSetup g = new GenusSetup(SelectedGenus.GenusId);
     g.Show();
 }