Beispiel #1
0
        public Form1()
        {
            InitializeComponent();
            string          MyConString = "SERVER=db4free.net;" + "DATABASE=kitbox_kewlax;" + "UID=kewlaw;" + "PASSWORD=locomac6; old guids = true";
            MySqlConnection conn        = new MySqlConnection(MyConString);

            conn.Open();
            List <string> WidthBoxList = QueryKitbox.SpecsBoxList(conn, "Largeur", "Ref = \"Panneau Ar\"");

            conn.Close();
            conn.Open();
            List <string> HeightBoxList = QueryKitbox.SpecsBoxList(conn, "hauteur", "Ref = \"Panneau GD\"");

            conn.Close();
            conn.Open();
            List <string> ColorBoxList = QueryKitbox.SpecsBoxList(conn, "Couleur", "Ref = \"Porte\"");

            conn.Close();
            conn.Open();
            List <string> DepthBoxList = QueryKitbox.SpecsBoxList(conn, "profondeur", "Ref = \"Panneau GD\"");

            conn.Close();

            /*
             * conn.Open();
             * List<string> ColorcrossList = QueryKitbox.SpecsBoxList(conn, "Couleur", "Ref = \"Traverse AR\"");
             * conn.Close();
             */

            comboBox3.Items.AddRange(new object[] { "1", "2", "3", "4", "5", "6", "7" });
            comboBox4.Items.AddRange(WidthBoxList.Cast <object>().ToArray());
            comboBox5.Items.AddRange(DepthBoxList.Cast <object>().ToArray());
            comboBox6.Items.AddRange(HeightBoxList.Cast <object>().ToArray());
            comboBox2.Items.AddRange(ColorBoxList.Cast <object>().ToArray());
        }
Beispiel #2
0
        public Form_purchase()
        {
            InitializeComponent();

            int    totalHeight = 0;
            Locker locker;

            foreach (ICupboardComponents cupCompo in ShoppingCart.cupboardComponentsList)
            {
                if (cupCompo is Locker)
                {
                    locker = (Locker)cupCompo;

                    int    currentbox = locker.ID;
                    string height     = locker.height.ToString();
                    //string depth = locker.depth.ToString();
                    string doorsColor = EnumParse.parseColorEnumToStr(locker.doorsColor);
                    string panelColor = EnumParse.parseColorEnumToStr(locker.panelColor);
                    string price      = locker.price.ToString();

                    totalHeight += locker.height + 4;

                    dataGridView1.Rows.Add(currentbox, height, doorsColor, false, panelColor, price);
                }
            }
            string          MyConString = "SERVER=db4free.net;" + "DATABASE=kitbox_kewlax;" + "UID=kewlaw;" + "PASSWORD=locomac6; old guids = true";
            MySqlConnection conn        = new MySqlConnection(MyConString);

            conn.Open();
            List <string> HeightBracketsList = QueryKitbox.SpecsBoxList(conn, "Height", "Ref = \"AngleBracket\"");

            conn.Close();
            int angleBracketHeight = 0;
            int diff;
            int minDiff = 1000;

            foreach (string heightBracket in HeightBracketsList)
            {
                diff = Int32.Parse(heightBracket) - totalHeight;
                if (diff >= 0 && diff < minDiff)
                {
                    minDiff            = diff;
                    angleBracketHeight = Int32.Parse(heightBracket);
                }
            }

            conn.Open();
            string angleBracketPrices = DbUtils.BigMoney(conn, "CustPrice", "AngleBracket", angleBracketHeight.ToString(), "0", "0", EnumParse.parseColorEnumToStr(ShoppingCart.colorAngleBracketChosen))[0];

            conn.Close();
            double angleBracketPrice = Double.Parse(angleBracketPrices);

            AngleBracket angleBrackets = new AngleBracket(angleBracketPrice, "null", "0000", new ComponentSize(0, 0, 0), true, ShoppingCart.colorAngleBracketChosen);

            ShoppingCart.addCupboardComponent(angleBrackets);

            dataGridView1.Rows.Add("Anglebrackets", angleBracketHeight, " ", null, " ", angleBracketPrice.ToString() + " x4");
        }
