示例#1
0
        public ServiceDeliveryResponse Delete(Guid identifier)
        {
            ServiceDeliveryResponse response = new ServiceDeliveryResponse();

            try
            {
                ServiceDelivery deletedServiceDelivery = unitOfWork.GetServiceDeliveryRepository().Delete(identifier);

                unitOfWork.Save();

                response.ServiceDelivery = deletedServiceDelivery.ConvertToServiceDeliveryViewModel();
                response.Success         = true;
            }
            catch (Exception ex)
            {
                response.ServiceDelivery = new ServiceDeliveryViewModel();
                response.Success         = false;
                response.Message         = ex.Message;
            }

            return(response);
        }
示例#2
0
        public ServiceDeliveryResponse Create(ServiceDeliveryViewModel re)
        {
            ServiceDeliveryResponse response = new ServiceDeliveryResponse();

            try
            {
                ServiceDelivery addedServiceDelivery = unitOfWork.GetServiceDeliveryRepository().Create(re.ConvertToServiceDelivery());

                unitOfWork.Save();

                response.ServiceDelivery = addedServiceDelivery.ConvertToServiceDeliveryViewModel();
                response.Success         = true;
            }
            catch (Exception ex)
            {
                response.ServiceDelivery = new ServiceDeliveryViewModel();
                response.Success         = false;
                response.Message         = ex.Message;
            }

            return(response);
        }