private void btnAddSubject_Click(object sender, EventArgs e) { frmView_Subject obj = new frmView_Subject(); obj.u_name = u_name; obj.pusername = username; obj.password = password; obj.ptype = type; obj.security = security; obj.answer = answer; obj.email = email; obj.mobileno = mobileno; obj.academicyear = cmbacademicyear.Text.Trim(); this.Hide(); obj.Show(); }
private void btnEditSubject_Click(object sender, EventArgs e) { try { frmView_Subject obj = new frmView_Subject(); obj.Subject_Name = dgvSubjects.SelectedCells[3].Value.ToString(); obj.update = true; obj.u_name = u_name; obj.pusername = username; obj.password = password; obj.ptype = type; obj.security = security; obj.answer = answer; obj.email = email; obj.mobileno = mobileno; this.Hide(); obj.Show(); } catch (Exception) { MessageBox.Show("First select Data to edit!"); } }