Beispiel #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            //refresh combobox height
            string          MyConString = "SERVER=db4free.net;" + "DATABASE=kitbox_kewlax;" + "UID=kewlaw;" + "PASSWORD=locomac6; old guids = true";
            MySqlConnection conn        = new MySqlConnection(MyConString);

            conn.Open();
            List <string> HeightBoxList = QueryKitbox.SpecsBoxList(conn, "hauteur", "Ref = \"Panneau GD\"");

            conn.Close();
            comboBox6.Items.Clear();
            comboBox6.Items.AddRange(HeightBoxList.Cast <object>().ToArray());
            //allow to create new cupboard
            button1.Enabled = true;
        }
Beispiel #4
0
        private void button3_Click(object sender, EventArgs e)
        {
            button2.Visible = false;
            button2.Enabled = false;
            button4.Visible = true;
            button4.Enabled = true;

            dataGridView1.Enabled = true;

            string          MyConString = "SERVER=db4free.net;" + "DATABASE=kitbox_kewlax;" + "UID=kewlaw;" + "PASSWORD=locomac6; old guids = true";
            MySqlConnection conn        = new MySqlConnection(MyConString);

            conn.Open();
            List <string> HeightBoxList = QueryKitbox.SpecsBoxList(conn, "Height", "Ref = \"Panel B\"");

            conn.Close();
            comboBox5.Items.Clear();
            comboBox5.Items.AddRange(HeightBoxList.Cast <object>().ToArray());
        }
Beispiel #5
0
        public User_Interface()
        {
            InitializeComponent();

            this.WindowState = FormWindowState.Maximized;

            string MyConString = "SERVER=localhost;" + "DATABASE=kitbox;" + "UID=root;" + "PASSWORD=K8tB0x_sql; old guids = true";
            //string MyConString = "SERVER=db4free.net;" + "DATABASE=kitbox_kewlax;" + "UID=kewlaw;" + "PASSWORD=locomac6; old guids = true";
            MySqlConnection conn = new MySqlConnection(MyConString);

            conn.Open();
            List <string> WidthBoxList = QueryKitbox.SpecsBoxList(conn, "Width", "Ref = \"Panel B\"");

            conn.Close();
            conn.Open();
            List <string> DepthBoxList = QueryKitbox.SpecsBoxList(conn, "Depth", "Ref = \"Panel LR\"");

            conn.Close();
            conn.Open();
            List <string> BracketsColorList = QueryKitbox.SpecsBoxList(conn, "Colour", "Ref = \"AngleBracket\"");

            conn.Close();
            conn.Open();
            List <string> HeightBoxList = QueryKitbox.SpecsBoxList(conn, "Height", "Ref = \"Panel B\"");

            conn.Close();
            conn.Open();
            List <string> ColorDoorList = QueryKitbox.SpecsBoxList(conn, "Colour", "Ref = \"Door\"");

            conn.Close();
            conn.Open();
            List <string> ColorPannelBaList = QueryKitbox.SpecsBoxList(conn, "Colour", "Ref = \"Panel B\"");

            conn.Close();
            conn.Open();
            List <string> HeightBracketsList = QueryKitbox.SpecsBoxList(conn, "Height", "Ref = \"AngleBracket\"");

            conn.Close();

            comboBox1.Items.AddRange(new object[] { "1", "2", "3", "4", "5", "6", "7" });
            //TODO : get variable globale max_lockers puis boucle pour remplir combobox3
            comboBox2.Items.AddRange(WidthBoxList.Cast <object>().ToArray());
            comboBox3.Items.AddRange(DepthBoxList.Cast <object>().ToArray());
            comboBox4.Items.AddRange(BracketsColorList.Cast <object>().ToArray());
            comboBox5.Items.AddRange(HeightBoxList.Cast <object>().ToArray());
            comboBox6.Items.AddRange(ColorDoorList.Cast <object>().ToArray());
            comboBox6.Items.Add("none");
            comboBox7.Items.AddRange(ColorPannelBaList.Cast <object>().ToArray());
            comboBox9.Items.AddRange(new object[] { "yes", "no" });

            int maxHeight = 0;

            foreach (string heightB in HeightBracketsList)
            {
                int heightBP = Int32.Parse(heightB);
                if (heightBP > maxHeight)
                {
                    maxHeight = heightBP;
                }
            }
            textBox12.Text = "0";
            textBox14.Text = maxHeight.ToString();
            textBox16.Text = "0";

            dataGridView1.Enabled = false;
        }