private void ReturnToolStripMenuItem_Click(object sender, EventArgs e) { ClientList clientcard = new ClientList(startMenu, false); clientcard.setflagCanCount(true); clientcard.Show(); }
private void AddButton_Click(object sender, EventArgs e) { TableLayoutPanelCellPosition pos = copyListTable.GetPositionFromControl((Control)sender); Control btn = (Control)sender; Control tableTemp = copyListTable.GetControlFromPosition(1, Convert.ToInt32(btn.Name.Remove(0, 9)) - 1); TableLayoutPanel table = (TableLayoutPanel)tableTemp; AutoCopy openCopy = new AutoCopy(); AutoCopyService service = new AutoCopyService(Model.Copies); openCopy = service.CopySearch(table.GetControlFromPosition(1, 4).Text); try { if (openCopy.Enable) { openCopy.Enable = false; ClientList clientcard = new ClientList(startMenu, true, openCopy); clientcard.Show(); } else { MessageBox.Show("Автомобиля нет в наличии.", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (NullReferenceException) { MessageBox.Show("Вы пытаетесь добавить несуществующий автомобиль", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void AddButton_Click(object sender, EventArgs e) { Control btn = (Control)sender; Auto openautomobile = new Auto(); try { AutoService service = new AutoService(Model.Automobiles); openautomobile = service.automobileSearch(btn.Name); if (openautomobile.Enable) { ClientList clientList = new ClientList(true, openautomobile); clientList.Show(); } else { MessageBox.Show("Автомобиля нет в наличии.", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { MessageBox.Show("Вы пытаетесь добавить несуществующий автомобиль", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//public void ShowModelList() //{ // AutoModelList autoList = new AutoModelList(true); // autoList.Show(); //} private void ClientListButton_Click(object sender, EventArgs e) { this.Hide(); ClientList clientcard = new ClientList(false); clientcard.setflagCanCount(false); clientcard.Show(); }
private void ClientListToolStripMenuItem1_Click(object sender, EventArgs e) { ClientList showClients = new ClientList(startMenu, true); showClients.Show(); }