コード例 #1
0
ファイル: AddQuote.cs プロジェクト: cses060404/MegaDesk4
        private void createButton_Click(object sender, EventArgs e)
        {
            if (!(name.Text == "" || materialCombo.SelectedIndex == -1 || drawerCombo.SelectedIndex == -1 || rushCombo.SelectedIndex == -1))
            {
                newQuote.customerName = name.Text;

                newQuote.desk.Depth = (int)DepthNum.Value;
                newQuote.desk.Width = (int)WidthNum.Value;

                int index = materialCombo.SelectedIndex;
                newQuote.desk.Material = (Desk.Surface)index;

                index = drawerCombo.SelectedIndex;
                newQuote.desk.DrawerNum = index;

                index = rushCombo.SelectedIndex;
                newQuote.DeliveryType = (DeskQuote.Delivery)index;

                newQuote.CalCost();

                ShowQuote addNewQuoteForm = new ShowQuote(newQuote);
                addNewQuoteForm.Tag = this;
                addNewQuoteForm.Show(this);
                Hide();
            }
            else
            {
                MessageBox.Show("Please enter all valuesf!");
            }
        }