コード例 #1
0
        private async void BtnAdd_Click(object sender, EventArgs e)
        {
            FrmEmployee frm = new FrmEmployee(FormActionType.Add, null);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                await RefreshData(_handler.Pager.TotalPages);
            }
        }
コード例 #2
0
        private async void BtnSearch_Click(object sender, EventArgs e)
        {
            FrmEmployee frm = new FrmEmployee(FormActionType.Search, null);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                _handler.SetFilter(frm.MyEmployee);
                await RefreshData();
            }
        }
コード例 #3
0
        private async void BtnEdit_Click(object sender, EventArgs e)
        {
            if (gvList.SelectedRows.Count > 0)
            {
                Employee    emp = (Employee)gvList.SelectedRows[0].DataBoundItem;
                FrmEmployee frm = new FrmEmployee(FormActionType.Edit, emp);

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    await RefreshData(_handler.Pager.CurrentPage);
                }
            }
            else
            {
                MessageBox.Show("Select employee to modify", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }