Esempio n. 1
0
		/// <summary>
		/// Initializes the tree
		/// </summary>
		public void SetStructure()
		{
			departments = model.GetDepartments();
			employees = model.GetEmployees();
			Department rootDepartment = departments.First(d => d.ParentDepartmentID == null);
			if(rootDepartment.ParentDepartmentID != null)
			{
				throw new ArgumentException("Company department not found");
			}
			company = new TreeNode(rootDepartment.Name) { Tag = rootDepartment.ID};
			Guid id = rootDepartment.ID;
			GetDepartmentStructure(company, id);
			view.ShowTreeStructure(company);
		}
Esempio n. 2
0
 public AddEditPresenter(CompanyPresenter parent, ICompanyModel model, ViewMode mode)
 {
     this.model           = model;
     departments          = model.GetDepartments();
     employees            = model.GetEmployees();
     this.mode            = mode;
     this.parentPresenter = parent;
     this.editView        = new AddEditForm(this);
     editView.LoadForm();
 }
Esempio n. 3
0
 public AddEditPresenter(CompanyPresenter parent, ICompanyModel model, ViewMode mode, Empoyee employee)
 {
     this.model              = model;
     departments             = model.GetDepartments();
     employees               = model.GetEmployees();
     this.editedEmployee     = employee;
     this.originalDepartment = employee.DepartmentID;
     this.mode               = mode;
     this.parentPresenter    = parent;
     this.editView           = new AddEditForm(this);
     editView.LoadForm(editedEmployee);
 }