protected void HandleLoadedCommand(object parameter)
 {
     this.ClientsList   = new ObservableCollection <ContragentListDto>(this.ContragentService.GetContragentsForDropdown());
     this.InquiriesList = new ObservableCollection <InquiryListDto>(this.InquiryService.GetInquiriesList());
     this.OffersList    = new ObservableCollection <OfferListDto>(this.OfferService.GetOffersList());
     this.Creator       = Session.Instance.Username;
     this.creatorId     = this.UserService.GetUsernames().SingleOrDefault(x => x.Username == Creator).Id;
     if (this.SelectedProject != null)
     {
         this.Id   = (int)SelectedProject.Row.ItemArray[0];
         this.Name = (string)SelectedProject.Row.ItemArray[1];
         var offerDto = (OfferListDto)SelectedProject.Row.ItemArray[2];
         this.SelectedOffer = OffersList.SingleOrDefault(x => x.Id == offerDto.Id);
         var inquiryDto = (InquiryListDto)SelectedProject.Row.ItemArray[3];
         this.SelectedInquiry = InquiriesList.SingleOrDefault(x => x.Id == inquiryDto.Id);
         var clientDto = (ContragentListDto)SelectedProject.Row.ItemArray[5];
         this.SelectedClient = ClientsList.SingleOrDefault(x => x.Id == clientDto.Id);
         this.StartDate      = DateTime.ParseExact(SelectedProject.Row.ItemArray[6].ToString(), "dd.MM.yyyy", CultureInfo.InvariantCulture);
         this.EndDate        = (DateTime?)(SelectedProject.Row.ItemArray[7] == DBNull.Value ? null : SelectedProject.Row.ItemArray[7]);
         this.Deadline       = DateTime.ParseExact(SelectedProject.Row.ItemArray[8].ToString(), "dd.MM.yyyy", CultureInfo.InvariantCulture);
         this.ContactTo      = (string)(SelectedProject.Row.ItemArray[9] == DBNull.Value ? "" : SelectedProject.Row.ItemArray[9]);
         this.Telephone      = (string)(SelectedProject.Row.ItemArray[10] == DBNull.Value ? "" : SelectedProject.Row.ItemArray[10]);
         this.Incomes        = (decimal)SelectedProject.Row.ItemArray[11];
         this.Expenses       = (decimal)SelectedProject.Row.ItemArray[12];
         this.Profit         = (decimal)SelectedProject.Row.ItemArray[13];
         this.NotesAndEvents = NoteService.GetLast5NotesAsDataTable(this.Id);
     }
     else
     {
         this.EndDate = null;
     }
 }
