Example #1
0
        /// <summary>
        /// Initializes the instance of this MainView.
        /// Because error logging mechanism uses the MainView's console, it needs to be called only after the handle for the window
        /// has been created --> during the "Load" event or later (after the form has been created and shown).
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void initialize(object sender, EventArgs e)
        {
            Config         = new MKMToolConfig();
            timer.Interval = 1440 * 1000 * 60; // set the interval to one day (1440 minutes in ms)
            try
            {
                var doc2 = MKMInteract.RequestHelper.getAccount();

                if (Config.MyCountryCode == "") // signifies user wants auto-detect, otherwise the chosen setting overrides what we get from MKM
                {
                    Config.MyCountryCode = doc2["response"]["account"]["country"].InnerText;
                }
                MKMHelpers.sMyId = doc2["response"]["account"]["idUser"].InnerText;
            }
            catch (Exception eError)
            {
                MKMHelpers.LogError("initializing product list and account info", eError.Message, true);
            }
            bot                      = new MKMBot();
            settingsWindow           = new UpdatePriceSettings("LastSettingsPreset", "Settings of Update Price");
            stockViewWindow          = new StockView();
            checkCheapDealsWindow    = new CheckWantsView();
            checkDisplayPricesWindow = new CheckDisplayPrices();
            wantlistEditorViewWindow = new WantlistEditorView();
            priceExternalListWindow  = new PriceExternalList();
        }
Example #2
0
        private void readStockButton_Click(object sender, EventArgs e)
        {
            /*           MKMBot bot = new MKMBot();
             #if !DEBUG
             * bot.getProductList(this);
             #endif*/
            var sv1 = new StockView();

            sv1.ShowDialog();
        }
Example #3
0
 private void viewInventoryButton_Click(object sender, EventArgs e)
 {
     if (stockViewWindow.IsDisposed)
     {
         stockViewWindow = new StockView();
     }
     if (stockViewWindow.Visible)
     {
         stockViewWindow.Hide();
     }
     else
     {
         stockViewWindow.Show(this);
     }
 }