Ejemplo n.º 1
0
        private void btnNextStep3_Click(object sender, RoutedEventArgs e)
        {
            //dtStep4.Columns.Add("*");
            //foreach (ColumnDetail item in pnlColDetails.Children)
            //{
            //    //dtStep3.Columns.Add(item.txtBoxColName.Text);
            //    dtStep4.Columns.Add(item.txtName.Text);
            //    inputWeight.Add(Convert.ToDouble(item.txtWeight.Text));
            //    inputSign.Add(item.NumValue);
            //}
            //foreach (RowDetail item in pnlRowDetails.Children)
            //{
            //    DataRow newRow = dtStep4.NewRow();
            //    newRow[0] = item.txtName.Text;

            //    dtStep4.Rows.Add(newRow);

            //}
            //int aa = dgvStep4.Columns.Count;
            //dgvStep4.SetBinding(ItemsControl.ItemsSourceProperty, new Binding { Source = dtStep3 });
            //for (int i = 0; i < dgvStep4.Items.Count; i++)
            //{
            //    //dtgStep3.Items[i].Cells[1].ReadOnly = true;
            //    //dtgStep3.Rows[i].Cells[1].Style.BackColor = Color.Gray;
            //}
            ApiConnection.Connections connections = new ApiConnection.Connections();
            int ressss = connections.checkmoney(dtStep3.Columns.Count - 1, dtStep3.Rows.Count);

            if (ressss == 1)
            {
                CalculateAlgorythm(dtStep3, inputWeight, inputSign);
                dgvStep4.Items.Refresh();
                //Disable Other Tabs
                if (TabControlMain.Items.Count - 1 == TabControlMain.SelectedIndex)
                {
                    return; // No more tabs to show!
                }
                var currentTab = TabControlMain.SelectedItem as TabItem;
                currentTab.IsEnabled = false;
                var nextTab = TabControlMain.Items[TabControlMain.SelectedIndex + 1] as TabItem;
                nextTab.IsEnabled           = true;
                TabControlMain.SelectedItem = nextTab;
                //tabControl.SelectedIndex = tabControl.SelectedIndex + 1;
            }
            else if (ressss == -1)
            {
                MessageBox.Show("Low money");
            }
            else
            {
                MessageBox.Show("Cannot connect to the internet");
            }
        }
Ejemplo n.º 2
0
        private void btnNextStep3_Click(object sender, RoutedEventArgs e)
        {
            //dtStep4.Columns.Add("*");
            //foreach (ColumnDetail item in pnlColDetails.Children)
            //{
            //    //dtStep3.Columns.Add(item.txtBoxColName.Text);
            //    dtStep4.Columns.Add(item.txtName.Text);
            //    inputWeight.Add(Convert.ToDouble(item.txtWeight.Text));
            //    inputSign.Add(item.NumValue);
            //}
            //foreach (RowDetail item in pnlRowDetails.Children)
            //{
            //    DataRow newRow = dtStep4.NewRow();
            //    newRow[0] = item.txtName.Text;
            //    dtStep4.Rows.Add(newRow);
            //}


            ApiConnection.Connections connections = new ApiConnection.Connections();
            int ressss = connections.checkmoney(dtStep3.Columns.Count - 1, dtStep3.Rows.Count);

            if (ressss == 1)
            {
                Calculate_Topsis(inputSign, inputWeight, dtStep3);

                dgvStep4.Items.Refresh();
                //Disable Other Tabs
                if (TabControlMain.Items.Count - 1 == TabControlMain.SelectedIndex)
                {
                    return; // No more tabs to show!
                }
                var currentTab = TabControlMain.SelectedItem as TabItem;
                currentTab.IsEnabled = false;
                var nextTab = TabControlMain.Items[TabControlMain.SelectedIndex + 1] as TabItem;
                nextTab.IsEnabled           = true;
                TabControlMain.SelectedItem = nextTab;
                //tabControl.SelectedIndex = tabControl.SelectedIndex + 1;
            }
            else if (ressss == -1)
            {
                MessageBox.Show("Low money");
            }
            else
            {
                MessageBox.Show("Cannot connect to the internet");
            }
        }
Ejemplo n.º 3
0
        private void btnNextStep3_Click(object sender, RoutedEventArgs e)
        {
            ApiConnection.Connections connections = new ApiConnection.Connections();
            int ressss = connections.checkmoney(dtStep3.Columns.Count - 1, dtStep3.Rows.Count);

            if (ressss == 1)
            {
                //=====================Todelete
                inputWeight.Add(0.2);
                inputWeight.Add(0.15);
                inputWeight.Add(0.15);
                inputWeight.Add(0.3);
                inputWeight.Add(0.2);
                inputSign.Add(-1);
                inputSign.Add(1);
                inputSign.Add(-1);
                inputSign.Add(1);
                inputSign.Add(1);

                //=====================Todelete
                Calculate_SAW(inputSign, inputWeight, dtStep3);
                dgvStep4.Items.Refresh();
                //Disable Other Tabs
                if (TabControlMain.Items.Count - 1 == TabControlMain.SelectedIndex)
                {
                    return; // No more tabs to show!
                }
                var currentTab = TabControlMain.SelectedItem as TabItem;
                currentTab.IsEnabled = false;
                var nextTab = TabControlMain.Items[TabControlMain.SelectedIndex + 1] as TabItem;
                nextTab.IsEnabled           = true;
                TabControlMain.SelectedItem = nextTab;
                //tabControl.SelectedIndex = tabControl.SelectedIndex + 1;
            }
            else if (ressss == -1)
            {
                MessageBox.Show("Low money");
            }
            else
            {
                MessageBox.Show("Cannot connect to the internet");
            }
        }