Пример #2
0
        public Dictionary <string, decimal> GetMyPriceForSKUs(IEnumerable <string> skus)
        {
            Dictionary <string, decimal> myPriceDictionary = new Dictionary <string, decimal>();

            GetMyPriceForSKURequest requestMyPriceForSku = new GetMyPriceForSKURequest
            {
                SellerId      = m_sellerId,
                MarketplaceId = m_marketPlaceId,
                SellerSKUList = new SellerSKUListType()
            };

            requestMyPriceForSku.SellerSKUList.SellerSKU.AddRange(skus);
            try
            {
                GetMyPriceForSKUResponse response = m_productClient.GetMyPriceForSKU(requestMyPriceForSku);

                List <GetMyPriceForSKUResult> getMyPriceForSkuResultList = response.GetMyPriceForSKUResult;
                foreach (GetMyPriceForSKUResult getMyPriceForSkuResult in getMyPriceForSkuResultList)
                {
                    if (getMyPriceForSkuResult.IsSetProduct())
                    {
                        MarketplaceWebServiceProducts.Model.Product product = getMyPriceForSkuResult.Product;

                        if (product.IsSetOffers())
                        {
                            OffersList       offers    = product.Offers;
                            List <OfferType> offerList = offers.Offer;
                            foreach (OfferType offer in offerList)
                            {
                                if (offer.IsSetBuyingPrice())
                                {
                                    PriceType buyingPrice = offer.BuyingPrice;
                                    if (buyingPrice.IsSetLandedPrice())
                                    {
                                        MoneyType landedPrice2 = buyingPrice.LandedPrice;

                                        if (landedPrice2.IsSetAmount())
                                        {
                                            decimal myPrice = landedPrice2.Amount;
                                            myPriceDictionary.Add(offer.SellerSKU, myPrice);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (MarketplaceWebServiceProductsException e)
            {
                LoggingRepository.Log(LoggingCategory.RepricingScript, string.Format("Exception in 'GetMyPriceForSKU': {0}", e.Message));
            }

            return(myPriceDictionary);
        }
Пример #3
0
 private void OAdapter_OfferClick(object sender, int e)
 {
     new Android.Support.V7.App.AlertDialog.Builder(this)
     .SetIcon(Resource.Drawable.ic_alert)
     .SetTitle("Removing Offer")
     .SetMessage("Are you sure you want to remove this offer?")
     .SetPositiveButton("Yes", (c, ev) =>
     {
         MainActivity.CartOffers.Remove(offersList[e]);
         offersList = MainActivity.CartOffers;
         oAdapter   = new CartOffersListAdapter(offersList);
         oRecycleView.SetAdapter(oAdapter);
     })
     .SetNegativeButton("No", (c, ev) => { })
     .Show();
 }
Пример #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_checkout);

            ISharedPreferences pref = Application.Context.GetSharedPreferences("UserInfo", FileCreationMode.Private);

            userName = pref.GetString("Username", String.Empty);

            controller         = new Controller();
            userInfo           = controller.RetreiveUser(userName);
            TotPrice           = (TextView)FindViewById(Resource.Id.checkoutListTPTextView);
            TotTax             = (TextView)FindViewById(Resource.Id.checkoutListTPTTextView);
            TotPriceAfTax      = (TextView)FindViewById(Resource.Id.checkoutListTPATTextView);
            otherLocation      = (EditText)FindViewById(Resource.Id.otherLocationEditText);
            spinner            = FindViewById <Spinner>(Resource.Id.payMethSpinner);
            confirmPurchaseBtn = FindViewById <Button>(Resource.Id.ConfirmPurchaseBtn);
            confirmPurchaseBtn = (Button)FindViewById(Resource.Id.ConfirmPurchaseBtn);
            locationRG         = (RadioGroup)FindViewById(Resource.Id.LocationRadioGrp);
            locationRG.Check(0);
            locationRG.CheckedChange += LocationRG_CheckedChange;
            spinner.ItemSelected     += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);
            var adapter = ArrayAdapter.CreateFromResource(
                this, Resource.Array.paymentMethArray, Android.Resource.Layout.SimpleSpinnerItem);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter = adapter;

            items  = MainActivity.CartItems;
            offers = MainActivity.CartOffers;
            for (int i = 0; i < offers.numoffers; i++)
            {
                Item item = new Item(3, 4, offers[i].offerName, "d", null, 4, offers[i].offerPrice, 1, " ", 1);             //Adding Offer as an Item
                items.Add(item);
            }
            mRecycleView   = FindViewById <RecyclerView>(Resource.Id.ItemsCheckoutRecyclerView);
            mLayoutManager = new LinearLayoutManager(this);
            mRecycleView.SetLayoutManager(mLayoutManager);
            mAdapter                  = new CheckoutListAdapter(items);
            mAdapter.ItemClick       += MAdapter_ItemClick;;
            confirmPurchaseBtn.Click += ConfirmPurchaseBtn_Click;
            mRecycleView.SetAdapter(mAdapter);
            TotPrice.Text      = items.CalcTotal().ToString();
            TotTax.Text        = items.CalcTax().ToString();
            TotPriceAfTax.Text = (items.CalcTotal() + items.CalcTax() + 10).ToString();
        }
Пример #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            offersList = new OffersList(0);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_offers);
            myCart = (LinearLayout)FindViewById(Resource.Id.cartInOffers);

            if (!MainActivity.CartItems.isEmpty() || !MainActivity.CartOffers.isEmpty())
            {
                myCart.Visibility = ViewStates.Visible;
                myCart.Click     += MyCart_Click;;
            }

            mRecycleView   = FindViewById <RecyclerView>(Resource.Id.offersRecyclerView);
            mLayoutManager = new LinearLayoutManager(this);
            mRecycleView.SetLayoutManager(mLayoutManager);
            mAdapter            = new OffersListAdapter(offersList);
            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);
        }
Пример #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_my_cart);
            itemsList      = MainActivity.CartItems;
            mRecycleView   = FindViewById <RecyclerView>(Resource.Id.myCartItemsRecyclerView);
            mLayoutManager = new LinearLayoutManager(this);
            mRecycleView.SetLayoutManager(mLayoutManager);
            mAdapter            = new CartItemsListAdapter(itemsList);
            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);
            offersList = MainActivity.CartOffers;

            oRecycleView   = FindViewById <RecyclerView>(Resource.Id.myCartOffersRecyclerView);
            oLayoutManager = new LinearLayoutManager(this);
            oRecycleView.SetLayoutManager(oLayoutManager);
            oAdapter             = new CartOffersListAdapter(offersList);
            oAdapter.OfferClick += OAdapter_OfferClick;
            oRecycleView.SetAdapter(oAdapter);
            TextView proceedCheck = (TextView)FindViewById(Resource.Id.proceedCheckoutTV);

            proceedCheck.Click += ProceedCheck_Click;
            // Create your application here
        }
Пример #7
0
 public OffersListAdapter(OffersList offers)
 {
     this.offers = offers;
 }
        /// <summary>
        /// Gets some of the lowest prices based on the product identified by the given
        /// SellerId and SKU.
        ///
        /// </summary>
        /// <param name="service">Instance of MarketplaceWebServiceProducts service</param>
        /// <param name="request">GetLowestOfferListingsForSKURequest request</param>
        public static void InvokeGetLowestOfferListingsForSKU(MarketplaceWebServiceProducts service, GetLowestOfferListingsForSKURequest request)
        {
            try
            {
                GetLowestOfferListingsForSKUResponse response = service.GetLowestOfferListingsForSKU(request);


                Console.WriteLine("Service Response");
                Console.WriteLine("=============================================================================");
                Console.WriteLine();

                Console.WriteLine("        GetLowestOfferListingsForSKUResponse");
                List <GetLowestOfferListingsForSKUResult> getLowestOfferListingsForSKUResultList = response.GetLowestOfferListingsForSKUResult;
                foreach (GetLowestOfferListingsForSKUResult getLowestOfferListingsForSKUResult in getLowestOfferListingsForSKUResultList)
                {
                    Console.WriteLine("            GetLowestOfferListingsForSKUResult");
                    if (getLowestOfferListingsForSKUResult.IsSetSellerSKU())
                    {
                        Console.WriteLine("        SellerSKU");
                        Console.WriteLine();
                        Console.WriteLine("                {0}", getLowestOfferListingsForSKUResult.SellerSKU);
                        Console.WriteLine();
                    }
                    if (getLowestOfferListingsForSKUResult.IsSetstatus())
                    {
                        Console.WriteLine("        status");
                        Console.WriteLine();
                        Console.WriteLine("                {0}", getLowestOfferListingsForSKUResult.status);
                        Console.WriteLine();
                    }
                    if (getLowestOfferListingsForSKUResult.IsSetAllOfferListingsConsidered())
                    {
                        Console.WriteLine("                AllOfferListingsConsidered");
                        Console.WriteLine("                    {0}", getLowestOfferListingsForSKUResult.AllOfferListingsConsidered);
                    }
                    if (getLowestOfferListingsForSKUResult.IsSetProduct())
                    {
                        Console.WriteLine("                Product");
                        Product product = getLowestOfferListingsForSKUResult.Product;
                        if (product.IsSetIdentifiers())
                        {
                            Console.WriteLine("                    Identifiers");
                            IdentifierType identifiers = product.Identifiers;
                            if (identifiers.IsSetMarketplaceASIN())
                            {
                                Console.WriteLine("                        MarketplaceASIN");
                                ASINIdentifier marketplaceASIN = identifiers.MarketplaceASIN;
                                if (marketplaceASIN.IsSetMarketplaceId())
                                {
                                    Console.WriteLine("                            MarketplaceId");
                                    Console.WriteLine("                                {0}", marketplaceASIN.MarketplaceId);
                                }
                                if (marketplaceASIN.IsSetASIN())
                                {
                                    Console.WriteLine("                            ASIN");
                                    Console.WriteLine("                                {0}", marketplaceASIN.ASIN);
                                }
                            }
                            if (identifiers.IsSetSKUIdentifier())
                            {
                                Console.WriteLine("                        SKUIdentifier");
                                SellerSKUIdentifier SKUIdentifier = identifiers.SKUIdentifier;
                                if (SKUIdentifier.IsSetMarketplaceId())
                                {
                                    Console.WriteLine("                            MarketplaceId");
                                    Console.WriteLine("                                {0}", SKUIdentifier.MarketplaceId);
                                }
                                if (SKUIdentifier.IsSetSellerId())
                                {
                                    Console.WriteLine("                            SellerId");
                                    Console.WriteLine("                                {0}", SKUIdentifier.SellerId);
                                }
                                if (SKUIdentifier.IsSetSellerSKU())
                                {
                                    Console.WriteLine("                            SellerSKU");
                                    Console.WriteLine("                                {0}", SKUIdentifier.SellerSKU);
                                }
                            }
                        }
                        if (product.IsSetCompetitivePricing())
                        {
                            Console.WriteLine("                    CompetitivePricing");
                            CompetitivePricingType competitivePricing = product.CompetitivePricing;
                            if (competitivePricing.IsSetCompetitivePrices())
                            {
                                Console.WriteLine("                        CompetitivePrices");
                                CompetitivePriceList        competitivePrices    = competitivePricing.CompetitivePrices;
                                List <CompetitivePriceType> competitivePriceList = competitivePrices.CompetitivePrice;
                                foreach (CompetitivePriceType competitivePrice in competitivePriceList)
                                {
                                    Console.WriteLine("                            CompetitivePrice");
                                    if (competitivePrice.IsSetcondition())
                                    {
                                        Console.WriteLine("                        condition");
                                        Console.WriteLine();
                                        Console.WriteLine("                                {0}", competitivePrice.condition);
                                        Console.WriteLine();
                                    }
                                    if (competitivePrice.IsSetsubcondition())
                                    {
                                        Console.WriteLine("                        subcondition");
                                        Console.WriteLine();
                                        Console.WriteLine("                                {0}", competitivePrice.subcondition);
                                        Console.WriteLine();
                                    }
                                    if (competitivePrice.IsSetbelongsToRequester())
                                    {
                                        Console.WriteLine("                        belongsToRequester");
                                        Console.WriteLine();
                                        Console.WriteLine("                                {0}", competitivePrice.belongsToRequester);
                                        Console.WriteLine();
                                    }
                                    if (competitivePrice.IsSetCompetitivePriceId())
                                    {
                                        Console.WriteLine("                                CompetitivePriceId");
                                        Console.WriteLine("                                    {0}", competitivePrice.CompetitivePriceId);
                                    }
                                    if (competitivePrice.IsSetPrice())
                                    {
                                        Console.WriteLine("                                Price");
                                        PriceType price = competitivePrice.Price;
                                        if (price.IsSetLandedPrice())
                                        {
                                            Console.WriteLine("                                    LandedPrice");
                                            MoneyType landedPrice = price.LandedPrice;
                                            if (landedPrice.IsSetCurrencyCode())
                                            {
                                                Console.WriteLine("                                        CurrencyCode");
                                                Console.WriteLine("                                            {0}", landedPrice.CurrencyCode);
                                            }
                                            if (landedPrice.IsSetAmount())
                                            {
                                                Console.WriteLine("                                        Amount");
                                                Console.WriteLine("                                            {0}", landedPrice.Amount);
                                            }
                                        }
                                        if (price.IsSetListingPrice())
                                        {
                                            Console.WriteLine("                                    ListingPrice");
                                            MoneyType listingPrice = price.ListingPrice;
                                            if (listingPrice.IsSetCurrencyCode())
                                            {
                                                Console.WriteLine("                                        CurrencyCode");
                                                Console.WriteLine("                                            {0}", listingPrice.CurrencyCode);
                                            }
                                            if (listingPrice.IsSetAmount())
                                            {
                                                Console.WriteLine("                                        Amount");
                                                Console.WriteLine("                                            {0}", listingPrice.Amount);
                                            }
                                        }
                                        if (price.IsSetShipping())
                                        {
                                            Console.WriteLine("                                    Shipping");
                                            MoneyType shipping = price.Shipping;
                                            if (shipping.IsSetCurrencyCode())
                                            {
                                                Console.WriteLine("                                        CurrencyCode");
                                                Console.WriteLine("                                            {0}", shipping.CurrencyCode);
                                            }
                                            if (shipping.IsSetAmount())
                                            {
                                                Console.WriteLine("                                        Amount");
                                                Console.WriteLine("                                            {0}", shipping.Amount);
                                            }
                                        }
                                    }
                                }
                            }
                            if (competitivePricing.IsSetNumberOfOfferListings())
                            {
                                Console.WriteLine("                        NumberOfOfferListings");
                                NumberOfOfferListingsList    numberOfOfferListings = competitivePricing.NumberOfOfferListings;
                                List <OfferListingCountType> offerListingCountList = numberOfOfferListings.OfferListingCount;
                                foreach (OfferListingCountType offerListingCount in offerListingCountList)
                                {
                                    Console.WriteLine("                            OfferListingCount");
                                    if (offerListingCount.IsSetcondition())
                                    {
                                        Console.WriteLine("                        condition");
                                        Console.WriteLine();
                                        Console.WriteLine("                                {0}", offerListingCount.condition);
                                        Console.WriteLine();
                                    }
                                    if (offerListingCount.IsSetValue())
                                    {
                                        Console.WriteLine("                        Value");
                                        Console.WriteLine();
                                        Console.WriteLine("                                {0}", offerListingCount.Value);
                                    }
                                }
                            }
                            if (competitivePricing.IsSetTradeInValue())
                            {
                                Console.WriteLine("                        TradeInValue");
                                MoneyType tradeInValue = competitivePricing.TradeInValue;
                                if (tradeInValue.IsSetCurrencyCode())
                                {
                                    Console.WriteLine("                            CurrencyCode");
                                    Console.WriteLine("                                {0}", tradeInValue.CurrencyCode);
                                }
                                if (tradeInValue.IsSetAmount())
                                {
                                    Console.WriteLine("                            Amount");
                                    Console.WriteLine("                                {0}", tradeInValue.Amount);
                                }
                            }
                        }
                        if (product.IsSetSalesRankings())
                        {
                            Console.WriteLine("                    SalesRankings");
                            SalesRankList        salesRankings = product.SalesRankings;
                            List <SalesRankType> salesRankList = salesRankings.SalesRank;
                            foreach (SalesRankType salesRank in salesRankList)
                            {
                                Console.WriteLine("                        SalesRank");
                                if (salesRank.IsSetProductCategoryId())
                                {
                                    Console.WriteLine("                            ProductCategoryId");
                                    Console.WriteLine("                                {0}", salesRank.ProductCategoryId);
                                }
                                if (salesRank.IsSetRank())
                                {
                                    Console.WriteLine("                            Rank");
                                    Console.WriteLine("                                {0}", salesRank.Rank);
                                }
                            }
                        }
                        if (product.IsSetLowestOfferListings())
                        {
                            Console.WriteLine("                    LowestOfferListings");
                            LowestOfferListingList        lowestOfferListings    = product.LowestOfferListings;
                            List <LowestOfferListingType> lowestOfferListingList = lowestOfferListings.LowestOfferListing;
                            foreach (LowestOfferListingType lowestOfferListing in lowestOfferListingList)
                            {
                                Console.WriteLine("                        LowestOfferListing");
                                if (lowestOfferListing.IsSetQualifiers())
                                {
                                    Console.WriteLine("                            Qualifiers");
                                    QualifiersType qualifiers = lowestOfferListing.Qualifiers;
                                    if (qualifiers.IsSetItemCondition())
                                    {
                                        Console.WriteLine("                                ItemCondition");
                                        Console.WriteLine("                                    {0}", qualifiers.ItemCondition);
                                    }
                                    if (qualifiers.IsSetItemSubcondition())
                                    {
                                        Console.WriteLine("                                ItemSubcondition");
                                        Console.WriteLine("                                    {0}", qualifiers.ItemSubcondition);
                                    }
                                    if (qualifiers.IsSetFulfillmentChannel())
                                    {
                                        Console.WriteLine("                                FulfillmentChannel");
                                        Console.WriteLine("                                    {0}", qualifiers.FulfillmentChannel);
                                    }
                                    if (qualifiers.IsSetShipsDomestically())
                                    {
                                        Console.WriteLine("                                ShipsDomestically");
                                        Console.WriteLine("                                    {0}", qualifiers.ShipsDomestically);
                                    }
                                    if (qualifiers.IsSetShippingTime())
                                    {
                                        Console.WriteLine("                                ShippingTime");
                                        ShippingTimeType shippingTime = qualifiers.ShippingTime;
                                        if (shippingTime.IsSetMax())
                                        {
                                            Console.WriteLine("                                    Max");
                                            Console.WriteLine("                                        {0}", shippingTime.Max);
                                        }
                                    }
                                    if (qualifiers.IsSetSellerPositiveFeedbackRating())
                                    {
                                        Console.WriteLine("                                SellerPositiveFeedbackRating");
                                        Console.WriteLine("                                    {0}", qualifiers.SellerPositiveFeedbackRating);
                                    }
                                }
                                if (lowestOfferListing.IsSetNumberOfOfferListingsConsidered())
                                {
                                    Console.WriteLine("                            NumberOfOfferListingsConsidered");
                                    Console.WriteLine("                                {0}", lowestOfferListing.NumberOfOfferListingsConsidered);
                                }
                                if (lowestOfferListing.IsSetSellerFeedbackCount())
                                {
                                    Console.WriteLine("                            SellerFeedbackCount");
                                    Console.WriteLine("                                {0}", lowestOfferListing.SellerFeedbackCount);
                                }
                                if (lowestOfferListing.IsSetPrice())
                                {
                                    Console.WriteLine("                            Price");
                                    PriceType price1 = lowestOfferListing.Price;
                                    if (price1.IsSetLandedPrice())
                                    {
                                        Console.WriteLine("                                LandedPrice");
                                        MoneyType landedPrice1 = price1.LandedPrice;
                                        if (landedPrice1.IsSetCurrencyCode())
                                        {
                                            Console.WriteLine("                                    CurrencyCode");
                                            Console.WriteLine("                                        {0}", landedPrice1.CurrencyCode);
                                        }
                                        if (landedPrice1.IsSetAmount())
                                        {
                                            Console.WriteLine("                                    Amount");
                                            Console.WriteLine("                                        {0}", landedPrice1.Amount);
                                        }
                                    }
                                    if (price1.IsSetListingPrice())
                                    {
                                        Console.WriteLine("                                ListingPrice");
                                        MoneyType listingPrice1 = price1.ListingPrice;
                                        if (listingPrice1.IsSetCurrencyCode())
                                        {
                                            Console.WriteLine("                                    CurrencyCode");
                                            Console.WriteLine("                                        {0}", listingPrice1.CurrencyCode);
                                        }
                                        if (listingPrice1.IsSetAmount())
                                        {
                                            Console.WriteLine("                                    Amount");
                                            Console.WriteLine("                                        {0}", listingPrice1.Amount);
                                        }
                                    }
                                    if (price1.IsSetShipping())
                                    {
                                        Console.WriteLine("                                Shipping");
                                        MoneyType shipping1 = price1.Shipping;
                                        if (shipping1.IsSetCurrencyCode())
                                        {
                                            Console.WriteLine("                                    CurrencyCode");
                                            Console.WriteLine("                                        {0}", shipping1.CurrencyCode);
                                        }
                                        if (shipping1.IsSetAmount())
                                        {
                                            Console.WriteLine("                                    Amount");
                                            Console.WriteLine("                                        {0}", shipping1.Amount);
                                        }
                                    }
                                }
                                if (lowestOfferListing.IsSetMultipleOffersAtLowestPrice())
                                {
                                    Console.WriteLine("                            MultipleOffersAtLowestPrice");
                                    Console.WriteLine("                                {0}", lowestOfferListing.MultipleOffersAtLowestPrice);
                                }
                            }
                        }
                        if (product.IsSetOffers())
                        {
                            Console.WriteLine("                    Offers");
                            OffersList       offers    = product.Offers;
                            List <OfferType> offerList = offers.Offer;
                            foreach (OfferType offer in offerList)
                            {
                                Console.WriteLine("                        Offer");
                                if (offer.IsSetBuyingPrice())
                                {
                                    Console.WriteLine("                            BuyingPrice");
                                    PriceType buyingPrice = offer.BuyingPrice;
                                    if (buyingPrice.IsSetLandedPrice())
                                    {
                                        Console.WriteLine("                                LandedPrice");
                                        MoneyType landedPrice2 = buyingPrice.LandedPrice;
                                        if (landedPrice2.IsSetCurrencyCode())
                                        {
                                            Console.WriteLine("                                    CurrencyCode");
                                            Console.WriteLine("                                        {0}", landedPrice2.CurrencyCode);
                                        }
                                        if (landedPrice2.IsSetAmount())
                                        {
                                            Console.WriteLine("                                    Amount");
                                            Console.WriteLine("                                        {0}", landedPrice2.Amount);
                                        }
                                    }
                                    if (buyingPrice.IsSetListingPrice())
                                    {
                                        Console.WriteLine("                                ListingPrice");
                                        MoneyType listingPrice2 = buyingPrice.ListingPrice;
                                        if (listingPrice2.IsSetCurrencyCode())
                                        {
                                            Console.WriteLine("                                    CurrencyCode");
                                            Console.WriteLine("                                        {0}", listingPrice2.CurrencyCode);
                                        }
                                        if (listingPrice2.IsSetAmount())
                                        {
                                            Console.WriteLine("                                    Amount");
                                            Console.WriteLine("                                        {0}", listingPrice2.Amount);
                                        }
                                    }
                                    if (buyingPrice.IsSetShipping())
                                    {
                                        Console.WriteLine("                                Shipping");
                                        MoneyType shipping2 = buyingPrice.Shipping;
                                        if (shipping2.IsSetCurrencyCode())
                                        {
                                            Console.WriteLine("                                    CurrencyCode");
                                            Console.WriteLine("                                        {0}", shipping2.CurrencyCode);
                                        }
                                        if (shipping2.IsSetAmount())
                                        {
                                            Console.WriteLine("                                    Amount");
                                            Console.WriteLine("                                        {0}", shipping2.Amount);
                                        }
                                    }
                                }
                                if (offer.IsSetRegularPrice())
                                {
                                    Console.WriteLine("                            RegularPrice");
                                    MoneyType regularPrice = offer.RegularPrice;
                                    if (regularPrice.IsSetCurrencyCode())
                                    {
                                        Console.WriteLine("                                CurrencyCode");
                                        Console.WriteLine("                                    {0}", regularPrice.CurrencyCode);
                                    }
                                    if (regularPrice.IsSetAmount())
                                    {
                                        Console.WriteLine("                                Amount");
                                        Console.WriteLine("                                    {0}", regularPrice.Amount);
                                    }
                                }
                                if (offer.IsSetFulfillmentChannel())
                                {
                                    Console.WriteLine("                            FulfillmentChannel");
                                    Console.WriteLine("                                {0}", offer.FulfillmentChannel);
                                }
                                if (offer.IsSetItemCondition())
                                {
                                    Console.WriteLine("                            ItemCondition");
                                    Console.WriteLine("                                {0}", offer.ItemCondition);
                                }
                                if (offer.IsSetItemSubCondition())
                                {
                                    Console.WriteLine("                            ItemSubCondition");
                                    Console.WriteLine("                                {0}", offer.ItemSubCondition);
                                }
                                if (offer.IsSetSellerId())
                                {
                                    Console.WriteLine("                            SellerId");
                                    Console.WriteLine("                                {0}", offer.SellerId);
                                }
                                if (offer.IsSetSellerSKU())
                                {
                                    Console.WriteLine("                            SellerSKU");
                                    Console.WriteLine("                                {0}", offer.SellerSKU);
                                }
                            }
                        }
                    }
                    if (getLowestOfferListingsForSKUResult.IsSetError())
                    {
                        Console.WriteLine("                Error");
                        Error error = getLowestOfferListingsForSKUResult.Error;
                        if (error.IsSetType())
                        {
                            Console.WriteLine("                    Type");
                            Console.WriteLine("                        {0}", error.Type);
                        }
                        if (error.IsSetCode())
                        {
                            Console.WriteLine("                    Code");
                            Console.WriteLine("                        {0}", error.Code);
                        }
                        if (error.IsSetMessage())
                        {
                            Console.WriteLine("                    Message");
                            Console.WriteLine("                        {0}", error.Message);
                        }
                    }
                }
                if (response.IsSetResponseMetadata())
                {
                    Console.WriteLine("            ResponseMetadata");
                    ResponseMetadata responseMetadata = response.ResponseMetadata;
                    if (responseMetadata.IsSetRequestId())
                    {
                        Console.WriteLine("                RequestId");
                        Console.WriteLine("                    {0}", responseMetadata.RequestId);
                    }
                }
                Console.WriteLine("            ResponseHeaderMetadata");
                Console.WriteLine("                RequestId");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.RequestId);
                Console.WriteLine("                ResponseContext");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.ResponseContext);
                Console.WriteLine("                Timestamp");
                Console.WriteLine("                    " + response.ResponseHeaderMetadata.Timestamp);
                Console.WriteLine();
            }
            catch (MarketplaceWebServiceProductsException ex)
            {
                Console.WriteLine("Caught Exception: " + ex.Message);
                Console.WriteLine("Response Status Code: " + ex.StatusCode);
                Console.WriteLine("Error Code: " + ex.ErrorCode);
                Console.WriteLine("Error Type: " + ex.ErrorType);
                Console.WriteLine("Request ID: " + ex.RequestId);
                Console.WriteLine("XML: " + ex.XML);
                Console.WriteLine("ResponseHeaderMetadata: " + ex.ResponseHeaderMetadata);
            }
        }
