Пример #1
0
        public void UpdateProject(Project project)
        {
            Project selectedProject
 = Projects.Where(p => p.ID == project.ID)
                      .FirstOrDefault() as Project;
            selectedProject.Name = project.Name;
            selectedProject.Estimate = project.Estimate;
            selectedProject.Actual = project.Actual;
            RaiseProjectUpdated(selectedProject);
        }
 //Нажатие кнопки обновления модели
 private void UpdateButton_Click(object sender, RoutedEventArgs e)
 {
     Project project = new Project()
     {
         ID = (int)ProjectsComboBox.SelectedValue,
         Name = ProjectsComboBox.Text,
         Estimate = GetDouble(EstimatedTextBox.Text),
         Actual = GetDouble(ActualTextBox.Text)
     };
     _controller.Update(project);
 }
 public void Update(Project project)
 {
     _model.UpdateProject(project);
 }
Пример #4
0
 private void SetEstimateColor(Project selectedProject)
 {
     if (selectedProject.Actual == 0)
     {
         _estimateTextBox.Foreground = Brushes.Black;
     }
     else if (selectedProject.Actual
         <= selectedProject.Estimate)
     {
         _estimateTextBox.Foreground = Brushes.Green;
     }
     else
     {
         _estimateTextBox.Foreground = Brushes.Red;
     }
 }
Пример #5
0
 public ProjectEventArgs(Project project)
 {
     Project = project;
 }
Пример #6
0
 private void RaiseProjectUpdated(Project project)
 {
     ProjectUpdated(this,
         new ProjectEventArgs(project));
 }
 private void UpdateDetails(Project project)
 {
     EstimatedTextBox.Text
             = project.Estimate.ToString();
     ActualTextBox.Text
             = project.Actual.ToString();
     UpdateEstimatedColor();
 }