Ejemplo n.º 1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string search = "";

            if (comboBoxName.Text != "Any")
            {
                search += "Name Like \"" + comboBoxName.Text + "%\" ";
            }
            else
            {
                search += "Name Like \"%\"";
            }

            if (txtUsrDrawWeight.Text != "")
            {
                search += "and MinDrawWeight<=" + txtUsrDrawWeight.Text + " and MaxDrawWeight >=" + txtUsrDrawWeight.Text + " ";
            }

            if (txtUsrDrawLength.Text != "")
            {
                search += "and MinDrawLength <= " + txtUsrDrawLength.Text + " and MaxDrawLength>=" + txtUsrDrawLength.Text + " ";
            }

            if (txtUsrBraceHeight.Text != "")
            {
                search += "and BraceHeight <= " + txtUsrBraceHeight.Text + " ";
            }

            if (txtUsrMaxAtA.Text != "")
            {
                search += "and AxleToAxle <= " + txtUsrMaxAtA.Text + " ";
            }

            if (txtUsrMinAtA.Text != "")
            {
                search += "and AxleToAxle >= " + txtUsrMinAtA.Text + " ";
            }

            if (txtMaxWeight.Text != "")
            {
                search += "and Weight <= " + txtMaxWeight.Text + " ";
            }

            List <string> tmpList = new List <string>();

            cCompoundBowTools cTools = new cCompoundBowTools();

            tmpList = cTools.FindBows(search);

            listBoxSysBows.Items.Clear();
            for (int i = 0; i < tmpList.Count; i++)
            {
                listBoxSysBows.Items.Add(tmpList[i]);
            }

            lblCount.Text = tmpList.Count.ToString() + " Bows";
        }
Ejemplo n.º 2
0
        private void comboBoxBows_SelectedIndexChanged(object sender, EventArgs e)
        {
            string            search  = "";
            List <string>     tmpList = new List <string>();
            cCompoundBowTools cTools  = new cCompoundBowTools();

            if (comboBoxBows.Text != "Any")
            {
                search  = "Name Like \"" + comboBoxBows.Text + "%\" ";
                tmpList = cTools.FindBows(search);
            }
            else
            {
                tmpList = cTools.GetBows();
            }

            listBoxSysBows.Items.Clear();
            for (int i = 0; i < tmpList.Count; i++)
            {
                listBoxSysBows.Items.Add(tmpList[i]);
            }
        }