Ejemplo n.º 1
0
        //新增
        private void btnInsert_Click(object sender, EventArgs e)
        {
            BehaviorForm editor = new BehaviorForm(this.PrimaryKey, _Editable);

            if (editor.ShowDialog() == DialogResult.OK)
            {
                LoadingData();
            }
        }
Ejemplo n.º 2
0
 //修改
 private void listView_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (listView.SelectedItems.Count == 1)
     {
         BehaviorForm editor = new BehaviorForm(listView.SelectedItems[0].Tag as BehaviorRecord, _Editable);
         if (editor.ShowDialog() == DialogResult.OK)
         {
             LoadingData();
         }
     }
 }
Ejemplo n.º 3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (listView.SelectedItems.Count == 0)
            {
                MsgBox.Show("請先選擇一筆您要修改的資料");
                return;
            }
            else if (listView.SelectedItems.Count > 1)
            {
                MsgBox.Show("選擇資料筆數過多,一次只能修改一筆資料");
                return;
            }

            if (listView.SelectedItems.Count == 1)
            {
                BehaviorForm editor = new BehaviorForm(listView.SelectedItems[0].Tag as BehaviorRecord, _Editable);
                if (editor.ShowDialog() == DialogResult.OK)
                {
                    LoadingData();
                }
            }
        }