Пример #1
0
        //public List<cCompoundBow> GetBowSpecs(string BowName)
        public cCompoundBow GetBowSpecs(string BowName)
        {
            if (BowName != "")
            {
                cDataController db = new cDataController();
                db.OpenDatabase(Directory.GetCurrentDirectory().ToString() + "./data/AW.db");
                //Name,MinDrawLength,MaxDrawLength,MinDrawWeight,MaxDrawWeight,AxleToAxle,Weight,BraceHeight,Letoff,IBOSpeed
                DataTable dtTmp = db.ExecuteQuery("select * from Bows where Name='" + BowName + "'");

                foreach (DataRow row in dtTmp.Rows)
                {
                    string Name;
                    double MinDrawLength, MaxDrawLength, MinDrawWeight, MaxDrawWeight, AxleToAxle, Weight, BraceHeight, LetOff, IBOSpeed;

                    Name          = row["Name"].ToString();
                    MinDrawLength = Convert.ToDouble(row["MinDrawLength"].ToString());
                    MaxDrawLength = Convert.ToDouble(row["MaxDrawLength"].ToString());
                    MinDrawWeight = Convert.ToDouble(row["MinDrawWeight"].ToString());
                    MaxDrawWeight = Convert.ToDouble(row["MaxDrawWeight"].ToString());
                    AxleToAxle    = Convert.ToDouble(row["AxleToAxle"].ToString());
                    Weight        = Convert.ToDouble(row["Weight"].ToString());
                    BraceHeight   = Convert.ToDouble(row["BraceHeight"].ToString());
                    // fix db or try catch
                    LetOff   = Convert.ToDouble(row["Letoff"].ToString());
                    IBOSpeed = Convert.ToDouble(row["IBOSpeed"].ToString());

                    cCompoundBow tmpCompoundBow = new cCompoundBow(Name, MinDrawLength, MaxDrawLength, MinDrawWeight, MaxDrawWeight, AxleToAxle, Weight, BraceHeight, LetOff, IBOSpeed);
                    return(tmpCompoundBow);
                }
            }
            return(null);
        }
Пример #2
0
        private void listBoxSysBows_SelectedIndexChanged(object sender, EventArgs e)
        {
            cCompoundBowTools cTools = new cCompoundBowTools();

            cCompoundBow Tmp = cTools.GetBowSpecs(listBoxSysBows.Text);

            groupBoxA.Text         = Tmp.BowName.ToString();
            lblAAtA.Text           = ConvertToFraction(Tmp.AxleToAxleLength).ToString();
            lblABraceHeight.Text   = ConvertToFraction(Tmp.BraceHeight).ToString();
            lblAIBOSpeed.Text      = Tmp.IBOSpeed.ToString();
            lblALetoff.Text        = Tmp.LetOff.ToString();
            lblAMaxDrawLength.Text = ConvertToFraction(Tmp.MaxDrawDistance).ToString();
            lblAMaxDrawWeight.Text = ConvertToFraction(Tmp.MaxDrawWeight).ToString();
            lblAMinDrawLength.Text = ConvertToFraction(Tmp.MinDrawDistance).ToString();
            lblAMinDrawWeight.Text = ConvertToFraction(Tmp.MinDrawWeight).ToString();
            lblAWeight.Text        = ConvertToFraction(Tmp.Weight).ToString();
        }
Пример #3
0
        private void GetBowSpecs(string BowName)
        {
            cCompoundBowTools cTools = new cCompoundBowTools();

            cCompoundBow Tmp = cTools.GetBowSpecs(listBoxSysBows.Text);

            groupBoxSysBowSpecs.Text = Tmp.BowName.ToString();
            lblSysAxleToAxle.Text    = Tmp.AxleToAxleLength.ToString();
            lblSysBraceHeight.Text   = Tmp.BraceHeight.ToString();
            lblSysIBOSpeed.Text      = Tmp.IBOSpeed.ToString();
            lblSysLetOff.Text        = Tmp.LetOff.ToString();
            lblSysMaxDrawLength.Text = Tmp.MaxDrawDistance.ToString();
            lblSysMaxDrawWeight.Text = Tmp.MaxDrawWeight.ToString();
            lblSysMinDrawLength.Text = Tmp.MinDrawDistance.ToString();
            lblSysMinDrawWeight.Text = Tmp.MinDrawWeight.ToString();
            lblSysWeight.Text        = Tmp.Weight.ToString();

            txtUsrIBOSpeed.Text = lblSysIBOSpeed.Text;

            if (checkBoxUsrWarnings.Checked)
            {
                if ((Convert.ToDouble(txtUsrDrawWeight.Text)) > (Convert.ToDouble(lblSysMaxDrawWeight.Text)))
                {
                    MessageBox.Show("The selected bow's Draw Weight it below your preffered draw weight");
                    txtUsrDrawWeight.Text = lblSysMaxDrawWeight.Text;
                }

                if ((Convert.ToDouble(txtUsrDrawWeight.Text)) < (Convert.ToDouble(lblSysMinDrawWeight.Text)))
                {
                    MessageBox.Show("The selected bow's Minimum Draw Weight it above your preffered draw weight");
                    txtUsrDrawWeight.Text = lblSysMinDrawWeight.Text;
                }

                if (Convert.ToDouble(txtUsrDrawLength.Text) > Convert.ToDouble(lblSysMaxDrawLength.Text))
                {
                    MessageBox.Show("The selected bow's Draw Length is too short for you.");
                    txtUsrDrawLength.Text = lblSysMaxDrawLength.Text;
                }

                if (Convert.ToDouble(txtUsrDrawLength.Text) < Convert.ToDouble(lblSysMinDrawLength.Text))
                {
                    MessageBox.Show("The selected bow's Minimum Draw Length is too much for you.");
                    txtUsrDrawLength.Text = lblSysMaxDrawLength.Text;
                }
            }
        }
Пример #4
0
        private void btnToBlockB_Click(object sender, EventArgs e)
        {
            cCompoundBowTools cTools = new cCompoundBowTools();

            cCompoundBow Tmp = cTools.GetBowSpecs(listBoxSysBows.Text);

            groupBoxB.Text         = Tmp.BowName.ToString();
            lblBAtA.Text           = Tmp.AxleToAxleLength.ToString();
            lblBBraceHeight.Text   = Tmp.BraceHeight.ToString();
            lblBIBOSpeed.Text      = Tmp.IBOSpeed.ToString();
            lblBLetoff.Text        = Tmp.LetOff.ToString();
            lblBMaxDrawLength.Text = Tmp.MaxDrawDistance.ToString();
            lblBMaxDrawWeight.Text = Tmp.MaxDrawWeight.ToString();
            lblBMinDrawLength.Text = Tmp.MinDrawDistance.ToString();
            lblBMinDrawWeight.Text = Tmp.MinDrawWeight.ToString();
            lblBWeight.Text        = Tmp.Weight.ToString();
        }