public void DeleteEmployee()
        {
            EmployeeBLL Ebll = new EmployeeBLL();

            Console.Write("Pls, enter Employee Id: ");
            int Id = Convert.ToInt32(Console.ReadLine());

            Ebll.DeleteEmployeeBLL(Id);
        }
示例#2
0
 // DELETE: api/Employee/5
 public HttpResponseMessage Delete(int id)              //Ok
 {
     try
     {
         var result = bll.DeleteEmployeeBLL(id);
         if (!result)
         {
             return(Request.CreateErrorResponse(HttpStatusCode.NotFound, $"Employee with Id = {id.ToString()} is not found to delecte"));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.OK));
         }
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }
        private void DeleteEmployee(object sender, RoutedEventArgs e)
        {
            int EmpId;

            EmpId = Convert.ToInt32(txtId.Text);

            EmployeeEntity.EmployeeID = EmpId;

            bool deleteEmployee = EmployeeBLL.DeleteEmployeeBLL(employeeEntity);

            if (deleteEmployee == true)
            {
                MessageBox.Show("Employee Deleted Successfully");
                dgEmployees.DataContext = EmployeeBLL.LoadGridBLL();
            }
            else
            {
                MessageBox.Show("Something is wrong..check your details again..");
            }
        }