private void btnEdit_Click(object sender, EventArgs e) { if (InputServices.TextBoxIntError(txtBxEstimatedTime, errorProvider1) && InputServices.TextBoxIntError(txtBxRemainingTime, errorProvider1) && InputServices.RichTextBoxError(rchTxtBxComment, errorProvider1)) { taskService.EditTask(SelectedTask.Id, int.Parse(txtBxEstimatedTime.Text), int.Parse(txtBxRemainingTime.Text), TaskStateChoice(), rchTxtBxComment.Text); if (TaskStateChoice() == TaskState.Done) { taskService.UpdateTaskWhenStateChangedToDone(SelectedTask.Id); } CloseDialog(); } }
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(); } }
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(); } }