private void ShowClientsButton_Click(object sender, EventArgs e) { List <Client> clientList = DatabaseMethods.SelectClients(); if (clientList.Count() > 0) { List <string> list = clientList.Select(i => i.Name + " " + i.LastName + " [Client number: " + i.ClientNumber + "]").ToList(); ShowObject showObject = new ShowObject(new BindingSource(list, null), typeof(Client), this); showObject.Text = "Show clients"; showObject.ShowDialog(); } else { MessageBox.Show("No clients!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ShowWorkersButton_Click(object sender, EventArgs e) { List <Worker> workerList = DatabaseMethods.SelectWorkers(); if (workerList.Count() > 0) { List <string> list = workerList.Select(i => i.WorkerNumber + ". " + i.Name + " " + i.LastName + ", " + i.Position).ToList(); ShowObject showObject = new ShowObject(new BindingSource(list, null), typeof(Worker), this); showObject.Text = "Show workers"; showObject.ShowDialog(); } else { MessageBox.Show("No workers!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ShowOrdersButton_Click(object sender, EventArgs e) { List <Order> orderList = DatabaseMethods.SelectOrders(); if (orderList.Count() > 0) { List <string> list = orderList.Select(i => i.OrderNumber + ". " + DatabaseMethods.SelectClients().Where(x => x.ClientNumber == i.OrderClientNumber).First().Name + " " + DatabaseMethods.SelectClients().Where(x => x.ClientNumber == i.OrderClientNumber).First().LastName + " " + DatabaseMethods.SelectOffers().Where(x => x.OfferNumber == i.TravelOfferNumber).First().TravelDestination).ToList(); ShowObject showObject = new ShowObject(new BindingSource(list, null), typeof(Order), this); showObject.Text = "Show orders"; showObject.ShowDialog(); } else { MessageBox.Show("No orders!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ShowOffersButton_Click(object sender, EventArgs e) { List <Offer> offerList = DatabaseMethods.SelectOffers(); if (offerList.Count() > 0) { List <string> list = offerList.Select(i => i.OfferNumber + ". " + i.TravelDestination + ", " + i.HotelRanking + ", " + i.Feeding + ", €" + i.Price).ToList(); ShowObject showObject = new ShowObject(new BindingSource(list, null), typeof(Offer), this); showObject.Text = "Show offers"; showObject.ShowDialog(); } else { MessageBox.Show("No offers!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void PayOutSalaryButton_Click(object sender, EventArgs e) { List <Worker> workerList = DatabaseMethods.SelectWorkers(); if (workerList.Count() > 0) { List <string> list = workerList.Select(i => i.WorkerNumber + ". " + i.Name + " " + i.LastName + ", " + i.Position).ToList(); ShowObject showObject = new ShowObject(new BindingSource(list, null), typeof(Worker), this); showObject.Text = "Pay out salary"; showObject.showButton.Text = "Pay out salary"; showObject.showButton.Size = new Size(564, 51); showObject.deleteButton.Visible = false; showObject.ShowDialog(); } else { MessageBox.Show("No workers!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void AboutClientButton_Click(object sender, EventArgs e) { List <Client> clientList = DatabaseMethods.SelectClients(); if (clientList.Count() > 0) { List <string> list = clientList.Select(i => i.Name + " " + i.LastName + " [Client number: " + i.ClientNumber + "]").ToList(); ShowObject showObject = new ShowObject(new BindingSource(list, null), typeof(Client)); showObject.Text = "Show clients"; showObject.showButton.Text = "Send information to E-mail"; showObject.showButton.Size = new Size(564, 51); showObject.deleteButton.Visible = false; showObject.ShowDialog(); } else { MessageBox.Show("No clients!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }