Beispiel #1
0
        public bool PostParcel(StorePlace storePlace, PersonalData senderData, PersonalData receiverData, float height, float length, float width, float weight, int priority, string type)
        {
            var parcel = new Parcel
            {
                StorePlaceId = storePlace.Id,
                SenderData   = senderData,
                ReceiverData = receiverData,
                ParcelHeight = height,
                ParcelWidth  = width,
                ParcelLength = length,
                ParcelWeight = weight,
                Priority     = priority,
                ReferenceId  = 0,
                ParcelStatus = ParcelStatus.AtPostingPoint
            };

            try
            {
                _parcelService.PostParcel(parcel);
            }
            catch (NothingAddedToDatabaseException e)
            {
                Console.WriteLine(e.ToString());
                return(false);
            }
            return(true);
        }