private void SaveEducationalBG() { t_EmpEducationalBackground educ = new t_EmpEducationalBackground(); educ.EmpID = NewEmpID; educ.ElementarySchool = ElementarySchool.Text; educ.ElementaryAddress = ElementaryAddress.Text; educ.ElementaryYear = ElementaryYear.Text; educ.SecondarySchool = SecondarySchool.Text; educ.SecondaryAddress = SecondaryAddress.Text; educ.SecondaryYear = SecondaryYear.Text; educ.TertiarySchool = TertiarySchool.Text; educ.TertiaryAddress = TertiaryAddress.Text; educ.TertiaryCourse = TertiaryCourse.Text; educ.TertiaryYear = TertiaryYear.Text; educ.VocationalSchool = VocationalSchool.Text; educ.VocationalCourse = VocationalCourse.Text; educ.VocationalAddress = VocationalAddress.Text; educ.VocationalYear = VocationalYear.Text; educ.PostGraduateSchool = PostGraduatedSchool.Text; educ.PostGraduateCourse = PostGraduatedCourse.Text; educ.PostGraduateAddress = PostGraduatedAddress.Text; educ.PostGraduateYear = PostGraduatedYear.Text; educ.IsLicensed = Convert.ToBoolean(IsLicensed.IsChecked); educ.LastUpdate = DateTime.Now; db.t_EmpEducationalBackground.Add(educ); db.SaveChanges(); }
public void getEmployeeEBG() { //t_EmpEducationalBackground educ = new t_EmpEducationalBackground(); var selectQuery = db.t_EmpEducationalBackground.Where(x => x.EmpID == EmpID.Text); foreach (var item in selectQuery) { t_EmpEducationalBackground myData = item as t_EmpEducationalBackground; ElementarySchool.Text = myData.ElementarySchool; ElementaryAddress.Text = myData.ElementaryAddress; ElementaryYear.Text = myData.ElementaryYear; SecondarySchool.Text = myData.SecondarySchool; SecondaryAddress.Text = myData.SecondaryAddress; SecondaryYear.Text = myData.SecondaryYear; TertiarySchool.Text = myData.TertiarySchool; TertiaryAddress.Text = myData.TertiaryAddress; TertiaryCourse.Text = myData.TertiaryCourse; TertiaryYear.Text = myData.TertiaryYear; VocationalSchool.Text = myData.VocationalSchool; VocationalAddress.Text = myData.VocationalAddress; VocationalCourse.Text = myData.VocationalCourse; VocationalYear.Text = myData.VocationalYear; PostGraduateSchool.Text = myData.PostGraduateSchool; PostGraduateAddress.Text = myData.PostGraduateAddress; PostGraduateCourse.Text = myData.PostGraduateCourse; IsLicensed.IsChecked = Convert.ToBoolean(myData.IsLicensed); PostGraduateYear.Text = myData.PostGraduateYear; } }