Beispiel #1
0
        //D
        public ResultMessage Delete(int id)
        {
            if (_da.IsInuse(id))
            {
                return(new ResultMessage(false, "\r\n已经在单据中使用,不能删除。\r\n可以设为'停用'"));
            }
            else if (_da.Delete(id) <= 0)
            {
                return(new ResultMessage(false, "记录不存在"));
            }

            return(new ResultMessage(true, string.Empty));
        }
        private void buttonEmpDelete_Click(object sender, EventArgs e)
        {
            int itemselected = Convert.ToInt32(textBoxEmpID.Text);

            EmployeeDA.Delete(itemselected);
            MessageBox.Show("Employee record has been deleted successfully", "Confirmation");
            ClearAllEmp();
            UpdateComboBoxes();
            buttonEmpList.PerformClick();
        }
Beispiel #3
0
        //Delete
        private void buttonEmpDelete_Click(object sender, EventArgs e)
        {
            DialogResult ans = MessageBox.Show("Are you sure you want to delete the employee information?", "Delete Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (ans == DialogResult.Yes)
            {
                EmployeeDA.Delete(Convert.ToInt32(textBoxEmpId.Text));
                EmployeeDA.ListEmployees(listViewEmp);
                UpdateComboBoxes();
            }
        }
Beispiel #4
0
 private void buttonDeleteEmployee_Click(object sender, EventArgs e)
 {
     if (IsValidEmployeeData())
     {
         DialogResult ans = MessageBox.Show("Do you really want to delete this Employee?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (ans == DialogResult.Yes)
         {
             EmployeeDA.Delete(Convert.ToInt32(textBoxEmployeeId.Text));
             MessageBox.Show("Employee record has been deleted successfully", "Confirmation");
             ClearAll();
             textBoxEmployeeId.Enabled = true;
             EmployeeDA.ListEmployee(listViewEmployee);
         }
     }
 }
 public int DeleteEmployee(Employee emp)
 {
     return(employeeDA.Delete(emp));
 }
Beispiel #6
0
 public bool Delete(string Name)
 {
     return(obj.Delete(Name));
 }
        internal bool Delete(long employeeID)
        {
            EmployeeDA DAmanager = new EmployeeDA();

            return(DAmanager.Delete(employeeID));
        }
Beispiel #8
0
 private void buttonDeleteEmployee_Click(object sender, EventArgs e)
 {
     EmployeeDA.Delete(Convert.ToInt32(textBoxEmployeeID.Text));
     MessageBox.Show("Employee record has been deleted successfully", "Confirmation");
 }
Beispiel #9
0
 private void button3_Click(object sender, EventArgs e)
 {
     EmployeeDA.Delete(textBox1.Text);
 }
Beispiel #10
0
 private void btn_Delete_Click(object sender, EventArgs e)
 {
     EmployeeDA.Delete(Convert.ToInt32(txt_input.Text));
     MessageBox.Show("Employee record has been removed", "Done");
 }