public FindBest() { InitializeComponent(); carShowroom1 = new CarShowroom(); carShowroom1.Load(); carBindingSource.DataSource = carShowroom1.Cars; }
public Buyers() { InitializeComponent(); carShowroom1 = new CarShowroom(); carShowroom1.Load(); buyerBindingSource.DataSource = carShowroom1.Buyers; }
public BuyerAllCars() { carShowroom1 = new CarShowroom(); InitializeComponent(); carShowroom1.Load(); carBindingSource.DataSource = carShowroom1.Cars; }
public Reports() { InitializeComponent(); carShowroom1 = new CarShowroom(); carShowroom1.Load(); reportBindingSource.DataSource = carShowroom1.Reports; }
public AdmListCars() { InitializeComponent(); carShowroom1 = new CarShowroom(); //CarShowroom1.FillTestData(100); carShowroom1.Load(); carBindingSource.DataSource = carShowroom1.Cars; }
public BuyerAllCars(Buyer curent) { carShowroom1 = new CarShowroom(); InitializeComponent(); carShowroom1.Load(); carBindingSource.DataSource = carShowroom1.Cars; this.CurentBuyer = curent; }
public FindBest(Buyer curent) { InitializeComponent(); carShowroom1 = new CarShowroom(); carShowroom1.Load(); CurentBuyer = curent; carShowroom1.FindAllthebest(CurentBuyer); carBindingSource.DataSource = carShowroom1.ShoppingCart; }
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(); }
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"; } } } }
private void LoadToolStripMenuItem_Click(object sender, EventArgs e) { carShowroom1.Load(); carShowroom1.IfSaved = true; buyerBindingSource.ResetBindings(false); }
public BuyerMenu() { InitializeComponent(); carShowroom1.Load(); }