private void button9_Click(object sender, EventArgs e) { if (textBox1.Visible == false) { textBox1.Visible = true; } else { TeachersDo Manager = new TeachersDo(); Manager.RemoveRecord(Convert.ToInt32(textBox1.Text)); MessageBox.Show(Manager.Err); textBox1.Visible = false; } }
private void button1_Click(object sender, EventArgs e) { TeachersDo emp = new TeachersDo(); //Removing the record emp.RemoveRecord(Convert.ToInt32(textBox1.Text)); //Updating the record if (textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && textBox5.Text != "" && textBox6.Text != "" && textBox7.Text != "" && textBox8.Text != "" && textBox11.Text != "" && textBox12.Text != "") { emp.id = Convert.ToInt32(textBox1.Text); emp.name = textBox2.Text; emp.designation = textBox3.Text; emp.address = textBox4.Text; emp.phone = Convert.ToInt32(textBox5.Text); emp.mphone = Convert.ToInt32(textBox6.Text); emp.whours = textBox7.Text; emp.dateofjoining = textBox8.Text; emp.qualification = textBox11.Text; emp.salary = Convert.ToInt32(textBox12.Text); emp.accounttype = "Teacher"; emp.AddRecords(); if (emp.Err == "Id Duplication") { MessageBox.Show("Id already Exists"); } else { MessageBox.Show("Updated"); } } else { MessageBox.Show("Enter all the fields"); } }