private void SelectToolStripMenuItem_Click(object sender, EventArgs e) { IChildForm child = ActiveMdiChild as IChildForm; if (child == null) { return; } Cursor.Current = Cursors.WaitCursor; /* * switch (command) * { * case "New": child.New(); break; * case "Save": child.Save(); break; * case "Search": child.Search(); break; * case "Delete": child.Delete(); break; * default: break; * } */ child.SelectItem(); Cursor.Current = Cursors.Default; }
private void btn_Select_Click(object sender, EventArgs e) { IChildForm child = ActiveMdiChild as IChildForm; if (child == null) { return; } Cursor.Current = Cursors.WaitCursor; /* * switch (command) * { * case "New": child.New(); break; * case "Save": child.Save(); break; * case "Search": child.Search(); break; * case "Delete": child.Delete(); break; * default: break; * } */ int i_cnt = child.SelectItem(); if (i_cnt > 0) { lbl_MessageText.Text = $"{i_cnt}건의 데이터가 조회 되었습니다."; } else { lbl_MessageText.Text = "데이터를 조회하는데 문제가 발생하였습니다."; } Cursor.Current = Cursors.Default; }
private void btn_Save_Click(object sender, EventArgs e) { IChildForm child = ActiveMdiChild as IChildForm; if (child == null) { return; } Cursor.Current = Cursors.WaitCursor; /* * switch (command) * { * case "New": child.New(); break; * case "Save": child.Save(); break; * case "Search": child.Search(); break; * case "Delete": child.Delete(); break; * default: break; * } */ if (child.SaveItem()) { if (child.SelectItem() > 0) { lbl_MessageText.Text = "데이터 저장 완료."; } else { lbl_MessageText.Text = "데이터 저장은 완료됬지만 데이터를 불러오는데 문제가 발생하였습니다."; } } else { lbl_MessageText.Text = "데이터 저장에 문제가 발생하였습니다."; } Cursor.Current = Cursors.Default; }
private void btn_Delete_Click(object sender, EventArgs e) { IChildForm child = ActiveMdiChild as IChildForm; if (child == null) { return; } Cursor.Current = Cursors.WaitCursor; if (child.DeleteItem()) { lbl_MessageText.Text = "데이터 삭제 완료."; child.SelectItem(); } else { lbl_MessageText.Text = "데이터 삭제에 문제가 발생하였습니다."; } }