Example #1
0
 private void keypressed(Object o, KeyPressEventArgs e)//ENTER key
 {
     if (e.KeyChar == (char)Keys.Return)
     {
         e.Handled = true;
         if (string.IsNullOrWhiteSpace(txtSearch.Text))
         {
         }
         else
         {
             string tmp = txtSearch.Text;
             cbLengths.SelectedIndex = 0;
             cbColour.SelectedIndex  = 0;
             cbFarm.SelectedIndex    = 0;
             cbSleeve.SelectedIndex  = 0;
             radioButtonMix1.Checked = true;
             radioButtonFt1.Checked  = true;
             txtSearch.Text          = tmp;
             var    mySql  = new mySql();
             string search = "and flowers.plu=" + txtSearch.Text;
             CBselect = mySql.selectFlAddOr + search;
             mySql.GetData(CBselect, bindingSource1);
             mySql.updateAntall(lblAddOrAntalFl, dataGridViewOA);
         }
     }
 }
Example #2
0
        private void cbSleeve_SelectedIndexChanged(object sender, EventArgs e)
        {
            var mySql = new mySql();

            whSleeve = mySql.findCbValue(cbSleeve, whSleeve, btnRemoveAOS, dataGridView4, "and sleeves.sleeve_id=", txtSearch);
            CBselect = mySql.selectFlAddOr + whFarm + whLen + whColour + whSleeve + whMix + whFt;
            mySql.GetData(CBselect, bindingSource1);
            mySql.updateAntall(lblAddOrAntalFl, dataGridViewOA);
        }
Example #3
0
        private void radioButtonFt3_CheckedChanged(object sender, EventArgs e)
        {
            var mySql = new mySql();

            if (radioButtonFt3.Checked)
            {
                whFt = "and flowers.fairtrade=0";
            }
            CBselect = mySql.selectFlAddOr + whFarm + whLen + whColour + whSleeve + whMix + whFt;
            mySql.GetData(CBselect, bindingSource1);
            txtSearch.Text = "";
            mySql.updateAntall(lblAddOrAntalFl, dataGridViewOA);
        }
Example #4
0
 private void btnSearchFl_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(txtSearch.Text))
     {
     }
     else
     {
         string tmp = txtSearch.Text;
         cbLengths.SelectedIndex = 0;
         cbColour.SelectedIndex  = 0;
         cbFarm.SelectedIndex    = 0;
         cbSleeve.SelectedIndex  = 0;
         radioButtonMix1.Checked = true;
         radioButtonFt1.Checked  = true;
         txtSearch.Text          = tmp;
         var    mySql  = new mySql();
         string search = "and flowers.plu=" + txtSearch.Text;
         CBselect = mySql.selectFlAddOr + search;
         mySql.GetData(CBselect, bindingSource1);
         mySql.updateAntall(lblAddOrAntalFl, dataGridViewOA);
     }
 }
Example #5
0
        private void AddOr_Load(object sender, EventArgs e)
        {
            var mySql = new mySql();

            CBselect = mySql.selectFlAddOr + whFarm + whLen + whColour + whSleeve + whMix + whFt;
            dataGridViewOA.DataSource = bindingSource1;
            mySql.GetData(CBselect, bindingSource1);
            dataGridViewOA.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            //fill up dataGridView by Farms
            dataGridView1.DataSource = bindingSource5;
            mySql.GetData(mySql.selectFarms, bindingSource5);
            //fill up dataGridView by Lengths
            dataGridView2.DataSource = bindingSource2;
            mySql.GetData(mySql.selectLengths, bindingSource2);
            ////fill up dataGridView by Colours
            dataGridView3.DataSource = bindingSource3;
            mySql.GetData(mySql.selectColour, bindingSource3);
            ////fill up dataGridView by Sleeves
            dataGridView4.DataSource = bindingSource4;
            mySql.GetData(mySql.selectSleeve, bindingSource4);
            //fill up combo boxes
            mySql.fillUpCb(cbFarm, "SELECT farms.farm_name FROM[MG_inkjop].[dbo].[farms]");
            mySql.fillUpCb(cbLengths, "SELECT lengths.length FROM[MG_inkjop].[dbo].[lengths]");
            mySql.fillUpCb(cbColour, "SELECT colours.colour FROM[MG_inkjop].[dbo].[colours]");
            mySql.fillUpCb(cbSleeve, "SELECT sleeves.sleeve FROM[MG_inkjop].[dbo].[sleeves]");
            dataGridViewOA.Columns[0].Visible = true;

            dataGridViewOrders.DataSource = bindingSourceOrders;
            mySql.GetData("select order_number from [MG_inkjop].[dbo].[orders] group by order_number", bindingSourceOrders);
            dataGridViewOrders.AllowUserToAddRows = false;//prevent from create empt row on the end

            tabControlAddOrder.Appearance = TabAppearance.Buttons;
            tabControlAddOrder.ItemSize   = new Size(0, 1);
            tabControlAddOrder.SizeMode   = TabSizeMode.Fixed;

            radioButtonMix1.Checked = true;
            radioButtonFt1.Checked  = true;
            mySql.updateAntall(lblAddOrAntalFl, dataGridViewOA);
        }