예제 #1
0
 public HttpResponseMessage GetById(int id)
 {
     if (id != null)
     {
         var Department = _departmentServices.GetDepartmentById(id);
         if (Department != null)
         {
             return(Request.CreateResponse(HttpStatusCode.OK, Department));
         }
         throw new ApiDataException(1001, "No Department found for this id.", HttpStatusCode.NotFound);
     }
     throw new ApiException()
           {
               ErrorCode        = (int)HttpStatusCode.BadRequest,
               ErrorDescription = "Bad Request..."
           };
 }
예제 #2
0
 public Department Query(int id)
 {
     return(_departmentServices.GetDepartmentById(id));
 }
        public ActionResult EditDepartment(string id)
        {
            DepartmentEntity data = _departmentservice.GetDepartmentById(Convert.ToInt64(id));

            return(PartialView("_UserEdit", data));
        }