public CountDataModel GetCountData()
        {
            var data = new CountDataModel();

            using (var db = _dbContext.GetIntance())
            {
                data.Count1  = db.Queryable <HiddenDangersReportEntity>().Where(it => it.HiddenDangersLevel == "1" && it.DeleteMark == 1).ToList().Count;
                data.Count11 = db.Queryable <HiddenDangersReportEntity>().Where(it => it.HiddenDangersLevel == "1" && it.DeleteMark == 1 && it.States == "3").ToList().Count;
                data.Count2  = db.Queryable <HiddenDangersReportEntity>().Where(it => it.HiddenDangersLevel == "2" && it.DeleteMark == 1).ToList().Count;
                data.Count22 = db.Queryable <HiddenDangersReportEntity>().Where(it => it.HiddenDangersLevel == "2" && it.DeleteMark == 1 && it.States == "3").ToList().Count;
                data.Count3  = db.Queryable <HiddenDangersNoticeEntity>().Where(it => it.States == "2").ToList().Count;
                data.Count4  = db.Queryable <HiddenDangersNoticeEntity>().Where(it => it.States == "1" && it.DeleteMark == 1).ToList().Count;
            }
            return(data);
        }
Beispiel #2
0
        public List <CountDataModel> GetPositivPat(List <CountDataModel> allPositivPat)
        {
            List <CountDataModel> positivPat = new List <CountDataModel>();

            foreach (CountDataModel countData in allPositivPat)
            {
                if (!positivPat.Contains(countData))
                {
                    positivPat.Add(countData);
                }
                else
                {
                    CountDataModel data = positivPat.Find(i => i.PatientID == countData.PatientID);

                    if (data.Zeitpunkt_des_Probeneingangs > countData.Zeitpunkt_des_Probeneingangs)
                    {
                        positivPat.Remove(data);
                        positivPat.Add(countData);
                    }
                }
            }
            return(positivPat);
        }