private void next_Click(object sender, EventArgs e) { if (Inscription2.user.mother == 1) { Person mother = new Person(); mother.personName = motherNameTxt.Text; mother.jobstudylevel = motherJobTxt.Text; mother.schedule = motherScheduleTxt.Text; mother.type = "mother"; // to do // add type col to database // mother.type = "mother" Inscription1.projectdb.Person.InsertOnSubmit(mother); Inscription1.projectdb.SubmitChanges(); } if (Inscription2.user.father == 1) { Person father = new Person(); father.personName = fatherNameTxt.Text; father.jobstudylevel = fatherJobTxt.Text; father.schedule = fatherScheduleTxt.Text; father.type = "father"; // to do // add type col to database // father.type = "father" Inscription1.projectdb.Person.InsertOnSubmit(father); Inscription1.projectdb.SubmitChanges(); } if (Inscription2.user.status == 1) { SpouseName s = new SpouseName(); s.Show(); this.Hide(); } else { MainMenu main = new MainMenu(); main.Show(); this.Hide(); } }
private void next_Click(object sender, EventArgs e) { Children children = new Children(); //children.IdChildren = nbChildrenSubmited ; children.childrenName = childrenNameTxt.Text; children.studyLevel = degreeTxt.Text; children.schoolDistance = int.Parse(schoolDistanceTxt.Text); //lezem nzid job/etudiant fi children w baed nzid f person. Inscription1.projectdb.Children.InsertOnSubmit(children); Inscription1.projectdb.SubmitChanges(); this.nbChildrenSubmited++; Person person = new Person(); person.personName = childrenNameTxt.Text; person.jobstudylevel = degreeTxt.Text; person.schedule = childrenschedule.Text; person.type = "children"; Inscription1.projectdb.Person.InsertOnSubmit(person); Inscription1.projectdb.SubmitChanges(); if (Inscription2.user.nbChildren == this.nbChildrenSubmited) { if ((Inscription2.user.father == 1) || (Inscription2.user.mother == 1)) { Parent parent = new Parent(); parent.Show(); this.Hide(); } else if (Inscription2.user.status == 1) { SpouseName spouse = new SpouseName(); spouse.Show(); this.Hide(); } } else { childrenNameTxt.Text = ""; schoolDistanceTxt.Text = ""; degreeTxt.Text = ""; } }