private void button8_Click_1(object sender, EventArgs e) { try{ if (txtsid.Text == "") { MessageBox.Show("Please, Enter Student ID", "Meera Academy"); } else { IDDT = IDAdapter.SelectByID(Convert.ToInt32(txtsid.Text)); if (IDDT.Rows.Count > 0) { dgstu.DataSource = IDDT; dgstu.Visible = true; btndel.Visible = true; } else { MessageBox.Show("Invalid User ID", "Meera Academy"); dgstu.Visible = false; btndel.Visible = false; } } } catch (Exception a) { MessageBox.Show(a.Message.ToString(), "Error !!"); } }
private void button12_Click(object sender, EventArgs e) { IDDT = IDAdapter.SelectByID(Convert.ToInt32(cmbuser.SelectedValue)); lblpass.Visible = true; btnnewpass.Visible = true; txtchangepassword.Text = ""; txtchangepassword.Visible = true; }
private void btnfeeview_Click(object sender, EventArgs e) { try { txtfeepaid.ReadOnly = true; btnedit.Visible = false; txtfeename.ReadOnly = true; txtfeesure.ReadOnly = true; txtfeemobile.ReadOnly = true; txtfeemail.ReadOnly = true; lblfees.Text = ""; if (txtfeeid.Text != "") { IDDT = IDAdapter.SelectByID(Convert.ToInt32(txtfeeid.Text)); if (IDDT.Rows.Count > 0) { MessageBox.Show("Student Name is " + IDDT.Rows[0]["Studentname"].ToString() + " " + IDDT.Rows[0]["surename"].ToString(), "Meera Academy"); txtfeename.Text = IDDT.Rows[0]["Studentname"].ToString(); txtfeesure.Text = IDDT.Rows[0]["surename"].ToString(); txtfeemobile.Text = IDDT.Rows[0]["contactno"].ToString(); txtfeemail.Text = IDDT.Rows[0]["email"].ToString(); txtfeefees.Text = IDDT.Rows[0]["fees"].ToString(); txtfeepaid.Text = IDDT.Rows[0]["feespaid"].ToString(); txtfeerem.Text = IDDT.Rows[0]["feesrem"].ToString(); cmbfeecollege.Text = IDDT.Rows[0]["college"].ToString(); cmbfeecourse.Text = IDDT.Rows[0]["course"].ToString(); gpupdatefees.Visible = true; lblfeeerror.Text = ""; btnedit.Visible = true; } else { MessageBox.Show("Wrong Student ID", "Meera Academy"); lblfeeerror.Text = ""; gpupdatefees.Visible = false; txtfeeid.Text = ""; txtfeeadd.Text = ""; } } else { lblfeeerror.Text = "Please, Enter Student ID. !!"; } } catch (Exception a) { MessageBox.Show(a.Message.ToString(), "Error!! Meera Academy"); } }
private void btnfeeupdate_Click(object sender, EventArgs e) { try { if (txtfeeadd.Text != "") { IDDT = IDAdapter.SelectByID(Convert.ToInt32(txtfeeid.Text)); //int feepaid = Convert.ToInt32(IDDT.Rows[0]["feespaid"].ToString()) + Convert.ToInt32(txtfeeadd.Text); int feepaid = Convert.ToInt32(txtfeepaid.Text) + Convert.ToInt32(txtfeeadd.Text); if (feepaid > Convert.ToInt32(txtfeefees.Text)) { MessageBox.Show("Error !!, Pais Fees is never more then Total Course Fees", "Meera Academy"); } else { int feerem = Convert.ToInt32(IDDT.Rows[0]["fees"].ToString()) - feepaid; int update = StuAdapt.Update(Convert.ToInt32(txtfeeid.Text), txtfeename.Text, txtfeesure.Text, txtfeemobile.Text, txtfeemail.Text, txtfeefees.Text, feepaid.ToString(), feerem.ToString()); if (update == 1) { //lblfees.Text = "Fees Updated Successfully.!!"; MessageBox.Show("Fees Updatd Successfully.!!", "Meera Academy"); txtfeepaid.ReadOnly = true; txtfeeadd.Text = ""; txtfeename.Text = ""; txtfeesure.Text = ""; txtfeemobile.Text = ""; txtfeemail.Text = ""; txtfeefees.Text = ""; txtfeepaid.Text = ""; txtfeerem.Text = ""; cmbfeecollege.Text = "SELECT"; cmbfeecourse.Text = "SELECT"; gpupdatefees.Visible = false; } } } else { MessageBox.Show("Please, Insert Fees", "Meera Academy"); } } catch (Exception a) { MessageBox.Show(a.Message.ToString(), "Error!! Meera Academy"); } }