Example #1
0
        private void Orders_Load(object sender, EventArgs e)
        {
            FormBorderStyle = FormBorderStyle.None;
            WindowState     = FormWindowState.Maximized;
            TopMost         = false;
            dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("Arial", 12);
            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            customerdb sdb = new customerdb();

            dataGridView1.DataSource = sdb.selectall();
            comboBox1.Items.Add("New");
            comboBox1.Items.Add("In preparation");
            comboBox1.Items.Add("In delivery");
            comboBox1.Items.Add("Delivered");
            comboBox3.Text = "Factory";
            comboBox3.Items.Add("Sales area xyz");
            comboBox3.Items.Add("Sales area xyz");
            comboBox3.Items.Add("Sales area xyz");
            for (int i = 1; i <= 16; i++)
            {
                productsdb pdb = new productsdb();
                pdb.get(i);
                comboBox2.Items.Add(pdb.name);
            }
        }
Example #2
0
        private void Customer_Load(object sender, EventArgs e)
        {
            FormBorderStyle = FormBorderStyle.None;
            WindowState     = FormWindowState.Maximized;
            TopMost         = false;
            dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("Arial", 20);
            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            customerdb cdb = new customerdb();

            dataGridView1.DataSource = cdb.selectall();
        }
Example #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=DESKTOP-GB0LHG2\\MSSQLSERVER01;Database=daudFactoryDB;Integrated Security=True");

            con.Open();
            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "INSERT INTO customers (Name, address, phone) values ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "')";
            cmd.ExecuteNonQuery();
            customerdb edb = new customerdb();

            dataGridView1.DataSource = edb.selectall();
            con.Close();
        }
Example #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=DESKTOP-GB0LHG2\\MSSQLSERVER01;Database=daudFactoryDB;Integrated Security=True");

            con.Open();
            SqlCommand cmd = con.CreateCommand();

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "delete from customers where Name='" + textBox1.Text + "'";
            cmd.ExecuteNonQuery();
            customerdb edb = new customerdb();

            //edb.delete(textBox1.Text);
            dataGridView1.DataSource = edb.selectall();
            con.Close();
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";
        }