Beispiel #1
0
 private void SeedEvaluations()
 {
     Evaluations.Add(new EvaluationEntity
     {
         Id                = EvaluationGuids[0],
         TextEvaluation    = "Good",
         PercentEvaluation = 80,
         ProductId         = ProductGuids[0]
     });
     Evaluations.Add(new EvaluationEntity
     {
         Id                = EvaluationGuids[1],
         TextEvaluation    = "Not bad",
         PercentEvaluation = 60,
         ProductId         = ProductGuids[1]
     });
     Evaluations.Add(new EvaluationEntity
     {
         Id                = EvaluationGuids[2],
         TextEvaluation    = "Little bit expensive",
         PercentEvaluation = 50,
         ProductId         = ProductGuids[1]
     });
     Evaluations.Add(new EvaluationEntity
     {
         Id                = EvaluationGuids[3],
         TextEvaluation    = "Broke after one month",
         PercentEvaluation = 0,
         ProductId         = ProductGuids[2]
     });
 }
Beispiel #2
0
 /// <summary>
 /// Rozpoczęcie nowej ewaluacji
 /// </summary>
 public void CreateNewEvaluation()
 {
     EvaluationsAmount++;
     CurrentEvaluation = new Graph(this);
     Evaluations.Add(CurrentEvaluation);
     IsEvaluationInProgress = true;
 }
Beispiel #3
0
        void FilterItems(string filter)
        {
            var filteredItems = source.Where(Patient => Patient.Evaluation.ToLower().Contains(filter.ToLower())).ToList();

            foreach (var Patient in source)
            {
                if (!filteredItems.Contains(Patient))
                {
                    Evaluations.Remove(Patient);
                }
                else
                {
                    if (!Evaluations.Contains(Patient))
                    {
                        Evaluations.Add(Patient);
                    }
                }
            }
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="evaluation"></param>
        /// <returns></returns>
        public async Task <bool> CreateAsync(Evaluation evaluation)
        {
            if (evaluation == null)
            {
                throw new ArgumentNullException(nameof(evaluation));
            }

            Evaluations.Add(evaluation);
            try
            {
                await SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                return(false);
            }

            return(true);
        }
Beispiel #5
0
 public void AddEvaluation(Evaluation e)
 {
     Evaluations.Add(e);
 }