예제 #1
0
        public int Delete(int id)
        {
            var department = new Department();

            department.Id = id;
            return(_departmentServices.DeleteDepartment(department));
        }
        public JsonResult DeleteDepartment(string id)
        {
            bool result = _departmentservice.DeleteDepartment(Convert.ToInt64(id));

            if (result)
            {
                return(Json("Successfully deleted Record !"));
            }
            else
            {
                TempData["Delete"] = string.Format("Error Coming While Deleting Data");
                return(Json("Error Coming While Deleting Data"));
            }
        }
예제 #3
0
        public HttpResponseMessage Delete(int id)
        {
            HttpResponseMessage msg = Request.CreateResponse(HttpStatusCode.BadRequest, false);

            try
            {
                if (id > 0)
                {
                    var isSuccess = _departmentServices.DeleteDepartment(id);
                    if (isSuccess)
                    {
                        msg = Request.CreateResponse(HttpStatusCode.OK, isSuccess);
                    }
                }
                return(msg);
            }
            catch (Exception ex)
            {
                return(msg);
            }
        }
예제 #4
0
        public IResponseDTO RemoveDepartment(DepartmentModel departmentModel)
        {
            var depart = _departmentServices.DeleteDepartment(departmentModel);

            return(depart);
        }