public bool RemoveStaffAllocation(RemoveStaffAllocationDTO obj) { bool res = false; SqlCommand cmd = new SqlCommand("@p_StaffAllocationId"); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@p_StaffAllocationId", obj.StaffAllocationId); int result = new DBlayer().ExecuteNonQuery(cmd); if (result != Int32.MaxValue) { res = true; } return(res); }
public HttpResponseMessage RemoveStaffAllocation(RemoveStaffAllocationDTO obj) { HttpResponseMessage message; try { StaffAllocationDAL dal = new StaffAllocationDAL(); var dynobj = new { result = dal.RemoveStaffAllocation(obj) }; message = Request.CreateResponse(HttpStatusCode.OK, dynobj); } catch (Exception ex) { message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "something Wrong.Try Again!" }); } return(message); }