示例#1
0
 private void DeleteEmp(object sender, RoutedEventArgs e)
 {
     if (dataEmployee.SelectedItems.Count > 0)
     {
         Model.view.EmployeeView RowData = (Model.view.EmployeeView)dataEmployee.SelectedItem;
         Model.dao.EmployeeDao   ED      = new Model.dao.EmployeeDao();
         if (ED.DeleteEmp(RowData.IDCARD))
         {
             MessageBox.Show("Employee Deleted !");
             GetEmployeeView();
         }
         else
         {
             MessageBox.Show("Failed To Delete !");
         }
     }
 }
示例#2
0
        private void EditEmployee(object sender, RoutedEventArgs e)
        {
            if (dataEmployee.SelectedItems.Count > 0)
            {
                Model.view.EmployeeView row = (Model.view.EmployeeView)dataEmployee.SelectedItem;

                Model.entity.EMPLOYEE emp = new EMPLOYEE();
                emp.IDCARD      = row.IDCARD;
                emp.NAME        = row.NAME;
                emp.AGE         = row.AGE;
                emp.ADDRESS     = row.ADDRESS;
                emp.EMAIL       = row.EMAIL;
                emp.PHONENUMBER = row.PHONENUMBER;
                emp.ACCOUNTTYPE = row.ACCOUNTTYPE;

                Frm.EditEmployee EE = new Frm.EditEmployee(emp);
                EE.ShowDialog();
                GetEmployeeView();
            }
        }