private void configureMarks(string newMark = null)
        {
            MySqlDataAdapter objAdapterMarcas = NewConObj.ExecuteQueryAndGetData("SELECT * FROM marcas");

            this.markTable = NewConObj.DataMySqlToDataTable(objAdapterMarcas, "marcas");
            string[] arrayMarks = new string[this.markTable.Rows.Count];
            for (int i = 0; i < this.markTable.Rows.Count; i++)
            {
                arrayMarks[i] = this.markTable.Rows[i].Field <string>("Marca");
            }
            this.markSelect.DataSource = arrayMarks;
            if (newMark == null)
            {
                for (int i = 0; i < this.markSelect.Items.Count; i++)
                {
                    if (this.markSelect.Items[i].ToString() == this.mark)
                    {
                        this.markSelect.SelectedIndex = i;
                    }
                }
            }
            else
            {
                for (int i = 0; i < this.markSelect.Items.Count; i++)
                {
                    if (this.markSelect.Items[i].ToString() == newMark)
                    {
                        this.markSelect.SelectedIndex = i;
                    }
                }
            }
        }
Beispiel #2
0
        protected void StartRowsView()
        {
            MainConn         NewConObj         = new MainConn();
            MySqlDataAdapter ObjAdapterZapatos = NewConObj.ExecuteQueryAndGetData("SELECT * FROM zapatosyexists");

            this.MainGrid.Visible             = true;
            this.MainGrid.AutoGenerateColumns = true;
            // 'zapatos' All Shoes whitout number of shoes , 'tallas' Table numbers of Shoes
            this.MainGrid.DataSource = NewConObj.DataMySqlToDataTable(ObjAdapterZapatos, "zapatosyexists");
            this.HideColumnsMainTable();
            this.AutoSizeColums();
        }