Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            cs                    = new customer();
            cs.Name               = textBox1.Text;
            cs.Surname            = textBox1.Text;
            cs.PlateNo            = textBox3.Text;
            cs.TCKN               = (textBox5.Text);
            cs.Tel                = (textBox6.Text);
            cs.SubscriberType     = comboBox2.SelectedItem.ToString();
            dateTimePicker1.Value = DateTime.Now;
            dt                    = dateTimePicker1.Value;
            cs.Datein             = dt.ToString();
            cs.Address            = richTextBox1.Text;
            cs.CarBrand           = comboBox1.SelectedItem.ToString();
            cs.CarModel           = textBox4.Text;
            cs.Payment            = (textBox2.Text);
            //cs.Parkarea = comboBox4.SelectedItem.ToString();
            cs.Dateout = a;

            try
            {
                int res = cs.add_car(cs);
                if (res > 0)
                {
                    MessageBox.Show("Kayıt Tamamlandı.");

                    textBox1.Text  = "";
                    textBox2.Text  = "";
                    textBox3.Text  = "";
                    textBox4.Text  = "";
                    textBox5.Text  = "";
                    textBox6.Text  = "";
                    comboBox1.Text = "";
                    comboBox2.Text = "";
                    comboBox3.Text = "";
                    //comboBox4.Text = "";
                    richTextBox1.Text = "";
                }
                else
                {
                    MessageBox.Show("Something Wrong!");
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }