/// <summary> /// Adds a timesheet. /// </summary> /// <param name="timesheet">The timesheet.</param> /// <returns>The identifier of the added timesheet.</returns> public int AddTimesheet(Timesheet timesheet) { var newTimesheet = CntRestHelper.JSONRequest <Timesheet>(Constants.NTMOBILE_BASEURL + "/timesheet/", _Client.UserName, _Client.Password, timesheet, CntRestHelper.RequestMethod.POST).Data; timesheet.Id = newTimesheet.Id; return(timesheet.Id); }
/// <summary> /// Adds an availability block. /// </summary> /// <param name="block">The availability block.</param> /// <returns>The identifier of the added availability block.</returns> public int AddAvailabilityBlock(AvailabilityBlock block) { var newBlock = CntRestHelper.JSONRequest <AvailabilityBlock>(Constants.NTMOBILE_BASEURL + "/availability-block/", _Client.UserName, _Client.Password, block, CntRestHelper.RequestMethod.POST).Data; block.Id = newBlock.Id; return(block.Id); }
/// <summary> /// Deletes an availability block. /// </summary> /// <param name="blockId">The availability block identifier.</param> /// <returns><c>true</c> if the availability block was deleted, <c>false</c> otherwise.</returns> public void DeleteAvailabilityBlock(int blockId) { CntRestHelper.JSONRequest(Constants.NTMOBILE_BASEURL + "/availability-block/" + blockId, _Client.UserName, _Client.Password, null, CntRestHelper.RequestMethod.DELETE); }
/// <summary> /// Updates an availability block. /// </summary> /// <param name="block">The availability block.</param> /// <returns><c>true</c> if the availability block was updated, <c>false</c> otherwise.</returns> public void UpdateAvailabilityBlock(AvailabilityBlock block) { CntRestHelper.JSONRequest(Constants.NTMOBILE_BASEURL + "/availability-block/" + block.Id, _Client.UserName, _Client.Password, block, CntRestHelper.RequestMethod.PUT); }
/// <summary> /// Updates a user. /// </summary> /// <param name="user">The user.</param> /// <returns><c>true</c> if the user was updated, <c>false</c> otherwise.</returns> public void UpdateUser(User user) { CntRestHelper.JSONRequest(Constants.NTMOBILE_BASEURL + "/user/" + user.Id, _Client.UserName, _Client.Password, user, CntRestHelper.RequestMethod.PUT); }
/// <summary> /// Declines a placement. /// </summary> /// <param name="placementId">The placement identifier.</param> /// <returns><c>true</c> if the notification was declined, <c>false</c> otherwise.</returns> public void DeclinePlacement(int placementId) { CntRestHelper.JSONRequest(Constants.NTMOBILE_BASEURL + "/placement/" + placementId + "/decline", _Client.UserName, _Client.Password, null, CntRestHelper.RequestMethod.PUT); }
/// <summary> /// Acknowledges a notification. /// </summary> /// <param name="notificationId">The notification identifier.</param> /// <returns><c>true</c> if the notification was acknowledged, <c>false</c> otherwise.</returns> public void AcknowledgeNotification(int notificationId) { CntRestHelper.JSONRequest(Constants.NTMOBILE_BASEURL + "/notification/" + notificationId + "/acknowledge", _Client.UserName, _Client.Password, null, CntRestHelper.RequestMethod.PUT); }
/// <summary> /// Deletes a timesheet. /// </summary> /// <param name="timesheetId">The timesheet identifier.</param> /// <returns><c>true</c> if the notification was deleted, <c>false</c> otherwise.</returns> public void DeleteTimesheet(int timesheetId) { CntRestHelper.JSONRequest(Constants.NTMOBILE_BASEURL + "/timesheet/" + timesheetId, _Client.UserName, _Client.Password, null, CntRestHelper.RequestMethod.DELETE); }
/// <summary> /// Updates a timesheet. /// </summary> /// <param name="timesheet">The timesheet.</param> /// <returns><c>true</c> if the timesheet was updated, <c>false</c> otherwise.</returns> public void UpdateTimesheet(Timesheet timesheet) { CntRestHelper.JSONRequest(Constants.NTMOBILE_BASEURL + "/timesheet/" + timesheet.Id, _Client.UserName, _Client.Password, timesheet, CntRestHelper.RequestMethod.PUT); }