예제 #1
0
        public IMainFilterEntity GetBreakdown(string x, bool b)
        {
            IMainFilterEntity mf = new MainFilterEntity();

            char[]   c = { ' ', '|' };
            string[] s = x.Split(c);
            using (MarsDBDataContext db = new MarsDBDataContext())
            {
                var countryMatch      = db.COUNTRies.Where(p => p.country1 == s[0].Substring(0, 2));
                var firstCountryMatch = countryMatch.FirstOrDefault();
                if (firstCountryMatch == null)
                {
                    throw new NullReferenceException();
                }
                mf.Country = firstCountryMatch.country_description;
                mf.Branch  = s[0];
                if (b)
                {
                    mf.PoolRegion      = db.LOCATIONs.Where(p => p.location1 == s[0]).FirstOrDefault().CMS_LOCATION_GROUP.CMS_POOL.cms_pool1;
                    mf.LocationGrpArea = db.LOCATIONs.Where(p => p.location1 == s[0]).FirstOrDefault().CMS_LOCATION_GROUP.cms_location_group1;
                }
                else
                {
                    mf.PoolRegion      = db.LOCATIONs.Where(p => p.location1 == s[0]).FirstOrDefault().OPS_AREA.OPS_REGION.ops_region1;
                    mf.LocationGrpArea = db.LOCATIONs.Where(p => p.location1 == s[0]).FirstOrDefault().OPS_AREA.ops_area1;
                }
                mf.CarSegment = db.CAR_GROUPs.Where(p => p.car_group1 == s[1] && p.CAR_CLASS.CAR_SEGMENT.country == s[0].Substring(0, 2)).FirstOrDefault().CAR_CLASS.CAR_SEGMENT.car_segment1;
                mf.CarClass   = db.CAR_GROUPs.Where(p => p.car_group1 == s[1] && p.CAR_CLASS.CAR_SEGMENT.country == s[0].Substring(0, 2)).FirstOrDefault().CAR_CLASS.car_class1;
                mf.CarGroup   = s[1];
            }
            return(mf);
        }
        private MainFilterEntity GetMainFilterExample()
        {
            var mfe = new MainFilterEntity {
                Country = "Germany", PoolRegion = "Ost", CmsLogic = true, LocationGrpArea = "LEIPZIG"
            };

            return(mfe);
        }
        private MainFilterEntity GetMainFilterExample()
        {
            var mfe = new MainFilterEntity {
                Country = "Germany", CmsLogic = true, CarSegment = "Car"
            };

            return(mfe);
        }
        private MainFilterEntity GetMainFilterExample()
        {
            var mfe = new MainFilterEntity {
                Country  = "Germany", PoolRegion = "West", LocationGrpArea = "KOELN DT", CarSegment = "Car",
                CarClass = "Compact", CmsLogic = true
            };

            return(mfe);
        }
예제 #5
0
 public AlertsHtmlTable(HtmlTableRepository <AlertEntity> r)
 {
     if (r == null)
     {
         throw new ArgumentNullException("The repository can't be null.");
     }
     Filter      = new MainFilterEntity();
     _repository = r;
 }
예제 #6
0
 public CompHtmlTable(IComparisonRepository r)
 {
     if (r == null)
     {
         throw new ArgumentNullException("The IComparisonRepository can't be null");
     }
     Filter      = new MainFilterEntity();
     _repository = r;
 }
예제 #7
0
        public void TestMethod2()
        {
            var mfe = new MainFilterEntity
            {
                Country    = "United Kingdom",
                PoolRegion = "South England"
                ,
                CmsLogic        = true,
                LocationGrpArea = "HEATHROW"
                ,
                CarSegment = "Car",
                CarClass   = @"CompactMan",
                CarGroup   = "C"
            };


            //var ss = AlertsDataAccess.GetLocationCarGroupsWithNegativeBalance(mfe, DateTime.Now.AddDays(2).Date);

            var alertClasses = AlertsDataAccess.GetLocationCarGroups(mfe, DateTime.Now.AddDays(1).Date);
            //var dd = alertClasses.Where(d => d.Label.Substring(0,7) == "GEAAC60").ToList();

            var actualsClasses = ReservationsDataAccess.CalculateTopics(true, 20, mfe, false, false);

            foreach (var ac in alertClasses)
            {
                var time = ac.Tme;
                var data = actualsClasses.FirstOrDefault(d => d.Tme == time);
                //var labelBits = ac.Label.Split(' ');
                if (data != null)
                {
                    Assert.IsTrue(ac.Balance == data.Balance);
                }

                //var branch = labelBits[0];
                // var carGroup = labelBits[1];
                //var balance = ac.Balance;
            }


            Assert.IsTrue(true);
        }
예제 #8
0
        private MainFilterEntity GetMainFilterExample()
        {
            var mfe = new MainFilterEntity();

            return(mfe);
        }