Example #1
0
File: User.cs Project: dina200/RC
        public void rentCar(dbHelper db)
        {
            string passport = Console.ReadLine();
            string fullName = Console.ReadLine();
            string phone    = Console.ReadLine();

            db.addClient(passport, fullName, phone);
            string carId = Console.ReadLine();
            int    duration;

            try
            {
                duration = Convert.ToInt32(Console.ReadLine());
            }
            catch (Exception e)
            {
                duration = 0;
            }
            string from = Console.ReadLine();
            string to   = Console.ReadLine();

            db.createRent(passport, carId, this, from, to, duration);
        }
Example #2
0
        private void createButton_Click(object sender, EventArgs e)
        {
            string name = clientNametextBox.Text;
            string pass = clientPassportTextBox.Text;
            string tel  = clientTeltextBox.Text;
            Client cl   = db.addClient(pass, name, tel);

            if (cl == null ||
                clientNametextBox.Text == "" &&
                clientPassportTextBox.Text == "" &&
                clientTeltextBox.Text == "")
            {
                MessageBox.Show("Error! Client isn't added");
            }
            else
            {
                MessageBox.Show("Client " + name + " is created");
                clientNametextBox.Text     = "";
                clientPassportTextBox.Text = "";
                clientTeltextBox.Text      = "";
            }
            this.Validate();
            RCTableAdapterManager.UpdateAll(this.myDbDataSet);
        }