예제 #1
0
        private void editToolStripMenuItem_Click(object sender, EventArgs e)
        {
            switch (label1.Text)
            {
            case ("Авто"):
            {
                DataGridViewRow temp = dataGridView1.SelectedRows[0];
                var             ep   = new AutoEdit(Convert.ToInt32(temp.Cells[0].Value),
                                                    Convert.ToString(temp.Cells[1].Value),
                                                    Convert.ToString(temp.Cells[2].Value),
                                                    Convert.ToDateTime(temp.Cells[3].Value),
                                                    Convert.ToDecimal(temp.Cells[4].Value),
                                                    Convert.ToInt32(temp.Cells[5].Value),
                                                    Convert.ToInt32(temp.Cells[6].Value));
                ep.ShowDialog();
                Auto();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Клиенты"):
            {
                DataGridViewRow temp = dataGridView1.SelectedRows[0];
                var             ep   = new ClientEdit(Convert.ToInt32(temp.Cells[0].Value),
                                                      Convert.ToString(temp.Cells[1].Value),
                                                      Convert.ToString(temp.Cells[2].Value),
                                                      Convert.ToString(temp.Cells[3].Value));
                ep.ShowDialog();
                Client();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Поставщики"):
            {
                DataGridViewRow temp = dataGridView1.SelectedRows[0];
                var             ep   = new ProviderEdit(Convert.ToInt32(temp.Cells[0].Value),
                                                        Convert.ToString(temp.Cells[1].Value),
                                                        Convert.ToString(temp.Cells[2].Value),
                                                        Convert.ToString(temp.Cells[3].Value));
                ep.ShowDialog();
                Provider();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Информация"):
            {
                DataGridViewRow temp = dataGridView1.SelectedRows[0];
                var             ep   = new InfoEdit(Convert.ToInt32(temp.Cells[0].Value),
                                                    Convert.ToInt32(temp.Cells[1].Value),
                                                    Convert.ToInt32(temp.Cells[2].Value),
                                                    Convert.ToString(temp.Cells[3].Value),
                                                    Convert.ToString(temp.Cells[4].Value),
                                                    Convert.ToString(temp.Cells[5].Value),
                                                    Convert.ToString(temp.Cells[6].Value),
                                                    Convert.ToString(temp.Cells[7].Value));
                ep.ShowDialog();
                Info();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Должность"):
            {
                DataGridViewRow temp = dataGridView1.SelectedRows[0];
                var             ep   = new PosEdit(Convert.ToInt32(temp.Cells[0].Value),
                                                   Convert.ToString(temp.Cells[1].Value));
                ep.ShowDialog();
                Position();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Сотрудники"):
            {
                DataGridViewRow temp = dataGridView1.SelectedRows[0];
                var             ep   = new EmpEdit(Convert.ToInt32(temp.Cells[0].Value),
                                                   Convert.ToString(temp.Cells[1].Value),
                                                   Convert.ToInt32(temp.Cells[2].Value),
                                                   Convert.ToDateTime(temp.Cells[3].Value),
                                                   Convert.ToDateTime(temp.Cells[4].Value),
                                                   Convert.ToDecimal(temp.Cells[5].Value));
                ep.ShowDialog();
                Position();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Продажи"):
            {
                DataGridViewRow temp = dataGridView1.SelectedRows[0];
                var             ep   = new SellEdit(Convert.ToInt32(temp.Cells[0].Value),
                                                    Convert.ToInt32(temp.Cells[1].Value),
                                                    Convert.ToInt32(temp.Cells[2].Value),
                                                    Convert.ToInt32(temp.Cells[3].Value),
                                                    Convert.ToDateTime(temp.Cells[4].Value),
                                                    Convert.ToString(temp.Cells[5].Value));
                ep.ShowDialog();
                Position();
                avtoSalonDataSet.AcceptChanges();
                break;
            }
            }
        }
예제 #2
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            switch (label1.Text)
            {
            case ("Авто"):
            {
                var ep = new AutoEdit();
                ep.ShowDialog();
                Auto();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Клиенты"):
            {
                var ep = new ClientEdit();
                ep.ShowDialog();
                Client();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Поставщики"):
            {
                var ep = new ProviderEdit();
                ep.ShowDialog();
                Provider();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Информация"):
            {
                var ep = new InfoEdit();
                ep.ShowDialog();
                Info();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Должность"):
            {
                var ep = new PosEdit();
                ep.ShowDialog();
                Position();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Сотрудники"):
            {
                var ep = new EmpEdit();
                ep.ShowDialog();
                Employee();
                avtoSalonDataSet.AcceptChanges();
                break;
            }

            case ("Продажи"):
            {
                var ep = new SellEdit();
                ep.ShowDialog();
                Selling();
                avtoSalonDataSet.AcceptChanges();
                break;
            }
            }
        }