/// <summary> /// Constructor /// </summary> /// <param name="companiesTabViewModel">Company tab view Model </param> /// <param name="companyEditWindow"> Company edit window</param> /// <param name="company">Company</param> public CompanyEditWindowViewModel(CompaniesTabViewModel companiesTabViewModel, CompanyEditWindow companyEditWindow, Company company) : base(companiesTabViewModel, companyEditWindow, company) { using (var con = new BaudiDbContext()) { SpecializationList = con.Specializations.ToList(); if (Update) { Company = con.Companies.Find(company.CompanyID); Company.Specializations.ForEach(s => s.IsSelected = true); } else { Company = new Company(); } } }
/// <summary> /// Edit action /// </summary> public override void Edit() { var companyEditWindow = new CompanyEditWindow(this, SelectedCompany); companyEditWindow.Show(); }
/// <summary> /// Add action /// </summary> public override void Add() { var companyEditWindow = new CompanyEditWindow(this, null); companyEditWindow.Show(); }