コード例 #1
0
        private void PreviousButton_Copy_Click(object sender, RoutedEventArgs e)
        {
            if (coresTextBox1.Text != "" && coresTextBox2.Text != "" && frenqTextBox1.Text != "" &&
                frenqTextBox2.Text != "" && priceTextBox1.Text != "" && priceTextBox2.Text != "")
            {
                lowBorderCalc calc = new lowBorderCalc(int.Parse(coresTextBox1.Text), int.Parse(coresTextBox2.Text),
                                                       int.Parse(frenqTextBox1.Text), int.Parse(frenqTextBox2.Text), int.Parse(priceTextBox1.Text),
                                                       int.Parse(priceTextBox2.Text));
                foundedLabel.Opacity = 100;

                if (calc.countFoundedCPUs == 1)
                {
                    foundedLabel.Content    = "Найден подходящий товар, \nчтобы увидеть его - \nнажмите кнопку продолжить, \nповторно!";
                    foundedLabel.Background = Brushes.Green;
                    fountLabel.Visibility   = Visibility.Hidden;
                    WindowShowProduct shower = new WindowShowProduct(calc.indexFoundedCPUs[0], this);
                    shower.Show();
                    Hide();
                }
                else if (calc.countFoundedCPUs <= 0)
                {
                    foundedLabel.Content    = "Не найдено подходящих \nтоваров. \nРасширьте границы!";
                    fountLabel.Visibility   = Visibility.Hidden;
                    foundedLabel.Background = Brushes.OrangeRed;
                }
                else
                {
                    foundedLabel.Content  = "Найдено несколько(" + calc.countFoundedCPUs + ") \nсоответствующих критериям \nтоваров. \nCузьте границы!";
                    fountLabel.Visibility = Visibility.Visible;
                    tmpCalc = calc;
                    foundedLabel.Background = Brushes.Orange;
                }
            }
        }
コード例 #2
0
 private void PreviousButton_Copy_Click(object sender, RoutedEventArgs e)
 {
     if (coresTextBox.Text != "" && taktTextBox.Text != "" && priceTextBox.Text != "")
     {
         calc = new obsCalcClass(float.Parse(coresTextBox.Text), float.Parse(taktTextBox.Text), float.Parse(priceTextBox.Text));
         WindowShowProduct shower = new WindowShowProduct(calc.indexFounded, this);
         Hide();
         shower.Show();
     }
 }
コード例 #3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            leksiCalcClass calc = new leksiCalcClass(gridStatus);

            calc.Calc();
            if (calc.countFounded == 1)
            {
                WindowShowProduct shower = new WindowShowProduct(calc.indexFounded, this);
                shower.Show();
                Hide();
            }
        }
コード例 #4
0
        private void PreviousButton_Copy_Click(object sender, RoutedEventArgs e)
        {
            ComboBoxItem      cmb  = mainKriteriiBox.SelectedValue as ComboBoxItem;
            SubOptimCalcClass calc = null;

            if (Convert.ToString(cmb.Content) == "Количество ядер")
            {
                calc = new SubOptimCalcClass(Convert.ToString(cmb.Content), int.Parse(taktTextBox1.Text),
                                             int.Parse(taktTextBox2.Text), int.Parse(priceTextBox1.Text), int.Parse(priceTextBox2.Text));
            }
            if (Convert.ToString(cmb.Content) == "Тактовая частота")
            {
                calc = new SubOptimCalcClass(Convert.ToString(cmb.Content), int.Parse(coresTextBox1.Text),
                                             int.Parse(coresTextBox2.Text), int.Parse(priceTextBox1.Text), int.Parse(priceTextBox2.Text));
            }
            if (Convert.ToString(cmb.Content) == "Цена")
            {
                calc = new SubOptimCalcClass(Convert.ToString(cmb.Content), int.Parse(coresTextBox1.Text),
                                             int.Parse(coresTextBox2.Text), int.Parse(taktTextBox1.Text), int.Parse(taktTextBox2.Text));
            }
            if (calc.oneCPU)
            {
                foundedLabel.Content    = "Найден подходящий товар, \nчтобы увидеть его - \nнажмите кнопку продолжить, \nповторно!";
                foundedLabel.Background = Brushes.Green;
                foundedLabel.Opacity    = 100;
                WindowShowProduct shower = new WindowShowProduct(calc.foundedIndexCpus[0], this);
                fountLabel.Visibility = Visibility.Hidden;
                shower.Show();
                Hide();
            }
            else if (calc.countFounded > 1)
            {
                foundedLabel.Content    = "Найдено несколько(" + calc.countFounded + ") \nсоответствующих критериям \nтоваров. \nCузьте границы!";
                foundedLabel.Background = Brushes.Orange;
                fountLabel.Visibility   = Visibility.Visible;
                tmpcalc = calc;
                foundedLabel.Opacity = 100;
            }
            else if (calc.countFounded == 0)
            {
                foundedLabel.Opacity    = 100;
                foundedLabel.Content    = "Не найдено подходящих \nтоваров. \nРасширьте границы!";
                fountLabel.Visibility   = Visibility.Hidden;
                foundedLabel.Background = Brushes.OrangeRed;
            }
        }
コード例 #5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.win = ((ShopKeeper.WindowShowProduct)(target));

            #line 8 "..\..\WindowShowProduct.xaml"
                this.win.Closed += new System.EventHandler(this.Window_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.imageProduct = ((System.Windows.Controls.Image)(target));
                return;

            case 3:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.label3 = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.label4 = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.label5 = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.label6 = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }