private void button1_Click(object sender, EventArgs e) { try { returnBookClass ba = new returnBookClass(); DateTime d1 = Convert.ToDateTime(textBox1.Text); DateTime d2 = Convert.ToDateTime(textBox2.Text); ba.lastDate = d1; ba.returnDate = d2; ba.bookNo = comboBox2.Text; ba.studentNo = textBox5.Text; string query = "select conditionBook from addingBooks where serialNo =" + comboBox2.Text; ba.updateQuery = "update addingBooks set quantity = quantity + 1 where serialNo=" + comboBox2.Text; ba.conditionOfBook = comboBox3.Text; ba.returnBookWith = rbc.showingData(query); MessageBox.Show(ba.checkCondition(), "Alert!!"); textBox5.Clear(); textBox1.Clear(); textBox2.Clear(); } catch (FormatException) { MessageBox.Show("Insert Correct Values!!!"); } }
private void button3_Click(object sender, EventArgs e) { if (textBox5.Text != "") { rad = new radioLoad(); rbc = new returnBookClass(); string query = "select studentID,studentName, titleBook,authorBook,placeLibrary,conditionBook from IssueBooks INNER JOIN addingBooks on addingBooks.serialNo = IssueBooks.bookID where studentID = " + textBox5.Text; dataGridView1.DataSource = dv.goFill(query).Tables[0]; textBox1.Enabled = true; textBox2.Enabled = true; comboBox2.Enabled = true; comboBox3.Enabled = true; comboBox2.DataSource = rad.mydt("select * from IssueBooks where studentID = " + textBox5.Text); comboBox2.DisplayMember = "bookID"; comboBox2.ValueMember = "studentID"; rbc.bookD = comboBox2.Text; rbc.studentD = textBox5.Text; } else { MessageBox.Show("Enter Student ID", "Alert!!"); } textBox2.Text = DateTime.Now.ToString(); }
private void button1_Click(object sender, EventArgs e) { dg = new datagridVeiwWorking(); rb = new returnBookClass(); radioLoad rad = new radioLoad(); dg.query = "SELECT studentID,studentName,serialNo,titleBook,authorBook FROM addingBooks INNER JOIN IssueBooks ON addingBooks.serialNo = IssueBooks.bookID where studentID=" + comboBox1.Text; dataGridView1.DataSource = dg.goFill().Tables[0]; comboBox2.DataSource = rad.mydt("select * from IssueBooks where studentID = " + comboBox1.Text); comboBox2.DisplayMember = "bookID"; comboBox2.ValueMember = "studentID"; }
private void button1_Click(object sender, EventArgs e) { try { returnBookClass rbc = new returnBookClass(); rbc.updateMethod("insert into payScales(gradeNo,salary) values('" + comboBox1.Text + "','" + Convert.ToInt32(textBox2.Text) + "')"); MessageBox.Show("Pay Scale Inserted!!"); } catch (FormatException) { MessageBox.Show("Enter all values!!"); } }
private void button4_Click(object sender, EventArgs e) { rb = new returnBookClass(); string query = "select lastDate from IssueBooks where studentID=" + comboBox1.Text + "and bookID=" + comboBox2.Text; OleDbDataReader reader = rb.dataReader(query); if (reader.Read()) { mydate = Convert.ToDateTime(reader["lastDate"]); } textBox1.Text = mydate.ToShortDateString(); }