private void btnAddCow_Click(object sender, EventArgs e)
 {
     try{
         var form = new AddCowOrderInForm();
         form.OrderInWizard = this;
         var result = form.ShowDialog();
         if (result == System.Windows.Forms.DialogResult.Yes)
         {
             for (var i = 0; i < form.Count; i++)
             {
                 dgvCow.Rows.Add();
                 dgvCow.Rows[dgvCow.Rows.Count - 1].Cells["colCowID"].Value     = dgvCow.Rows.Count;
                 dgvCow.Rows[dgvCow.Rows.Count - 1].Cells["colCowCorral"].Value = form.CorralID;
                 dgvCow.Rows[dgvCow.Rows.Count - 1].Cells["colCowGene"].Value   = form.GeneID;
                 dgvCow.Rows[dgvCow.Rows.Count - 1].Cells["colCowSex"].Value    = form.SexID;
                 dgvCow.Rows[dgvCow.Rows.Count - 1].Cells["colCowAmount"].Value = form.Amount;
             }
         }
     }
     catch
     {
         MessageBox.Show("กรุณา เพิ่มคอกโคก่อน ทำการซื้อ", "ข้อผิดผลาด", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.DialogResult = System.Windows.Forms.DialogResult.No;
     }
 }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var form = new AddCowOrderInForm();

            form.IsBorn  = true;
            form.AddBorn = this;
            if (DialogResult.Yes == form.ShowDialog())
            {
                for (Int32 i = 0; i < form.Count; i++)
                {
                    this.dgvCowAdd.Rows.Add();
                    this.dgvCowAdd.Rows[this.dgvCowAdd.Rows.Count - 1].Cells["colID"].Value          = this.dgvCowAdd.Rows.Count;
                    this.dgvCowAdd.Rows[this.dgvCowAdd.Rows.Count - 1].Cells["colCorral"].Value      = form.CorralID;
                    this.dgvCowAdd.Rows[this.dgvCowAdd.Rows.Count - 1].Cells["colGene"].Value        = form.GeneID;
                    this.dgvCowAdd.Rows[this.dgvCowAdd.Rows.Count - 1].Cells["colSex"].Value         = form.SexID;
                    this.dgvCowAdd.Rows[this.dgvCowAdd.Rows.Count - 1].Cells["colDescription"].Value = String.Empty;
                }
            }
        }