private void add_Click(object sender, EventArgs e) { if (textBox8.Text == "") { var myForm = new Views.ErrorPop(); myForm.Show(); return; } Consultant c = new Consultant(Convert.ToInt32(textBox1.Text), textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text, Convert.ToInt32(textBox7.Text), textBox8.Text); FileManager fm = new FileManager(); Admin admin = fm.ReadFromJsonFile <Admin>(Constants.Constants.adminFileName); admin.addConsultant(c); }
public void addConsultant(Consultant c) { Constants.Constants.consultants.Add(c); fm.WriteToJsonFile(Constants.Constants.consultantFileName, Constants.Constants.consultants); }