示例#1
0
文件: Form1.cs 项目: MAF1N/OOP_Course
 private void ClearAllTextBoxes()
 {
     ItemTextBox.Clear();
     AmountTextBox.Clear();
     CostTextBox.Clear();
     MeasureTextBox.Clear();
     EndDate.Text = DateOfIncome.Text;
 }
示例#2
0
        private void OKDateButton_Click(object sender, EventArgs e)
        {
            if (Add)
            {
                if (DocNumberTextBox.Text == "")
                {
                    Infinium.LightMessageBox.Show(ref TopForm, false, "Введите название документа!",
                                                  "Ошибка");
                }
                else
                {
                    try
                    {
                        Convert.ToDecimal(CostTextBox.Text);
                    }
                    catch
                    {
                        Infinium.LightMessageBox.Show(ref TopForm, false, "Некорректно задана цена!",
                                                      "Ошибка");
                        return;
                    }

                    ClientPayments.AddContracts(ClientComboBox.SelectedValue.ToString(), DocNumberTextBox.Text, DateFromPicker.Value, DateToPicker.Value, CostTextBox.Text, CurrencyComboBox.SelectedValue.ToString(), FirmComboBox.SelectedValue.ToString());

                    DocNumberTextBox.Clear();
                    CostTextBox.Clear();
                }
            }
            else
            {
                if (DocNumberTextBox.Text == "")
                {
                    Infinium.LightMessageBox.Show(ref TopForm, false, "Введите название документа!",
                                                  "Ошибка");
                }
                else
                {
                    try
                    {
                        Convert.ToDecimal(CostTextBox.Text);
                    }
                    catch
                    {
                        Infinium.LightMessageBox.Show(ref TopForm, false, "Некорректно задана цена!",
                                                      "Ошибка");
                        return;
                    }

                    ClientPayments.UpdateContracts(ContractId, DocNumberTextBox.Text, DateFromPicker.Value, DateToPicker.Value, CostTextBox.Text, CurrencyComboBox.SelectedValue.ToString(), FirmComboBox.SelectedValue.ToString());

                    DocNumberTextBox.Clear();
                    CostTextBox.Clear();
                }
            }

            this.Close();
            ClientPayments.UpdateClientsContractDataGrid();
        }
示例#3
0
        // Private functions
        // *****************
        private void DisplayProduct(product p)
        {
            if (p != null)
            {
                ProductIDTextBox.Text = p.productID.ToString();
                ConditionTextBox.Text = p.condition;
                CostTextBox.Text      = "$" + p.cost.ToString();


                // Product Info
                PlatformTextBox.Text     = p.platform;
                OSTextBox.Text           = p.OS;
                ManufacturerTextBox.Text = p.manufacturer;
                ModelTextBox.Text        = p.model;


                // Tech Specs
                MemoryTextBox.Text  = p.RAM_size;
                LCDSizeTextBox.Text = p.screensize;
                HDDTextBox.Text     = p.HDD_size;

                CPUBrandTextBox.Text = p.CPU_brand;
                CPUNumberTexBox.Text = p.CPU_number;
                GPUTypeTextBox.Text  = p.GPU_Type;

                CPUTypeTextBox.Text  = p.CPU_type;
                CPUSpeedTextBox.Text = p.CPU_speed;
                WebcamTextBox.Text   = p.webcam;
                NextButton.Enabled   = true;
            }
            else
            {
                ProductIDTextBox.Clear();
                ConditionTextBox.Clear();
                CostTextBox.Clear();


                // Product Info
                PlatformTextBox.Clear();
                OSTextBox.Clear();
                ManufacturerTextBox.Clear();


                // Tech Specs
                MemoryTextBox.Clear();
                LCDSizeTextBox.Clear();
                HDDTextBox.Clear();

                CPUBrandTextBox.Clear();
                CPUNumberTexBox.Clear();
                GPUTypeTextBox.Clear();

                CPUTypeTextBox.Clear();
                CPUSpeedTextBox.Clear();
                WebcamTextBox.Clear();
                NextButton.Enabled = false;
            }
        }
示例#4
0
 public MainWindow()
 {
     InitializeComponent();
     //设置全屏
     this.Left   = 0.0;
     this.Top    = 0.0;
     this.Width  = System.Windows.SystemParameters.PrimaryScreenWidth;
     this.Height = System.Windows.SystemParameters.PrimaryScreenHeight;
     QuantitytextBox.AddHandler(TextBox.MouseLeftButtonDownEvent, new MouseButtonEventHandler(this.MouseEnter), true);
     CostTextBox.AddHandler(TextBox.MouseLeftButtonDownEvent, new MouseButtonEventHandler(this.MouseEnter), true);
     dt.Columns.Add(commodity);
     dt.Columns.Add(Quantity);
     dt.Columns.Add(Cost);
     DynamicOderButton();
 }
示例#5
0
 // reset the form;
 private void ResetForm()
 {
     ProductIDTextBox.Clear();
     ConditionTextBox.Clear();
     CostTextBox.Clear();
     PlatformTextBox.Clear();
     OSTextBox.Clear();
     ManufacturerTextBox.Clear();
     ModelTextBox.Clear();
     MemoryTextBox.Clear();
     LCDSizeTextBox.Clear();
     HDDTextBox.Clear();
     CPUBrandTextBox.Clear();
     CPUNumberTextBox.Clear();
     GPUTypeTextBox.Clear();
     CPUTypeTextBox.Clear();
     CPUSpeedTextBox.Clear();
     WebCamTextBox.Clear();
 }
 private void ResetForm()
 {
     ProductTextBox.Clear();
     ConditionTextBox.Clear();
     CostTextBox.Clear();
     PlatFormTextBox.Clear();
     OsTextBox.Clear();
     ManuFacTextBox.Clear();
     ModelTextBox.Clear();
     MemoryTextBox.Clear();
     LCDTextBox.Clear();
     HDDTextBox.Clear();
     CPUBTextBox.Clear();
     CPUNumTextBox.Clear();
     GPUTTextBox.Clear();
     CPUTTextBox.Clear();
     CPUspeedTextBox.Clear();
     WebCamTextBox.Clear();
 }
示例#7
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            int Count = 0;

            if (ObjectNameTextBox.Text == "")
            {
                Infinium.LightMessageBox.Show(ref TopForm, false, "Введите название!",
                                              "Ошибка");
            }
            else
            {
                try
                {
                    Count = Convert.ToInt32(CountTextBox.Text);
                }
                catch
                {
                    Infinium.LightMessageBox.Show(ref TopForm, false, "Некорректное кол-во!",
                                                  "Ошибка");
                    return;
                }

                try
                {
                    Convert.ToDecimal(CostTextBox.Text);
                }
                catch
                {
                    Infinium.LightMessageBox.Show(ref TopForm, false, "Некорректно задана цена!",
                                                  "Ошибка");
                    return;
                }

                ConnectUnloads.AddGoods(ObjectNameTextBox.Text, Count, CostTextBox.Text, MeasureComboBox.SelectedValue.ToString(), CurrencyComboBox.SelectedValue.ToString());

                ObjectNameTextBox.Clear();
                CountTextBox.Clear();
                CostTextBox.Clear();
            }
        }