Esempio n. 1
0
 public RoomRegistryForm(AdminWindowData d)
 {
     data           = d;
     departmentList = data.DepartmentList;
     InitializeComponent();
     departmentComboBox.DataSource    = departmentList;
     departmentComboBox.DisplayMember = Name;
 }
        public DepartmentRegistryForm(AdminWindowData d)
        {
            data     = d;
            editMode = false;

            InitializeComponent();

            //Sets TimePickers to default values.
            depOpenTimePicker.Value  = DateTimePicker.MinimumDateTime + new TimeSpan(8, 0, 0);
            depCloseTimePicker.Value = DateTimePicker.MinimumDateTime + new TimeSpan(16, 0, 0);
        }
 public EmployeeRegistryForm(AdminWindowData d)
 {
     data = d;
     InitializeComponent();
     departmentComboBox.DataSource    = data.DepartmentList;//.OrderBy(o => o.Name).ToList();
     departmentComboBox.SelectedIndex = -1;
     positionComboBox.SelectedIndex   = -1;
     specialtyComboBox.DataSource     = new BindingSource(data.SpecialtyDictionary, null);
     specialtyComboBox.DisplayMember  = "Key";
     specialtyComboBox.ValueMember    = "Value";
     specialtyComboBox.SelectedIndex  = -1;
     editMode = false;
 }
 public EmployeeRegistryForm(AdminWindowData d, Employee emp)
 {
     data           = d;
     employeeToEdit = emp;
     this.Text      = "Redigera Anställd";
     InitializeComponent();
     departmentComboBox.DataSource = data.DepartmentList;//.OrderBy(o => o.Name).ToList();
     //departmentComboBox.SelectedIndex = -1;
     //positionComboBox.SelectedIndex = -1;
     specialtyComboBox.DataSource    = new BindingSource(data.SpecialtyDictionary, null);
     specialtyComboBox.DisplayMember = "Key";
     specialtyComboBox.ValueMember   = "Value";
     FillFieldsWithEmployee();
     employeeIdTxtBox.Enabled     = false;
     saveMoreEmployeesBtn.Visible = false;
     saveOneAndCloseBtn.Text      = "Uppdatera och Stäng";
     editMode = true;
 }
Esempio n. 5
0
 public RoomRegistryForm(AdminWindowData d, Room r)
 {
     data           = d;
     roomToEdit     = r;
     departmentList = data.DepartmentList;
     editMode       = true;
     InitializeComponent();
     departmentComboBox.DataSource    = departmentList;
     departmentComboBox.DisplayMember = Name;
     departmentComboBox.Text          = db.LoadDepartmentByID(roomToEdit.DepartmentID).Name;
     roomIdTxtBox.Text        = roomToEdit.RoomID;
     roomFunctionTxtBox.Text  = roomToEdit.RoomFunction;
     roomCapUpDown.Value      = roomToEdit.RoomCapacity;
     roomMaxUpDown.Value      = roomToEdit.RoomMaxCapacity;
     roomIdTxtBox.Enabled     = false;
     saveMoreRoomsBtn.Visible = false;
     saveOneAndCloseBtn.Text  = "Uppdatera och Stäng";
 }
        public DepartmentRegistryForm(AdminWindowData d, Department department)
        {
            data             = d;
            editMode         = true;
            departmentToEdit = department;

            InitializeComponent();

            //Customizes GUI to editmode
            depIDTxtBox.Enabled            = false;
            saveMoreDepartmentsBtn.Visible = false;
            saveOneAndCloseBtn.Text        = "Uppdatera och Stäng";

            //Loads the values of the passed Department to the controls.
            depIDTxtBox.Text         = departmentToEdit.DepartmentID;
            depIDTxtBox.Enabled      = false;
            depNameTxtBox.Text       = departmentToEdit.Name;
            depOpenTimePicker.Value  = DateTimePicker.MinimumDateTime + departmentToEdit.Opens;
            depCloseTimePicker.Value = DateTimePicker.MinimumDateTime + departmentToEdit.Closes;
        }
        public AdminWindowForm(Employee myUser)
        {
            data = new AdminWindowData(myUser);
            InitializeComponent();
            this.currentUserLbl.Text = $"Inloggad som: {data.MyUser.ToString()}";

            //Initializing the content of the Employee Tab
            this.employeesDataGridView.DataSource = GetSortedEmployeeDataGridList(data.EmployeeList, "EmployeeID");

            //Following line does not work for some reason. Check again if I have extra time.
            //this.employeesDataGridView.Columns[(this.employeesDataGridView.Columns["EmployeeID"].Index)].HeaderCell.SortGlyphDirection = SortOrder.Descending;

            //Initializing the content of the Department Tab
            this.departmentsDataGridView.DataSource = GetSortedDepartmentDataGridList(data.DepartmentList, "DepartmentID");

            //Initializing the content of the Room Tab
            this.roomDepartmentComboBox.DataSource    = data.DepartmentList;
            this.roomDepartmentComboBox.DisplayMember = Name;
            this.roomDepartmentComboBox.Text          = "Akutmottagning";
            this.roomDepartmentComboBox.SelectedIndex = 0;
            this.roomsDataGridView.DataSource         = GetSortedRoomDataGridList(data.RoomList, "RoomID");
        }