public AddDepartmentForm(Guid perentDepartmentId) { InitializeComponent(); _db = Main.Db; ParentNameLabel.Text = _db.Department.First(l => l.ID == perentDepartmentId).Name; _perentDepartmentId = perentDepartmentId; }
public EmployeeForm(Guid selectedDepartmentId) { InitializeComponent(); _db = Main.Db; _selectedDepartmentId = selectedDepartmentId; InitData(); DepartmentNameLabel.Text = _db.Department.First(l => l.ID == selectedDepartmentId).Name; EmployeeDataGridView.CellDoubleClick += EmployeeDataGridView_CellDoubleClick; }
public EmployeeSetup(Guid selectedDepartmentId) { InitializeComponent(); _db = Main.Db; _selectedDepartmentId = selectedDepartmentId; SaveButton.Visible = false; DeleteButton.Visible = false; AgeLabel.Visible = false; AgeValueLabel.Visible = false; }
public Main() { InitializeComponent(); Db = new TestDBEntities(); var departmentList = Db.Department.Where(l => l.ParentDepartmentID == null).ToList(); foreach (var department in departmentList) { DepartmentTreeView.Nodes.Add(FillViewTree(department)); } DepartmentTreeView.ExpandAll(); DepartmentTreeView.NodeMouseDoubleClick += DepartmentTreeView_NodeMouseDoubleClick; DepartmentTreeView.AfterSelect += DepartmentTreeView_AfterSelect; }
public EmployeeSetup(Guid selectedDepartmentId, decimal id) { InitializeComponent(); _db = Main.Db; _selectedDepartmentId = selectedDepartmentId; AddButton.Visible = false; _selectedEmployee = _db.Empoyee.First(l => l.ID == id); empoyeeBindingSource.DataSource = _selectedEmployee; var age = (DateTime.Today.Year - _selectedEmployee.DateOfBirth.Year); if (_selectedEmployee.DateOfBirth.AddYears(age) > DateTime.Today) { age--; } AgeValueLabel.Text = "" + age; }