Ejemplo n.º 1
0
        internal async static Task <string> DeleteProductAsync(clsAllProducts prProducts)
        {
            using (HttpClient lcHttpClient = new HttpClient())
            {
                HttpResponseMessage lcRespMessage = await lcHttpClient.DeleteAsync
                                                        ($"http://localhost:60064/api/tech/DeleteProduct?ProductCode={prProducts.ProductCode}&DeviceTypeName={prProducts.DeviceTypeName}");

                return(await lcRespMessage.Content.ReadAsStringAsync());
            }
        }
        //--------------------------------- Processing an Order -------------------------------------
        //updates the page to make sure stock has not changes
        private async void updateProductStock()
        {
            try
            {
                _ProductCode = _Product.ProductCode;
                _Product     = await ServiceClient.GetSingleProductAsync(_ProductCode);

                updatePage();
            }
            catch
            {
                tbMessageShow.Text = "Unable to update product";
            }
        }
        //retrieves product details from the DB
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                base.OnNavigatedTo(e);
                if (e.Parameter != null)
                {
                    string lcProductCode = e.Parameter.ToString();
                    _Product = await ServiceClient.GetSingleProductAsync(lcProductCode);

                    updatePage();
                }
                else // no parameter -> new artist!
                {
                    _Product = new clsAllProducts();
                }
            }
            catch
            {
                tbMessageShow.Text = "Unable to populate page";
            }
        }
 public ucUsedProduct(clsAllProducts prPoduct)
 {
     this.InitializeComponent();
     UpdateControl(prPoduct);
 }
 public void UpdateControl(clsAllProducts prProduct)
 {
     tbCondition.Text = prProduct.ItemCondition;
 }
 public void PushData(clsAllProducts prProduct)
 {
     prProduct.ItemCondition = tbCondition.Text;
 }
 public void UpdateControl(clsAllProducts prProduct)
 {
     tbWarranty.Text = prProduct.Warranty.ToString();
 }
 public void PushData(clsAllProducts prProduct)
 {
     prProduct.Warranty = int.Parse(tbWarranty.Text);
 }
Ejemplo n.º 9
0
 internal async static Task <string> UpdateProductAsync(clsAllProducts prProduct)
 {
     return(await InsertOrUpdateAsync(prProduct, "http://localhost:60064/api/tech/PutProduct", "PUT"));
 }
 //opens page for a new product
 private void RunProductNew(clsAllProducts prProduct)
 {
     ctcProdSpecs.Content = new ucNewProduct(prProduct);
     tblNewOrUsed.Text    = ("New");
 }
        //opens page for a used product
        private void RunProductUsed(clsAllProducts prProduct)
        {
            ctcProdSpecs.Content = new ucUsedProduct(prProduct);

            tblNewOrUsed.Text = ("Used");
        }