private void BtnEdit_Click(object sender, EventArgs e) { if (tbxName.Text == "Name" || tbxName.Text == "") { MessageBox.Show("Please, input name"); return; } if (rtbDescription.Text == "Description" || rtbDescription.Text == "") { MessageBox.Show("Please, input description"); return; } if (MessageBox.Show("Do you really want to edit this department?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { string name = tbxName.Text; string description = rtbDescription.Text; int neededpeople = Convert.ToInt32(numPeople.Value); foreach (Department dep in Department.GetAllDepartments()) { if (dep.DepartmentId == depId) { dep.EditDepartment(name, description, neededpeople); } } this.Close(); previousForm.UpdateGUI(); } }
public HiringRequest(string username, string firstName, string lastName, decimal hourlyWage, int departmentId, DateTime contractStartDate, long phoneNumber, string email) { InitializeComponent(); this.FormBorderStyle = FormBorderStyle.FixedSingle; this.Enabled = false; tbUsername.Text = username; tbFirstName.Text = firstName; tbLastName.Text = lastName; nHourlyWage.Value = hourlyWage; dtbContractStartDate.Value = contractStartDate; tbPhoneNumber.Text = phoneNumber.ToString(); tbEmail.Text = email; List <Department> departments = Department.GetAllDepartments(); foreach (Department d in departments) { if (d.DepartmentId == departmentId) { cmbDepartment.Text = d.Name; } } ; }
public void UpdateGUI() { departments = null; controls.Clear(); reportControls.Clear(); flpReports.Controls.Clear(); flpDepartments.Controls.Clear(); departments = Department.GetAllDepartments(); reports = Report.GetAllReports(); foreach (Department d in departments) { controls.Add(new DepartmentUserControl(d.DepartmentId, d.Name, d.Description, d.NeededPeople, this)); } foreach (DepartmentUserControl department in controls) { flpDepartments.Controls.Add(department); } foreach (Report r in reports) { if (r.ReportStatus == "unread") { reportControls.Add(new ReportControl(r.ReportId, r.ReportSubject, r.ReportMessage, r.ReportStatus, this)); } } foreach (ReportControl report in reportControls) { flpReports.Controls.Add(report); } }
public FiringRequest(int user_id, int workerRole) { InitializeComponent(); this.FormBorderStyle = FormBorderStyle.FixedSingle; tbxFirstName.Enabled = false; tbxLastName.Enabled = false; cmbEmployees.Enabled = false; cmbManagers.Enabled = false; PopulateDepartments(Department.GetAllDepartments()); PopulateManagers(Manager.GetAllManagers()); PopulateEmployees(Employee.GetAllEmployees()); this.loggedUserId = user_id; this.workerRole = workerRole; rtbReason.MaxLength = 400; if (workerRole == (int)ProfileRoles.ADMINISTRATOR) { btnSendFiringRequest.Visible = false; this.Text = "Remove manager!"; cmbEmployees.Visible = false; } else if (workerRole == (int)ProfileRoles.MANAGER) { btnRemoveManager.Visible = false; cmbManagers.Visible = false; } }
public PromotionRequest(int user_id) { InitializeComponent(); this.loggedUserId = user_id; this.FormBorderStyle = FormBorderStyle.FixedSingle; PopulateDepartments(Department.GetAllDepartments()); PopulateEmployees(Employee.GetAllEmployees()); }
public ViewWorkersWorkingToday() { InitializeComponent(); controls = new List <CurrentWorkingWorkerControl>(); PopulateDepartments(Department.GetAllDepartments()); cmbShifts.Items.Add("morning"); cmbShifts.Items.Add("afternoon"); cmbShifts.Items.Add("evening"); }
public StockView(int workerRole) { InitializeComponent(); PopulateDepartments(Department.GetAllDepartments()); populateStocks(Stock.GetAllStocks()); if (workerRole == (int)ProfileRoles.EMPLOYEE) { this.Width = 580; } }
private void deleteDepartmentBttn_Click(object sender, EventArgs e) { foreach (Department dep in Department.GetAllDepartments()) { if (dep.DepartmentId == depId) { dep.RemoveDepartment(); } } form.UpdateGUI(); }
public AddStock() { InitializeComponent(); this.StartPosition = FormStartPosition.CenterScreen; departmentsCmbbxAddingStock.Items.Clear(); List <Department> departments = Department.GetAllDepartments(); foreach (Department d in departments) { departmentsCmbbxAddingStock.Items.Add(new DepartmentComboBoxItem(d)); } }
private void deleteDepartmentBttn_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you really want to remove this department?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { foreach (Department dep in Department.GetAllDepartments()) { if (dep.DepartmentId == depId) { dep.RemoveDepartment(); } } form.UpdateGUI(); } }
private void BtnEdit_Click(object sender, EventArgs e) { string name = tbxName.Text; string description = rtbDescription.Text; int neededpeople = Convert.ToInt32(numPeople.Value); foreach (Department dep in Department.GetAllDepartments()) { if (dep.DepartmentId == depId) { dep.EditDepartment(name, description, neededpeople); } } this.Close(); previousForm.UpdateGUI(); }
public void UpdateGUI() { departments = null; controls.Clear(); flpDepartments.Controls.Clear(); departments = Department.GetAllDepartments(); foreach (Department d in departments) { controls.Add(new DepartmentUserControl(d.DepartmentId, d.Name, d.Description, d.NeededPeople, this)); } foreach (DepartmentUserControl department in controls) { flpDepartments.Controls.Add(department); } }
public PromotionRequest(bool flag,int departmentId,string firstName,string lastName,decimal hourlyWage,decimal previousHourlyWage) { InitializeComponent(); this.FormBorderStyle = FormBorderStyle.FixedSingle; numericHourlywage.Value = hourlyWage; cmbEmployee.Text = firstName + " " + lastName; lblCurrentWage.Text = previousHourlyWage.ToString() + "$/Hourly"; if (flag) { this.Enabled = false; this.FormBorderStyle = FormBorderStyle.FixedSingle; List<Department> departments = Department.GetAllDepartments(); foreach (Department d in departments) { if (d.DepartmentId == departmentId) cmbDepartment.Text = d.Name; } } }
public CreateAccount(int user_id, int workerRole) { InitializeComponent(); this.FormBorderStyle = FormBorderStyle.FixedSingle; pc = new PeopleController(); PopulateDepartments(Department.GetAllDepartments()); this.loggedInUser = user_id; //dtbContractStartDate.MinDate = System.DateTime.Now; //dtbContractStartDate.Value = System.DateTime.Now; //dtpBirthdate.Value = System.DateTime.Now; //dtpBirthdate.MaxDate = System.DateTime.Now; contactCounter = 0; if (!addContact) { btnAddOtherContact.Enabled = false; btnOpenContact.Enabled = false; btnDeleteContact.Enabled = false; } this.workerRole = workerRole; if (workerRole == (int)ProfileRoles.ADMINISTRATOR) { btnEdit.Visible = true; btnSendRequest.Visible = false; rbEmployee.Visible = false; rbEmployee.Checked = false; } else if (workerRole == (int)ProfileRoles.MANAGER) { btnEdit.Visible = false; btnCreateAccount.Visible = false; rbAdmin.Visible = false; rbManager.Visible = false; rbEmployee.Checked = true; rbEmployee.Visible = true; rbEmployee.Enabled = false; this.Text = "Hiring Request"; } if (tbUsername.Text == "" || tbUsername.Text == "Username") { btnAssignShifts.Enabled = false; } }
public FiringRequest(bool flag, int departmentId, string username, string firstName, string lastName, string description) { InitializeComponent(); this.FormBorderStyle = FormBorderStyle.FixedSingle; if (flag) { this.Enabled = false; tbxFirstName.Text = firstName; tbxLastName.Text = lastName; rtbReason.Text = description; List <Department> departments = Department.GetAllDepartments(); foreach (Department d in departments) { if (d.DepartmentId == departmentId) { cmbDepartment.Text = d.Name; } } } }
private void LoadDepartments() { PopulateDepartments(Department.GetAllDepartments(), departmentsCmbbxAddingStock); PopulateDepartments(Department.GetAllDepartments(), departmentAvailableCmbbx); }
public SearchForEmployee() { InitializeComponent(); PopulateDepartments(Department.GetAllDepartments()); }