コード例 #1
0
 public Task <int> AddAsync(VacationInfoTransferModel transferModel)
 {
     return(Task.Factory.StartNew(() =>
     {
         var table = _connection.Table <VacationInfoTransferModel>();
         transferModel.Id = table.Any() ? table.Max(x => x.Id) + 1 : 1;
         transferModel.ProcessInstanceId = "10" + transferModel.Id;
         _connection.Insert(transferModel, typeof(VacationInfoTransferModel));
         return transferModel.Id;
     }));
 }
コード例 #2
0
        public async Task <int> AddVacation(VacationInfoTransferModel transferModel)
        {
            var response = await Post(VacationEndPoind, transferModel);

            if (!response.IsSuccessStatusCode)
            {
                throw new HttpRequestException("Not added!");
            }

            var content = await response.Content.ReadAsStringAsync();

            return(JsonConvert.DeserializeObject <int>(content));
        }
コード例 #3
0
 public VacationModel(VacationInfoTransferModel transferModel)
 {
     Id          = transferModel.Id;
     _startDate  = transferModel.StartDate;
     _endDate    = transferModel.EndDate;
     _employeeId = transferModel.EmployeeId;
     _approverId = transferModel.ApproverId;
     _noProjectManagerObjections = transferModel.NoProjectManagerObjections;
     _comment = transferModel.Comment;
     _confirmationDocumentAvailable = transferModel.ConfirmationDocumentAvailable;
     _processInstanceId             = transferModel.ProcessInstanceId;
     _status = transferModel.Status;
     _type   = transferModel.Type;
 }
コード例 #4
0
 public Task UpdateVacation(VacationInfoTransferModel transferModel)
 {
     return(Post(VacationEndPoind, transferModel));
 }
コード例 #5
0
 public Task <int> AddAsync(VacationInfoTransferModel transferModel)
 {
     return(CurrentState.AddAsync(transferModel));
 }
コード例 #6
0
 public Task DeleteAsync(VacationInfoTransferModel transferModel)
 {
     return(CurrentState.DeleteAsync(transferModel));
 }
コード例 #7
0
 public Task <int> AddAsync(VacationInfoTransferModel transferModel)
 {
     return(_restService.AddVacation(transferModel));
 }
コード例 #8
0
 public Task DeleteAsync(VacationInfoTransferModel transferModel)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
 public Task UpdateAsync(VacationInfoTransferModel transferModel)
 {
     return(_restService.UpdateVacation(transferModel));
 }
コード例 #10
0
 public Task DeleteAsync(VacationInfoTransferModel transferModel)
 {
     return(Task.Factory.StartNew(
                () => _connection.Delete <VacationInfoTransferModel>(transferModel.Id)
                ));
 }
コード例 #11
0
 public Task UpdateAsync(VacationInfoTransferModel transferModel)
 {
     return(Task.Factory.StartNew(() => _connection.Update(transferModel, typeof(VacationInfoTransferModel))));
 }