private void button1_Click(object sender, EventArgs e) { try { sf = new studentFeeClass(); dg = new datagridVeiwWorking(); sf.month = comboBox1.Text; sf.year = comboBox2.Text; if (radioButton1.Checked) { string query = "select * from studentFees where monthName ='" + comboBox1.Text + "' and studentYear = '" + comboBox2.Text + "' and paymentAmount >= " + sf.monthlyFee(); dataGridView1.DataSource = dg.goFill(query).Tables[0]; } else if (radioButton2.Checked) { string query = "select * from studentFees where monthName ='" + comboBox1.Text + "' and studentYear = '" + comboBox2.Text + "' and paymentAmount < " + sf.monthlyFee(); dataGridView1.DataSource = dg.goFill(query).Tables[0]; } } catch (FormatException) { MessageBox.Show("Enter Correct Values!!", "Alert!"); } }
private void employeeSalaryInformation_Load(object sender, EventArgs e) { radioLoad rad = new radioLoad(); comboBox1.DataSource = rad.mydt("select * from employeeBoxData"); comboBox1.DisplayMember = "Id"; comboBox1.ValueMember = "Id"; dg.query = "select * from employeePayments"; dataGridView1.DataSource = dg.goFill().Tables[0]; }
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 employeeSalaries_Load(object sender, EventArgs e) { radioLoad rad = new radioLoad(); comboBox1.DataSource = rad.mydt("select * from employeeBoxData"); comboBox1.DisplayMember = "Id"; comboBox1.ValueMember = "Id"; comboBox2.DataSource = rad.mydt("select * from monthNames"); comboBox2.DisplayMember = "title"; comboBox2.ValueMember = "ID"; textBox1.Enabled = false; textBox2.Enabled = false; textBox2.Text = DateTime.Now.ToShortDateString(); dg.query = "SELECT * from employeePayments"; dataGridView1.DataSource = dg.goFill().Tables[0]; }
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) { dg.query = "SELECT serialNo,titleBook,authorBook,quantity,placeLibrary,conditionBook from addingBooks where quantity >" + 0; dataGridView1.DataSource = dg.goFill().Tables[0]; sd = new showingData(); li = new library(); string queryForCount = "select count(studentID) from IssueBooks where studentID = " + comboBox1.Text; countingAdmissions = sd.countAdmission(queryForCount); numberOfQuantity = li.checkQuantity(Convert.ToInt32(comboBox2.Text)); if (countingAdmissions >= limit) { MessageBox.Show("Return previous Books!!", "Alert"); } else { if (numberOfQuantity > 0) { string querya = "Select bookID from IssueBooks where studentID =" + comboBox1.Text; string checkID = li.alreadyExitsBook(querya); if (comboBox2.Text != checkID) { string query = "insert into IssueBooks(studentID,studentName,takenBooks,maxAllowed,bookID,issueDate,lastDate)values('" + comboBox1.Text + "','" + textBox2.Text + "','" + Convert.ToInt32(textBox1.Text) + "','" + Convert.ToInt32(textBox3.Text) + "','" + comboBox2.Text + "','" + textBox4.Text + "','" + textBox5.Text + "')"; li = new library(); li.updateBook(query); li.minusQuantity(Convert.ToInt32(comboBox2.Text)); MessageBox.Show("Book has been issued Successfully!!!"); textBox1.Clear(); textBox2.Clear(); } else { MessageBox.Show("This book is already Issued to you!!"); } } else { MessageBox.Show("Book quantity is zero!!", "Alert"); } } }