Example #1
0
 public MTTestModel(DateTime dtDate, bool bWasCorrect, TestType enType)
 {
     _enType      = enType;
     _dtDate      = dtDate;
     _bWasCorrect = bWasCorrect;
     _objPatch    = null;
 }
Example #2
0
 public MTApplyMgrModel(MTPatchModel objPatch)
 {
     _objPatch        = objPatch;
     _lstApplycations = new ObservableCollection <string>();
 }
Example #3
0
            int IComparer.Compare(object first, object second)
            {
                if (first == null & second == null)
                {
                    return(0);
                }

                else if (first == null)
                {
                    return(-1);
                }

                else if (second == null)
                {
                    return(1);
                }
                else
                {
                    MTPatchModel objFirst  = first as MTPatchModel;
                    MTPatchModel objSecond = second as MTPatchModel;
                    //Check if Test is Enabled
                    if (!objFirst.TestIsEnabled && objSecond.TestIsEnabled)
                    {
                        return(1);
                    }
                    else if (objFirst.TestIsEnabled && !objSecond.TestIsEnabled)
                    {
                        return(-1);
                    }

                    switch (MTControler.Settings.EnSortOrder)
                    {
                    case SortOrder.PositionBrain:
                        if ((objFirst.PositionBrain) == (objSecond.PositionBrain))
                        {
                            return(objFirst.LastDateTest.CompareTo(objSecond.LastDateTest));
                        }
                        else if ((objFirst.PositionBrain) < (objSecond.PositionBrain))
                        {
                            return(1);
                        }
                        break;

                    case SortOrder.Applycations:
                        if ((objFirst.MgrApply.LstApply.Count) == (objSecond.MgrApply.LstApply.Count))
                        {
                            return(objFirst.PositionAdrees.CompareTo(objSecond.PositionAdrees));
                        }
                        else if ((objFirst.MgrApply.LstApply.Count) < (objSecond.MgrApply.LstApply.Count))
                        {
                            return(1);
                        }
                        break;

                    case  SortOrder.Date:
                        if ((objFirst.LastDateTest) == (objSecond.LastDateTest))
                        {
                            return(objFirst.ShortAdrees.CompareTo(objSecond.ShortAdrees));
                        }
                        else if ((objFirst.LastDateTest) > (objSecond.LastDateTest))
                        {
                            return(1);
                        }
                        break;

                    case  SortOrder.Text:
                        if ((objFirst.PositionAdrees) == (objSecond.PositionAdrees))
                        {
                            return(objFirst.ShortAdrees.CompareTo(objSecond.ShortAdrees));
                        }
                        else if ((objFirst.PositionAdrees) > (objSecond.PositionAdrees))
                        {
                            return(1);
                        }
                        break;

                    case SortOrder.Progress:
                        if ((objFirst.Score) == (objSecond.Score))
                        {
                            return(objFirst.LastDateTest.CompareTo(objSecond.LastDateTest));
                        }
                        else if ((objFirst.Score) > (objSecond.Score))
                        {
                            return(1);
                        }
                        break;

                    case SortOrder.TestTotal:
                        if ((objFirst.lstTest.Count) == (objSecond.lstTest.Count))
                        {
                            return(objFirst.LastDateTest.CompareTo(objSecond.LastDateTest));
                        }
                        else if ((objFirst.lstTest.Count) > (objSecond.lstTest.Count))
                        {
                            return(1);
                        }
                        break;

                    case SortOrder.TestCorrects:
                        if ((objFirst.AnsuersCorrects) == (objSecond.AnsuersCorrects))
                        {
                            return(objFirst.LastDateTest.CompareTo(objSecond.LastDateTest));
                        }
                        else if ((objFirst.AnsuersCorrects) > (objSecond.AnsuersCorrects))
                        {
                            return(1);
                        }
                        break;

                    case SortOrder.TestWrongs:
                        if ((objFirst.AnsuersWrongs) == (objSecond.AnsuersWrongs))
                        {
                            return(objFirst.LastDateTest.CompareTo(objSecond.LastDateTest));
                        }
                        else if ((objFirst.AnsuersWrongs) < (objSecond.AnsuersWrongs))
                        {
                            return(1);
                        }
                        break;

                    case SortOrder.TestWrongPercents:
                        if ((objFirst.PercentsWrongs) == (objSecond.PercentsWrongs))
                        {
                            return(objFirst.LastDateTest.CompareTo(objSecond.LastDateTest));
                        }
                        else if ((objFirst.PercentsWrongs) < (objSecond.PercentsWrongs))
                        {
                            return(1);
                        }
                        break;

                    case SortOrder.Created:
                        if ((objFirst.Created) == (objSecond.Created))
                        {
                            return(objFirst.PositionAdrees.CompareTo(objSecond.PositionAdrees));
                        }
                        else if ((objFirst.Created) < (objSecond.Created))
                        {
                            return(1);
                        }
                        break;
                    }
                    return(-1);
                }
            }
Example #4
0
 public void AddPatch(MTPatchModel objPatch)
 {
     _lstPatch.Add(objPatch);
     MTClassificator.UpdatePatch(objPatch);
 }
Example #5
0
 public MTTestModel(MTPatchModel objPatch)
 {
     _enType   = TestType.None;
     _dtDate   = DateTime.Now;
     _objPatch = objPatch;
 }
Example #6
0
 public MTTestAskTextModel(MTPatchModel objPatch)
     : base(objPatch)
 {
     _enType = TestType.AskText;
 }
Example #7
0
 public MTTestAskAdreesModel(MTPatchModel objPatch)
     : base(objPatch)
 {
     _enType = TestType.AskAdrees;
 }