private void btnCreateAdmin_Click(object sender, EventArgs e) { if (InputServices.TextBoxError(txtbxUsername, errorProvider1) && InputServices.TextBoxError(txtbxPassword, errorProvider1) && InputServices.TextBoxError(txtbxName, errorProvider1) && InputServices.TextBoxError(txtbxLastname, errorProvider1)) { accountService.CreateAdmin(txtbxUsername.Text, txtbxPassword.Text, txtbxName.Text, txtbxLastname.Text, pckrDateOfBirth.Value, GenderChoice()); CloseDialog(); } }
private void btnCreate_Click(object sender, EventArgs e) { if (InputServices.TextBoxError(txtbxName, errorProvider1) && InputServices.DateTimePickersError(pckrStart, pckrEnd, errorProvider1) && InputServices.TextBoxIntError(txtbxCost, errorProvider1) && InputServices.RichTextBoxError(rtxtbxDescription, errorProvider1)) { projectService.AddNewProject(txtbxName.Text, int.Parse(txtbxCost.Text), rtxtbxDescription.Text, pckrStart.Value, pckrEnd.Value); CloseDialog(); } }
private void editAccount_btn_Click(object sender, EventArgs e) { if (InputServices.TextBoxError(name_txtbx, errorProvider1) && InputServices.TextBoxError(lastName_txtbx, errorProvider1) && InputServices.ComboBoxError(cmbbxDepartment, errorProvider1)) { ChangeSelectedUser(SelectedUser); CloseDialog(); } }
private void createAccount_btn_Click(object sender, EventArgs e) { if (InputServices.TextBoxError(username_txtbx, errorProvider1) && InputServices.TextBoxError(password_txtbx, errorProvider1) && InputServices.TextBoxError(name_txtbx, errorProvider1) && InputServices.TextBoxError(lastName_txtbx, errorProvider1) && InputServices.ComboBoxError(department_combobx, errorProvider1)) { Department department = department_combobx.SelectedItem as Department; accountService.AddNewUser(username_txtbx.Text, password_txtbx.Text, name_txtbx.Text, lastName_txtbx.Text, dayOfBirth_pckr.Value, GenderChoice(), department); Hide(); var mainForm = new MainForm(); mainForm.ShowDialog(); Close(); } }
private void btnEdit_Click(object sender, EventArgs e) { if (InputServices.TextBoxError(txtbxName, errorProvider1) && InputServices.TextBoxIntError(txtbxCost, errorProvider1) && InputServices.RichTextBoxError(rtxtbxDescription, errorProvider1)) { projectService.EditProject(SelectedProject.Id, txtbxName.Text, int.Parse(txtbxCost.Text), rtxtbxDescription.Text, ProjectStateChoice()); if (ProjectStateChoice() == ProjectState.Canceled) { taskService.UpdateTasksWhenProjectIsCanceled(SelectedProject.Id); } CloseDialog(); } }