public void CreateSuccessRateReport(INinjaCatalogueModelUnitOfWork db, string filePath)
 {
     IEnumerable<NinjaReport> successRateReport;
     var specialties = this.LoadSQliteData();
     successRateReport = this.SelectSuccessRateList(db, specialties);
     this.WriteToFile(successRateReport, filePath); 
 }
Ejemplo n.º 2
0
        public void CreateSuccessRateReport(INinjaCatalogueModelUnitOfWork db, string filePath)
        {
            IEnumerable <NinjaReport> successRateReport;
            var specialties = this.LoadSQliteData();

            successRateReport = this.SelectSuccessRateList(db, specialties);
            this.WriteToFile(successRateReport, filePath);
        }
 private IEnumerable<NinjaReport> SelectSuccessRateList(INinjaCatalogueModelUnitOfWork db, IDictionary<string, string> specialties)
 {
     var ninjas = db.Ninja_catalogue_items
         .OrderBy(item => item.SuccessRate)
         .Select(item => new NinjaReport()
                {
                    Id = item.Id,
                    Name = item.Name,
                    Weapon = item.Weapon,
                    SpecialtyWeight = int.Parse(specialties[item.Speciality]),
                    Speciality = item.Speciality,
                    SuccessfulJobsCount = item.SuccessfulJobsCount,
                    KillCount = item.KillCount,
                    SuccessRate = item.SuccessRate
                }).ToList<NinjaReport>();
     return ninjas.OrderByDescending(ninja => ninja.SpecialtyWeight);
 }
Ejemplo n.º 4
0
        private IEnumerable <NinjaReport> SelectSuccessRateList(INinjaCatalogueModelUnitOfWork db, IDictionary <string, string> specialties)
        {
            var ninjas = db.Ninja_catalogue_items
                         .OrderBy(item => item.SuccessRate)
                         .Select(item => new NinjaReport()
            {
                Id                  = item.Id,
                Name                = item.Name,
                Weapon              = item.Weapon,
                SpecialtyWeight     = int.Parse(specialties[item.Speciality]),
                Speciality          = item.Speciality,
                SuccessfulJobsCount = item.SuccessfulJobsCount,
                KillCount           = item.KillCount,
                SuccessRate         = item.SuccessRate
            }).ToList <NinjaReport>();

            return(ninjas.OrderByDescending(ninja => ninja.SpecialtyWeight));
        }