Пример #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_drawer);
            CartItems  = new ItemsList();
            CartOffers = new OffersList();
            SupportFragmentManager.BeginTransaction()
            .Add(Resource.Id.content_frame, new HomeFragment())
            .Commit();
            //Finding toolbar and adding to actionbar
            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            //For showing back button
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            //setting Hamburger icon Here
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
            //Getting Drawer Layout declared in UI and handling closing and open events
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            drawerLayout.DrawerOpened += DrawerLayout_DrawerOpened;
            drawerLayout.DrawerClosed += DrawerLayout_DrawerClosed;
            navigationView             = FindViewById <NavigationView>(Resource.Id.nav_view);
            toggle = new Android.Support.V7.App.ActionBarDrawerToggle
                     (
                this,
                drawerLayout,
                Resource.String.openDrawer,
                Resource.String.closeDrawer
                     );
            drawerLayout.AddDrawerListener(toggle);
            //Synchronize the state of the drawer indicator/affordance with the linked DrawerLayout
            toggle.SyncState();
            //Handling click events on Menu items
            navigationView.NavigationItemSelected += (sender, e) =>
            {
                if (previousItem != null)
                {
                    previousItem.SetChecked(false);
                }

                navigationView.SetCheckedItem(e.MenuItem.ItemId);

                previousItem = e.MenuItem;

                switch (e.MenuItem.ItemId)
                {
                case Resource.Id.nav_home:
                    ListItemClicked(0);
                    break;

                case Resource.Id.nav_profile:
                    ListItemClicked(1);
                    break;

                case Resource.Id.nav_payment:
                    ListItemClicked(2);
                    break;

                case Resource.Id.nav_FAQ:
                    ListItemClicked(3);
                    break;

                case Resource.Id.nav_contactUs:
                    ListItemClicked(4);
                    break;

                case Resource.Id.nav_logOut:
                    ListItemClicked(5);
                    break;

                case Resource.Id.nav_current_order:
                    ListItemClicked(6);
                    break;

                case Resource.Id.nav_my_orders:
                    ListItemClicked(7);
                    break;

                case Resource.Id.nav_request:
                    ListItemClicked(8);
                    break;
                }

                drawerLayout.CloseDrawers();
            };
        }
