private void Details_Click(object sender, EventArgs e) { var oibRegex = new Regex(@"\d{11}"); foreach (var item in checkedListBoxOverview.CheckedItems) { var itemOib = oibRegex.Match(item.ToString()).Value; var detailsEmp = new Details(DataBaseEmployees.GetEmployee(itemOib)); detailsEmp.ShowDialog(); } }
private void Edit_Click(object sender, EventArgs e) { var oibRegex = new Regex(@"\d{11}"); foreach (var emp in checkedListBoxOverview.CheckedItems) { var empOib = oibRegex.Match(emp.ToString()).Value; var overViewEmp = new EditEmployeeForm(DataBaseEmployees.GetEmployee(empOib)); overViewEmp.ShowDialog(); } RefreshListbox(); }
public void DeleteEmployeeButton_Click(object sender, EventArgs e) { var oibRegex = new Regex(@"\d{11}"); foreach (var item in EmpListBox.CheckedItems) { DataBaseEmployees.ListEmployees.Remove( DataBaseEmployees.GetEmployee(oibRegex.Match(item.ToString()).Value)); //break; } Refresh(); }
private void DetailsProject_Load(object sender, EventArgs e) { //Functions projectNameTextbox.Text = ToViewProject.Name; projectDatetextbox.Text = ToViewProject.StartTime + "-" + ToViewProject.EndTime; ProgrammerComboBox.Text = Position.Programmer.ToString(); accoutantComboBox.Text = Position.Accountant.ToString(); designerComboBox.Text = Position.Designer.ToString(); marketingComboBox.Text = Position.Marketing.ToString(); SecretarComboBox.Text = Position.Secretary.ToString(); foreach (var relation in DataBaseRelations.GetRelationByName(ToViewProject.Name)) { var emp = DataBaseEmployees.GetEmployee(relation.Oib); if (emp.Position == Position.Programmer) { ProgrammerComboBox.Items.Add(emp.FirstName + " " + emp.LastName + " " + DataBaseRelations.GetHoursFromRelation(ToViewProject.Name, emp.Oib)); } else if (emp.Position == Position.Accountant) { accoutantComboBox.Items.Add(emp.FirstName + " " + emp.LastName + " " + DataBaseRelations.GetHoursFromRelation(ToViewProject.Name, emp.Oib)); } else if (emp.Position == Position.Designer) { designerComboBox.Items.Add(emp.FirstName + " " + emp.LastName + " " + DataBaseRelations.GetHoursFromRelation(ToViewProject.Name, emp.Oib)); } else if (emp.Position == Position.Marketing) { marketingComboBox.Items.Add(emp.FirstName + " " + emp.LastName + " " + DataBaseRelations.GetHoursFromRelation(ToViewProject.Name, emp.Oib)); } else if (emp.Position == Position.Secretary) { SecretarComboBox.Items.Add(emp.FirstName + " " + emp.LastName + " " + DataBaseRelations.GetHoursFromRelation(ToViewProject.Name, emp.Oib)); } } /*foreach (var jobs in Enum.GetValues(typeof(Position))) * { * JobComboBox.Items.Add(jobs); * }*/ }