Example #1
0
 public AddDepartmentForm(Guid perentDepartmentId)
 {
     InitializeComponent();
     _db = Main.Db;
     ParentNameLabel.Text = _db.Department.First(l => l.ID == perentDepartmentId).Name;
     _perentDepartmentId  = perentDepartmentId;
 }
Example #2
0
 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;
 }
Example #3
0
 public EmployeeSetup(Guid selectedDepartmentId)
 {
     InitializeComponent();
     _db = Main.Db;
     _selectedDepartmentId = selectedDepartmentId;
     SaveButton.Visible    = false;
     DeleteButton.Visible  = false;
     AgeLabel.Visible      = false;
     AgeValueLabel.Visible = false;
 }
Example #4
0
        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;
        }
Example #5
0
        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;
        }