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();
            comboBox2.Items.Add("New");
            comboBox2.Items.Add("In preparation");
            comboBox2.Items.Add("In delivery");
            comboBox2.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);
                comboBox1.Items.Add(pdb.name);
            }
        }
Example #2
0
        private void DataGridView1_MouseClick(object sender, MouseEventArgs e)
        {
            string     id  = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
            customerdb idb = new customerdb();

            idb.get(Int32.Parse(id));
            textBox1.Text = idb.name;
            textBox2.Text = idb.address;
            textBox3.Text = idb.phone;
        }
Example #3
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 #4
0
        private void Button1_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=DESKTOP-H03A9OV;Initial Catalog=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 #5
0
        private void Button3_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=DESKTOP-H03A9OV;Initial Catalog=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 = "";
        }