/// <summary> /// Initializes a new instance of the Pltkw3msApiShipping class. /// </summary> /// <param name='rootHandler'> /// Optional. The http client handler used to handle http transport. /// </param> /// <param name='handlers'> /// Optional. The set of delegating handlers to insert in the http /// client pipeline. /// </param> public Pltkw3msApiShipping(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { this._shipping = new Shipping(this); this._values = new Values(this); this._baseUri = new Uri("https://microsoft-apiapp1068aac855d345fab80f472bc3ee8518.azurewebsites.net"); }
private IShipping ShippingFactory(string shipper, double length, double width, double height, double weight) { Dictionary <string, IShipping> dic = new Dictionary <string, IShipping>() { { "black cat", new BlackCat(weight) }, { "hsinchu", new HsinchuCat(length, width, height) }, { "post office", new PostOfficeCat(length, width, height, weight) }, }; IShipping f = dic[shipper]; //if (shipper.Equals("black cat")) //{ // f = new BlackCat(weight); //} //else if (shipper.Equals("hsinchu")) //{ // f = new HsinchuCat(length, width, height); //} //else if (shipper.Equals("post office")) //{ // f = new PostOfficeCat(length, width, height, weight); //} //else if (f == null) { throw new ArgumentException("shipper not exist"); } return(f); }
/// <summary> /// Initializes a new instance of the Pltkw3msApiShipping class. /// </summary> public Pltkw3msApiShipping() : base() { this._shipping = new Shipping(this); this._values = new Values(this); this._baseUri = new Uri("https://microsoft-apiapp1068aac855d345fab80f472bc3ee8518.azurewebsites.net"); }
/// <param name='operations'> /// Reference to the Pltkw3msApiUI2.ApiShipping.IShipping. /// </param> /// <param name='id'> /// Required. /// </param> public static string GetById(this IShipping operations, int id) { return(Task.Factory.StartNew((object s) => { return ((IShipping)s).GetByIdAsync(id); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <param name='operations'> /// Reference to the Pltkw3msApiUI2.ApiShipping.IShipping. /// </param> /// <param name='value'> /// Required. /// </param> public static object PostByValue(this IShipping operations, string value) { return(Task.Factory.StartNew((object s) => { return ((IShipping)s).PostByValueAsync(value); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Adds the shipping. /// </summary> /// <param name="first">The first.</param> /// <param name="last">The last.</param> /// <param name="address">The address.</param> /// <param name="state">The state.</param> /// <param name="zip">The zip.</param> /// <returns></returns> public override void AddShipping(IShipping shipping) { Queue(AuthorizeDotNetApi.ShipFirstName, shipping.FirstName); Queue(AuthorizeDotNetApi.ShipLastName, shipping.LastName); Queue(AuthorizeDotNetApi.ShipAddress, shipping.Address); Queue(AuthorizeDotNetApi.ShipCity, shipping.City); Queue(AuthorizeDotNetApi.ShipState, shipping.StateOrProvince); Queue(AuthorizeDotNetApi.ShipZip, shipping.Zipcode); }
public decimal CalcOrder(ICart cart, IShipping shipping) { if (shipping.ShipsTo(cart.Region)) { _cartCost = cart.TotalCost; _shippingCost = shipping.TotalCost; return(TotalCost); // Pay(TotalCost); } throw new BlogExceptions.CustomBlogException("ILLEGAL REGION: " + cart.Region); // return 0; }
/// <summary> /// Constructor to Inject Service Dependecies /// </summary> /// <param name="agent"></param> /// <param name="department"></param> /// <param name="emailNotification"></param> /// <param name="membership"></param> /// <param name="membershipUpgrade"></param> /// <param name="order"></param> /// <param name="packingSlip"></param> /// <param name="packingSlipRoyaltyDep"></param> /// <param name="payment"></param> /// <param name="product"></param> /// <param name="shipping"></param> /// <param name="user"></param> /// <param name="videoSubscription"></param> public PaymentController(IAgent agent, IDepartment department, IEmailNotification emailNotification, IMembership membership, IMembershipUpgrade membershipUpgrade, IOrder order, IPackingSlip packingSlip, IPackingSlipRoyaltyDep packingSlipRoyaltyDep, IPayment payment, IProduct product, IShipping shipping, IUser user, IVideoSubscription videoSubscription) { _agent = agent; _department = department; _emailNotification = emailNotification; _membership = membership; _membershipUpgrade = membershipUpgrade; _order = order; _packingSlip = packingSlip; _packingSlipRoyaltyDep = packingSlipRoyaltyDep; _payment = payment; _product = product; _shipping = shipping; _user = user; _videoSubscription = videoSubscription; }
public Cart(IInventory inventory, IShipping shipping) { _inventory = inventory; _shipping = shipping; _products = new List <IProduct>(); }
/// <summary> /// Adds the shipping. /// </summary> /// <param name="first">The first.</param> /// <param name="last">The last.</param> /// <param name="address">The address.</param> /// <param name="state">The state.</param> /// <param name="zip">The zip.</param> /// <returns></returns> public abstract void AddShipping(IShipping shipping);
/// <summary> /// Constructor /// </summary> /// <param name="shipping"></param> public PackingSlipService(IShipping shipping, IPackingSlipRepo packingSlipRepo) { _shipping = shipping; _packingSlipRepo = packingSlipRepo; }
public void SetSuccessor(IShipping <T> shipping) { _successor = shipping; }
/// <param name='operations'> /// Reference to the Pltkw3msApiUI2.ApiShipping.IShipping. /// </param> /// <param name='id'> /// Required. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <string> GetByIdAsync(this IShipping operations, int id, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <string> result = await operations.GetByIdWithOperationResponseAsync(id, cancellationToken).ConfigureAwait(false); return(result.Body); }
/// <param name='operations'> /// Reference to the Pltkw3msApiUI2.ApiShipping.IShipping. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <IList <string> > GetAsync(this IShipping operations, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <System.Collections.Generic.IList <string> > result = await operations.GetWithOperationResponseAsync(cancellationToken).ConfigureAwait(false); return(result.Body); }
/// <param name='operations'> /// Reference to the Pltkw3msApiUI2.ApiShipping.IShipping. /// </param> /// <param name='id'> /// Required. /// </param> /// <param name='value'> /// Required. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <object> PutByIdAndValueAsync(this IShipping operations, int id, string value, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <object> result = await operations.PutByIdAndValueWithOperationResponseAsync(id, value, cancellationToken).ConfigureAwait(false); return(result.Body); }
public void SetShippingType <T>(IShipping <T> shipping) where T : ICanBeShipped => this.Shipping = (IShipping <Package>)shipping;