public async Task <HdlRegistration> DeleteDhlRegistration(HdlRegistration registration)
        {
            var url = URLBuilder.GetURL(Controllers.MAINTENANCE, EndPoint.MAINTENANCE_DHL_REGISTRATION_DELETE);

            return(await requestProvider.DeleteAsync(url, registration, new Dictionary <string, string> {
                ["id"] = registration.Id.ToString()
            }));
        }
        public async Task <HdlRegistration> DeleteRateList(HdlRegistration hdlRegistration)
        {
            var url = URLBuilder.GetURL(Controllers.MAINTENANCE, EndPoint.MAINTENANCE_RATE_LIST_DELETE);

            return(await requestProvider.DeleteAsync(url, hdlRegistration, new Dictionary <string, string> {
                ["id"] = hdlRegistration.Id.ToString()
            }));
        }
Exemplo n.º 3
0
        public void UpdateDhlRegistration(HdlRegistration hdlRegistration)
        {
            var registrationFromDb = _dhlRegistrationRepository.Get(hdlRegistration.Id);

            if (registrationFromDb != null)
            {
                _util.CopyProperties(hdlRegistration, registrationFromDb);

                _dhlRegistrationRepository.Update(registrationFromDb);
            }
            else
            {
                throw new Exception("This registration does not exist");
            }
        }
 public ActionResult UpdateDhlRegistration(HdlRegistration hdlRegistration)
 {
     if (hdlRegistration != null)
     {
         try
         {
             dhlRegistrationService.UpdateDhlRegistration(hdlRegistration);
         }
         catch (Exception e)
         {
             Program.Logger.Error(e);
             return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "Failed", "Error occurred while updating the registration"))));
         }
         return(Ok(GetResponse(ResponseType.ACK, ResponseStatusCode.SUCCESS)));
     }
     else
     {
         return(BadRequest(GetResponse(ResponseType.ERROR, ResponseStatusCode.ERROR, GetError(ErrorCodes.invalidData, "Invalid input", "Please enter proper registration details"))));
     }
 }
Exemplo n.º 5
0
 public void InsertDhlRegistration(HdlRegistration hdlRegistration)
 {
     _dhlRegistrationRepository.Insert(hdlRegistration);
 }
        public async Task <HdlRegistration> AddNewDhlRegistration(HdlRegistration registration)
        {
            var url = URLBuilder.GetURL(Controllers.MAINTENANCE, EndPoint.MAINTENANCE_DHL_REGISTRATION_INSERT);

            return(await requestProvider.PostAsync(url, registration));
        }
        public async Task <HdlRegistration> UpdateDhlRegistration(HdlRegistration registration)
        {
            var url = URLBuilder.GetURL(Controllers.MAINTENANCE, EndPoint.MAINTENANCE_DHL_REGISTRATION_UPDATE);

            return(await requestProvider.PutAsync(url, registration));
        }