예제 #1
0
 /// <summary>
 /// 新增供應商資料
 /// </summary>
 private void addSupplierMenuItem_Click(object sender, EventArgs e)
 {
     if (this.connect == null)
     {
         MessageBox.Show("請先連線至資料庫!!");
     }
     else
     {
         sf             = new SupplierForm();
         sf.Connect     = this.connect;
         sf.Suppliers   = this.suppliers;
         sf.FormClosed += new FormClosedEventHandler(sf_FormClosed);
         sf.Show();
     }
 }
예제 #2
0
 /// <summary>
 /// 修改供應商資料
 /// </summary>
 private void editSupplierMenuItem_Click(object sender, EventArgs e)
 {
     if (this.connect == null)
     {
         MessageBox.Show("請先連線至資料庫!!");
     }
     else
     {
         int i = this.supplierView.SelectedRows[supplierView.Rows.GetRowCount(DataGridViewElementStates.Selected) - 1].Index;
         if (i < suppliers.Count)
         {
             sf           = new SupplierForm();
             sf.Connect   = this.connect;
             sf.Suppliers = this.suppliers;
             sf.setIndex(i);
             sf.FormClosed += new FormClosedEventHandler(sf_FormClosed);
             sf.Show();
         }
     }
 }