Exemple #1
0
        public Check(DateTime date, List <CardModel> cards, PatientModel patient)
        {
            InitializeComponent();
            string      dateFormat = "dd.MM.yyyy";
            DbConnector db         = DbConnector.GetInstance();

            _tt             = db.GetTestTypes();
            _st             = db.GetSurveyTypes();
            _total          = 0;
            _date           = date.ToString(dateFormat);
            _cards          = cards;
            _patient        = patient;
            TitleLabel.Text = string.Format("Check for {0}\n{1}",
                                            _patient.Name, _date);
            _tests    = new List <TestModel>();
            _surveys  = new List <SurveyModel>();
            _sessions = new List <SessionModel>();
            foreach (CardModel c in _cards)
            {
                _tests.AddRange(db.GetTests(c.id).Where(x => x.DateTime.Substring(0, 10) == _date));
                _sessions.AddRange(db.GetSessions(c.id).Where(x => x.DateTime.Substring(0, 10) == _date));
                _surveys.AddRange(db.GetSurveys(c.id).Where(x => x.DateTime.Substring(0, 10) == _date));
            }
            FillTable();
        }