예제 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            con.Open();
            Exercise_Plane c1 = new Exercise_Plane();
            int            id = Convert.ToInt16(combid.Text);

            c1.delete1(id);
            con.Close();
        }
예제 #2
0
        public void add1(Exercise_Plane c2)
        {
            #region Paramters

            SqlCommand cmd;

            #endregion

            con.Open();
            cmd = new SqlCommand("insert into [Exercise Plane] (halls_id,equip_id,month_id) values ('" + c2.halls_id + "','" + c2.equip_id + "', '" + c2.month_id + "') ", con);
            cmd.ExecuteNonQuery();
            MessageBox.Show("Your Registeration was sucsessful");
            con.Close();
        }
예제 #3
0
        public void edit1(Exercise_Plane c1, int n)
        {
            #region Paramters

            SqlCommand cmd;

            #endregion

            con.Open();

            cmd = new SqlCommand("update [Exercise Plane] set halls_id='" + c1.halls_id + "', equip_id='" + c1.equip_id + "', month_id='" + c1.month_id + "'where ID='" + n + "'", con);
            cmd.ExecuteNonQuery();
            MessageBox.Show("Your Update was sucsessful");
            con.Close();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();

            #region paramter

            Exercise_Plane c1 = new Exercise_Plane();
            int            id = Convert.ToInt32(combid.Text);

            #endregion

            dgv_search_cust.DataSource = c1.search1(id);

            con.Close();
        }
예제 #5
0
        public displayExercise()
        {
            InitializeComponent();

            con.Open();

            #region paramter

            Exercise_Plane c1 = new Exercise_Plane();

            #endregion

            dgv_display_equip.DataSource = c1.display1();

            con.Close();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            #region all statements of add Equipments

            if (combhall.Text != string.Empty && combequip.Text != string.Empty && combmonth.Text != string.Empty)
            {
                int x = 0, y = 0, z = 0;

                con.Open();

                #region check of halls

                if (combhall.Text.Equals("Chest"))
                {
                    x = 1;
                }

                else if (combhall.Text.Equals("Back"))
                {
                    x = 2;
                }

                else if (combhall.Text.Equals("Shoulder"))
                {
                    x = 3;
                }

                else if (combhall.Text.Equals("Biceps"))
                {
                    x = 4;
                }

                else if (combhall.Text.Equals("Triceps"))
                {
                    x = 5;
                }

                else if (combhall.Text.Equals("Leg"))
                {
                    x = 6;
                }

                else
                {
                    x = 7;
                }

                #endregion

                #region check of Equipments

                if (combequip.Text.Equals("Barbell Bench Press"))
                {
                    y = 1;
                }

                else if (combequip.Text.Equals("Flat Bench Dumbbell Press"))
                {
                    y = 2;
                }

                else if (combequip.Text.Equals("Low-Incline Barbell Bench Press"))
                {
                    y = 3;
                }

                else if (combequip.Text.Equals("Machine Decline Press"))
                {
                    y = 4;
                }

                else if (combequip.Text.Equals("Seated Machine Chest Press"))
                {
                    y = 5;
                }

                else if (combequip.Text.Equals("Incline Dumbbell Press"))
                {
                    y = 6;
                }

                else if (combequip.Text.Equals("Dips For Chest"))
                {
                    y = 7;
                }

                else if (combequip.Text.Equals("Incline Bench Cable Fly"))
                {
                    y = 8;
                }

                else if (combequip.Text.Equals("Over"))
                {
                    y = 9;
                }

                else
                {
                    y = 10;
                }

                #endregion

                #region check of Months

                if (combmonth.Text.Equals("Month_1"))
                {
                    z = 1;
                }

                else if (combmonth.Text.Equals("Month_2"))
                {
                    z = 2;
                }

                else
                {
                    z = 3;
                }

                #endregion

                #region paramter

                Exercise_Plane c1 = new Exercise_Plane();
                c1.halls_id = x;
                c1.equip_id = y;
                c1.month_id = z;

                #endregion

                c1.add1(c1);
                con.Close();
            }
            else
            {
                MessageBox.Show("Please make sure that you have entered all the information");
            }


            #endregion
        }