Пример #10
0
        protected void btnSelect_Click(object sender, EventArgs e)
        {
            InquiryData inquiryData      = Parent as InquiryData;
            OffersList  offersListFilter = Parent.Page as OffersList;

            if (inquiryData != null)
            {
                foreach (GridViewRow row in gvProfilesList.Rows)
                {
                    CheckBox chbxSelectProfile = row.FindControl("chbxSelectProfile") as CheckBox;

                    if (chbxSelectProfile.Checked)
                    {
                        HiddenField hdnProfileName        = row.FindControl("hdnProfileName") as HiddenField;
                        TextBox     tbxProfileSettingName = inquiryData.FindControl("tbxProfileSettingName") as TextBox;

                        if (tbxProfileSettingName != null)
                        {
                            tbxProfileSettingName.Text = hdnProfileName.Value;
                        }

                        HiddenField hdnRowMasterKey     = row.FindControl("hdnRowMasterKey") as HiddenField;
                        HiddenField hdnIdProfileSetting = inquiryData.FindControl("hdnIdProfileSetting") as HiddenField;


                        if (hdnIdProfileSetting != null)
                        {
                            hdnIdProfileSetting.Value = hdnRowMasterKey.Value;
                            inquiryData.ReloadDimensionCTRLByProfileSettingID(hdnRowMasterKey.Value);
                        }


                        break;
                    }
                }
            }
            else if (offersListFilter != null)
            {
                foreach (GridViewRow row in gvProfilesList.Rows)
                {
                    CheckBox chbxSelectProfile = row.FindControl("chbxSelectProfile") as CheckBox;

                    if (chbxSelectProfile.Checked)
                    {
                        HiddenField hdnProfileName          = row.FindControl("hdnProfileName") as HiddenField;
                        HiddenField hdnIdProfileSettingText = FindControlById(offersListFilter.ContentPlaceHolder, "hdnIdProfileSettingText") as HiddenField;

                        if (hdnIdProfileSettingText != null)
                        {
                            hdnIdProfileSettingText.Value = hdnProfileName.Value;
                        }

                        HiddenField hdnRowMasterKey = row.FindControl("hdnRowMasterKey") as HiddenField;
                        HiddenField hdnProfileID    = FindControlById(offersListFilter.ContentPlaceHolder, "hdnProfileID") as HiddenField;

                        if (hdnProfileID != null)
                        {
                            hdnProfileID.Value = hdnRowMasterKey.Value;
                        }

                        break;
                    }
                }
            }
            else
            {
                return;
            }

            if (inquiryData != null)
            {
                this.Visible = false;
                inquiryData.Focus();
            }
            else
            {
                this.Visible = false;
                //offersListFilter.Focus();
                offersListFilter.ReloadFilterPanel();
            }
        }
Пример #11
0
 public void setOffers(OffersList Offers)
 {
     this.Offers = Offers;
 }
Пример #12
0
 public CartOffersListAdapter(OffersList mOffers)
 {
     Offers = mOffers;
 }