public void DeletingEmployee()
        {
            var employees  = employeeBusiness.GetAll();
            var employeeId = employees[employees.Count - 1].Id;

            Assert.AreEqual("Employee was deleted", employeeBusiness.Delete(employeeId),
                            "Employee has a different name");
        }
        public IActionResult Delete(EmployeeDeleteModel employee)
        {
            EmployeeBusiness employeeBusiness = new EmployeeBusiness();
            var result = employeeBusiness.Delete(employee);

            return(Ok(result));
        }
示例#3
0
 public ActionResult Delete(List <EmployeeModel> emp)
 {
     try
     {
         emp.ForEach(m => m.UpdateUser = CurrentUser.Id);
         return(Json(new JsonMessage(business.Delete(emp))));
     }
     catch (Exception e)
     {
         return(Json(new JsonMessage(false, e.Message)));
     }
 }
        public ActionResult Delete(Guid id)
        {
            var identity = AIB.Find(id);

            if (identity != null)
            {
                if ((AIB.First(User.Identity.Name).AppRole.RoleLimit) - identity.AppRole.RoleLimit > 0)
                {
                    AIB.Delete(id);
                    EB.Delete(id);
                }

                else
                {
                    return(View("_Errors", null, "Yetkiniz bu durum için yeterli değildir !"));
                }
            }

            EB.Delete(id);

            return(RedirectToAction("Index"));
        }
示例#5
0
        private void RemoveButton_Click(object sender, EventArgs e)
        {
            if (employeeGrid.CurrentRow.DataBoundItem == null)
            {
                MessageBox.Show("No entry selected", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                employee = employeeGrid.CurrentRow.DataBoundItem as Employee;
                employeeBusiness.Delete(employee.Id);
            }

            UpdateGrid();
        }
示例#6
0
 public object DeleteEmployee([FromBody] EmplyeeMasterUpadateParam PR)
 {
     try
     {
         EmployeeBusiness Objdelete = new EmployeeBusiness();
         var result = Objdelete.Delete(PR);
         return(result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
 public IActionResult Delete(int employeeId)
 {
     employeeBusiness.Delete(employeeId);
     return(Json(new { redirectUrl = Url.Action("Index", "Employee") }));
 }