示例#1
0
        /// <summary>
        /// Opens The Add Company Window
        /// </summary>
        private void AddCompany()
        {
            Company         c   = new Company();
            CompanyCreation aec = new CompanyCreation(ref c, Enum.EditMode.New);

            aec.ShowDialog();
            if (aec.Exit == Enum.ExitStatus.Ok)
            {
                Companies.Instance.AddObject(aec.Company);
                RefreshListView();
                MarkUnsaved();
            }
        }
示例#2
0
        /// <summary>
        /// Opens The Edit Company Window
        /// </summary>
        private void EditCompany()
        {
            Company c = MainWindow.listviewCompanies.SelectedItem as Company;

            if (c != null)
            {
                CompanyCreation aec = new CompanyCreation(ref c, Enum.EditMode.Edit);
                aec.ShowDialog();
                if (aec.Exit == Enum.ExitStatus.Ok)
                {
                    RefreshListView();
                    MarkUnsaved();
                }
            }
        }