Example #1
0
        private void view_form_Load(object sender, EventArgs e)
        {
            tabParams = tableParams.getTableParams(tableName);
            server.fillDataGridWithTable(tabParams.tableNameDB, dataGrid, tabParams.tableNameDB);
            this.Width = tabParams.formWidt - 100;

            string caption = "";

            switch (tabParams.tableNameDB)
            {
            case "avtomobil": {
                caption = "Все автомобили";
                break;
            }

            case "klient": {
                nalichie_checkBox.Visible = false;
                caption = "Все клиенты";
                search_pictureBox.Visible = false;
                break;
            }

            case "zakaz": {
                nalichie_checkBox.Visible = false;
                caption = "Все заказы";
                break;
            }
            }
            this.Text = caption;

            server.fillSearchFieldsForAvtomobil(marka_comboBox, kuzov_comboBox, null);
            server.fillSearchFieldsForAvtomobil(markaSearchZakazi_comboBox, null, sotrudnikSearchZakaz_comboBox);
        }
Example #2
0
 public static void showAllButtons(PictureBox[] array, PictureBox pb, tableParams tPar)
 {
     for (int i = 0; i < array.Length; i++)
     {
         array[i].Visible = true;
     }
 }
Example #3
0
        private void kuzov_pictureBox_Click(object sender, EventArgs e)
        {
            movingPictureBox = sender as PictureBox;
            functions.disableAllButtons(arrayOfPictureBox, movingPictureBox);
            speed = 12;

            tabParams = tableParams.getTableParams(movingPictureBox.Name);
            server.fillDataGridWithTable(tabParams.tableNameDB, dataGrid);
            tableName = tabParams.tableNameDB;
            timerGoButtonLeft.Start();
        }
Example #4
0
 public static void refreshDataGrid(tableParams tabParams, PictureBox movingPictureBox, MetroGrid dataGrid)
 {
     tabParams = tableParams.getTableParams(movingPictureBox.Name);
     server.fillDataGridWithTable(tabParams.tableNameDB, dataGrid);
 }
Example #5
0
        public static tableParams getTableParams(string pictureBoxName)
        {
            tableParams tem = new tableParams();

            switch (pictureBoxName)
            {
            case "a0vto_pictureBox": {
                tem.tableNameDB = "avtomobil";
                tem.formWidt    = 900;
                break;
            }

            case "a1dr_pictureBox": {
                tem.tableNameDB = "adres";
                tem.formWidt    = 540;
                break;
            }

            case "p2rav_pictureBox": {
                tem.tableNameDB = "voditelskie_prava";
                break;
            }

            case "d3olzhn_pictureBox": {
                tem.tableNameDB = "dolzhnost";
                break;
            }

            case "z1akaz_pictureBox": {
                tem.tableNameDB = "zakaz";
                tem.formWidt    = 750;
                break;
            }

            case "k2lient_pictureBox": {
                tem.tableNameDB = "klient";
                tem.formWidt    = 820;
                break;
            }

            case "k3uzov_pictureBox": {
                tem.tableNameDB = "kuzov";
                break;
            }

            case "m4arka_pictureBox": {
                tem.tableNameDB = "marka";
                break;
            }

            case "m2edSpr_pictureBox": {
                tem.tableNameDB = "medic_spravka";
                tem.formWidt    = 410;
                break;
            }

            case "m3edUchr_pictureBox": {
                tem.tableNameDB = "medic_uchrezhdenie";
                tem.formWidt    = 510;
                break;
            }

            case "m4odel_pictureBox": {
                tem.tableNameDB = "model";
                break;
            }

            case "p4asp_pictureBox": {
                tem.tableNameDB = "pasport";
                break;
            }

            case "s3otr_pictureBox": {
                tem.tableNameDB = "sotrudnik";
                tem.formWidt    = 620;
                break;
            }

            case "s3trah_pictureBox": {
                tem.tableNameDB = "strahovanie";
                tem.formWidt    = 430;
                break;
            }

            case "t4arif_pictureBox": {
                tem.tableNameDB = "tarif";
                break;
            }

            case "t4ehosmtr_pictureBox": {
                tem.tableNameDB = "tehosmotr";
                break;
            }
            }
            return(tem);
        }