Пример #1
0
        //新增支出
        private void addTool_Click(object sender, EventArgs e)
        {
            ExpenseForm addEmployee = new ExpenseForm(db, null);

            if (addEmployee.ShowDialog() == DialogResult.OK)
            {
                dgv_show();
            }
        }
Пример #2
0
        //编辑支出
        private void editTool_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printErrorMsg("没有选择行!");
                return;
            }

            int selId    = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value);
            var employee = db.Expense.FirstOrDefault(x => x.id == selId);

            ExpenseForm editEmployee = new ExpenseForm(db, employee);

            if (editEmployee.ShowDialog() == DialogResult.OK)
            {
                dgv_show();
            }
        }
Пример #3
0
 //新增支出
 private void addTool_Click(object sender, EventArgs e)
 {
     ExpenseForm addEmployee = new ExpenseForm(db, null);
     if (addEmployee.ShowDialog() == DialogResult.OK)
         dgv_show();
 }
Пример #4
0
        //编辑支出
        private void editTool_Click(object sender, EventArgs e)
        {
            if (dgv.CurrentCell == null)
            {
                GeneralClass.printErrorMsg("没有选择行!");
                return;
            }

            int selId = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value);
            var employee = db.Expense.FirstOrDefault(x => x.id == selId);

            ExpenseForm editEmployee = new ExpenseForm(db, employee);
            if (editEmployee.ShowDialog() == DialogResult.OK)
                dgv_show();
        }