Beispiel #1
0
 /// <summary>
 /// 新增材料資料
 /// </summary>
 private void addMakingMenuItem_Click(object sender, EventArgs e)
 {
     if (this.connect == null)
     {
         MessageBox.Show("請先連線至資料庫!!");
     }
     else
     {
         mf             = new MakingForm();
         mf.Connect     = this.connect;
         mf.Makings     = this.makings;
         mf.FormClosed += new FormClosedEventHandler(mf_FormClosed);
         mf.Show();
     }
 }
Beispiel #2
0
 /// <summary>
 /// 修改材料資料
 /// </summary>
 private void editMakingMenuItem_Click(object sender, EventArgs e)
 {
     if (this.connect == null)
     {
         MessageBox.Show("請先連線至資料庫!!");
     }
     else
     {
         int index = makingView.SelectedRows[makingView.Rows.GetRowCount(DataGridViewElementStates.Selected) - 1].Index;
         if (index < makings.Count)
         {
             mf         = new MakingForm();
             mf.Connect = this.connect;
             mf.Makings = this.makings;
             mf.setIndex(index);
             mf.FormClosed += new FormClosedEventHandler(mf_FormClosed);
             mf.Show();
         }
     }
 }