Beispiel #1
0
        private void btn_submit_Click(object sender, EventArgs e)
        {
            // getting product id for specification,this table need for foreign key //
            UsingDB usingDB = new UsingDB();
            int     id      = usingDB.GetID("FromAeDB", "GetID", "ProductID");

            // adding product specifications to specifications table //
            usingDB.ConnectDB("FromAeDB");
            string querry = $"'{spefications.txbx_model.Text}','{spefications.txbx_color.Text}','{spefications.txbx_sizes.Text}','{spefications.txbx_cards_count.Text}'," +
                            $"'{spefications.txbx_inner_storage.Text}','{spefications.txbx_ram.Text}','{spefications.txbx_front_camera.Text}','{spefications.txbx_back_camera.Text}','{spefications.txbx_battery_volume.Text}','{id}'";

            usingDB.InsertToDB("ProductSpefications", querry);
            usingDB.DisposeSeans();
            MessageBox.Show("Elan uğurla paylaşıldı." + "\n" + "Elanlar formundan son elana baxa bilərsiz.");
            Form1 f = new Form1();

            f.Show();
            this.Visible = false;
        }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            // adding specification control to specification group box //
            spefications.Location = new Point(5, 15);
            groupBox_spefication.Controls.Add(spefications);

            // showing submit button //
            btn_submit.Visible = true;

            // copy image to photos folder //
            FileInfo fileInfo = new FileInfo(dialog.FileName);
            string   source   = Environment.CurrentDirectory + "/images" + "/" + fileInfo.Name;

            File.Copy(dialog.FileName, source);

            // adding product photo,name and price to database //
            UsingDB usingDB = new UsingDB();

            usingDB.ConnectDB("FromAeDB");
            string values = $"'{txbx_product_name.Text}','{txbx_product_price.Text}','{fileInfo.Name.ToString()}'";

            usingDB.InsertToDB("Products", values);
            usingDB.DisposeSeans();
        }