// calling update function to update lecturer records private void button1_Click(object sender, EventArgs e) { addLecturerControl updateLec = new addLecturerControl(); updateLec.updateLec(m_lec_name.Text, m_lec_Id.Text, m_lec_Faculty.Text, m_lec_dept.Text, m_lec_Center.Text, m_lec_Building.Text, int.Parse(m_lec_Level.Text), float.Parse(m_lec_Rank.Text), int.Parse(m_lec_Lid.Text)); lecturerView.DataSource = controlLec.GetLecturerDetails(); }
//rank genarate key method private void button2_Click(object sender, EventArgs e) { addLecturerControl rankGenarate = new addLecturerControl(); float Rank = rankGenarate.generatteRank(int.Parse(lec_Level.Text), int.Parse(lec_Id.Text)); lec_Rank.Text = Rank.ToString(); }
// function for delete lecturer record details private void button2_Click(object sender, EventArgs e) { addLecturerControl delete = new addLecturerControl(); try { delete.deleteRow(int.Parse(m_lec_Lid.Text)); lecturerView.DataSource = controlLec.GetLecturerDetails(); } catch (ArithmeticException) { MessageBox.Show("invalid data type"); } reset(); }