private void Form1_Load(object sender, EventArgs e) { FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; TopMost = false; for (int i = 1; i < 7; i++) { if (i != 2) { expendituredb cdb = new expendituredb(); cdb.get(i); chart1.Series["Expenditures"].Points.AddXY(cdb.name, cdb.amount); } } for (int i = 1; i <= 7; i++) { if (i != 3) { raw_materialdb idb = new raw_materialdb(); idb.get(i); chart2.Series["Material"].Points.AddXY(idb.name, idb.quantity); } } }
private void Expenditures_Load(object sender, EventArgs e) { FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; TopMost = false; dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("Arial", 10); dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; expendituredb exdb = new expendituredb(); dataGridView1.DataSource = exdb.selectall(); }
private void dataGridView1_MouseClick(object sender, MouseEventArgs e) { string id = dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); expendituredb idb = new expendituredb(); idb.get(Int32.Parse(id)); textBox1.Text = idb.name; textBox2.Text = idb.amount; dateTimePicker1.Text = idb.date; textBox4.Text = idb.expentidure; }
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 expenditures where Name='" + textBox1.Text + "'"; cmd.ExecuteNonQuery(); expendituredb rdb = new expendituredb(); dataGridView1.DataSource = rdb.selectall(); con.Close(); textBox1.Text = ""; textBox2.Text = ""; dateTimePicker1.Text = ""; textBox4.Text = ""; }
private void button1_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 expenditures (Name, amount, date, expenditure_for) values ('" + textBox1.Text + "','" + textBox2.Text + "','" + dateTimePicker1.Text + "','" + textBox4.Text + "')"; cmd.ExecuteNonQuery(); expendituredb edb = new expendituredb(); dataGridView1.DataSource = edb.selectall(); con.Close(); textBox1.Text = ""; textBox2.Text = ""; //textBox3.Text = ""; textBox4.Text = ""; }