Пример #1
0
 public FindBest()
 {
     InitializeComponent();
     carShowroom1 = new CarShowroom();
     carShowroom1.Load();
     carBindingSource.DataSource = carShowroom1.Cars;
 }
Пример #2
0
 public Buyers()
 {
     InitializeComponent();
     carShowroom1 = new CarShowroom();
     carShowroom1.Load();
     buyerBindingSource.DataSource = carShowroom1.Buyers;
 }
Пример #3
0
 public BuyerAllCars()
 {
     carShowroom1 = new CarShowroom();
     InitializeComponent();
     carShowroom1.Load();
     carBindingSource.DataSource = carShowroom1.Cars;
 }
Пример #4
0
 public Reports()
 {
     InitializeComponent();
     carShowroom1 = new CarShowroom();
     carShowroom1.Load();
     reportBindingSource.DataSource = carShowroom1.Reports;
 }
Пример #5
0
 public AdmListCars()
 {
     InitializeComponent();
     carShowroom1 = new CarShowroom();
     //CarShowroom1.FillTestData(100);
     carShowroom1.Load();
     carBindingSource.DataSource = carShowroom1.Cars;
 }
Пример #6
0
 public BuyerAllCars(Buyer curent)
 {
     carShowroom1 = new CarShowroom();
     InitializeComponent();
     carShowroom1.Load();
     carBindingSource.DataSource = carShowroom1.Cars;
     this.CurentBuyer            = curent;
 }
Пример #7
0
 public FindBest(Buyer curent)
 {
     InitializeComponent();
     carShowroom1 = new CarShowroom();
     carShowroom1.Load();
     CurentBuyer = curent;
     carShowroom1.FindAllthebest(CurentBuyer);
     carBindingSource.DataSource = carShowroom1.ShoppingCart;
 }
Пример #8
0
        private void Login_but_Click(object sender, EventArgs e)
        {
            bool  chek        = false;
            Buyer curentBuyer = new Buyer();

            if (string.IsNullOrWhiteSpace(PassTextBox.Text))
            {
                PassTextBox.BackColor = Color.LightPink;
                chek = true;
            }
            if (string.IsNullOrWhiteSpace(LogTextbox.Text))
            {
                LogTextbox.BackColor = Color.LightPink;
                chek = true;
            }
            if (chek == true)
            {
                return;
            }
            string cheklog  = LogTextbox.Text;
            string chekpass = PassTextBox.Text;

            carShowroom1.Load();
            foreach (var b in carShowroom1.Buyers)
            {
                if (b.Name.Equals(cheklog) && b.Password.Equals(chekpass))
                {
                    chek        = true;
                    curentBuyer = b;
                }
            }
            if (chek == false)
            {
                MessageBox.Show("No user with this username and password", "Attantion!", MessageBoxButtons.OK);
                return;
            }
            var buyerF = new BuyerMenu(curentBuyer);

            this.Hide();
            buyerF.ShowDialog();
            this.Close();
        }
Пример #9
0
 private void Register_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (DialogResult != DialogResult.OK)
     {
         return;
     }
     ChekPass(NametextBox, e);
     ChekPass(PastextBox, e);
     if (e.Cancel != false)
     {
         MessageBox.Show("Password and login must be at least 3 characters and no more than 12", "Attention!");
     }
     ChekText(ContacttextBox, e);
     if (e.Cancel == false)
     {
         CarShowroom CarShowroom1 = new CarShowroom();
         CarShowroom1.Load();
         if (BuyerN != NametextBox.Text)
         {
             foreach (var b in CarShowroom1.Buyers)
             {
                 if (b.Name.Equals(NametextBox.Text))
                 {
                     e.Cancel = true;
                     NametextBox.BackColor = Color.LightPink;
                     MessageBox.Show("User with the same name already exists", "Attantion!", MessageBoxButtons.OK);
                 }
             }
         }
         if (e.Cancel == false)
         {
             if (Buyer == null)
             {
                 Buyer = new Buyer();
             }
             Buyer.Contacts          = ContacttextBox.Text;
             Buyer.FinancialOpp      = Convert.ToInt32(Prise_numericUp.Value);
             Buyer.MaksSpeedRequired = Convert.ToInt32(Speed_numeric.Value);
             Buyer.ModelRequired     = ModelcomboBox.Text;
             Buyer.Name               = NametextBox.Text;
             Buyer.Password           = PastextBox.Text;
             Buyer.PerfomanceRequired = Convert.ToInt32(Perf_numeric.Value);
             if (string.IsNullOrWhiteSpace(ModelcomboBox.Text))
             {
                 Buyer.ModelRequired = "nope";
             }
         }
     }
 }
Пример #10
0
 private void LoadToolStripMenuItem_Click(object sender, EventArgs e)
 {
     carShowroom1.Load();
     carShowroom1.IfSaved = true;
     buyerBindingSource.ResetBindings(false);
 }
Пример #11
0
 public BuyerMenu()
 {
     InitializeComponent();
     carShowroom1.Load();
 }