コード例 #1
0
        internal async Task AssertAll(string expected = null)
        {
            var nodes = (await _connection.QueryAsync <Node>($"SELECT * FROM {SqlStuff.Escape(Table)}")).ToDictionary(x => x.Id, x => x);

            await DropTable().ExecuteAsync(_connection);

            var asserter = new Asserter(nodes, expected ?? _expected);

            asserter.AssertAll();
        }
コード例 #2
0
        public ActionResult StudyReport(int?id)
        {
            var sqlStuff = new SqlStuff();
            var data     = sqlStuff.StudyReport();

            var model = new List <StudyReportViewModel>();

            model = ConvertDataTable <StudyReportViewModel>(data);

            return(View(model));
        }
コード例 #3
0
        public ActionResult DoctorReport(int?id)
        {
            var sqlStuff = new SqlStuff();
            var data     = sqlStuff.DoctorReport((int)id);

            var model = new List <DoctorReportViewModel>();

            model = ConvertDataTable <DoctorReportViewModel>(data);

            return(View(model));
        }
コード例 #4
0
        public ActionResult AppointmentStatistics()
        {
            var sqlStuff = new SqlStuff();
            var data     = sqlStuff.AppointmentStatistics();

            var model = new List <AppointmentStatisticsViewModel>();

            model = ConvertDataTable <AppointmentStatisticsViewModel>(data);

            return(View(model));
        }
コード例 #5
0
        protected async Task <LRTest> Test(string tree)
        {
            var tableName = CreateTableName();
            await CreateTable.New("[%_Node_%]", SqlStuff.Escape(tableName)).ExecuteAsync(_connection);

            await Arrange(tree, SqlStuff.Escape(tableName), _connection);

            await MigrationFactory.CreateScript(tableName, "Id", "Parent_Id").ExecuteAsync(_connection);

            return(new LRTest(tableName, tree, _connection));
        }
コード例 #6
0
        public ActionResult Index()
        {
            int currentUser = SessionManager.CurrentUser.usePID;

            var sqlStuff = new SqlStuff();
            var theData  = sqlStuff.Dashboard(currentUser);

            var dashboardByID = new List <DashboardViewModel>();

            dashboardByID = ConvertDataTable <DashboardViewModel>(theData);

            return(View("Index", dashboardByID));
        }
コード例 #7
0
        public ActionResult Appointments(int studyArmPID)
        {
            int currentUser = SessionManager.CurrentUser.usePID;

            var sqlStuff = new SqlStuff();
            var theData  = sqlStuff.AppointmentDetail(studyArmPID);

            var appointments = new List <AppointmentViewModel>();

            appointments = ConvertDataTable <AppointmentViewModel>(theData);

            return(View("Appointments", appointments));
        }
コード例 #8
0
        public ActionResult StudyArmDetailsView(int?id)
        {
            var sqlStuff       = new SqlStuff();
            var dbDoctors      = sqlStuff.DoctorsByStudyArm((int)id);
            var dbSubjects     = sqlStuff.SubjectsByStudyArm((int)id);
            var dbDocuments    = sqlStuff.DocumentsByStudyArm((int)id);
            var dbVisits       = sqlStuff.VisitsByStudyArm((int)id);
            var dbActivites    = sqlStuff.ActivitesByStudyArm((int)id);
            var dbAppointments = sqlStuff.AppointmentsByStudyArm((int)id);

            var model = new StudyArmDetailsViewModel();

            model.doctors = ConvertDataTable <Doctor>(dbDoctors);
            //model.subjects = ConvertDataTable<Subject>(dbSubjects);
            model.documents    = ConvertDataTable <DocumentInfo>(dbDocuments);
            model.visits       = ConvertDataTable <Visit>(dbVisits);
            model.activities   = ConvertDataTable <Activity>(dbActivites);
            model.appointments = ConvertDataTable <Appointment>(dbAppointments);
            model.VisitActivitiesCheckBoxes = new List <CheckBox>();
            model.studyArmID = Convert.ToInt32(id);

            using (var context = new SiteContext())
            {
                var assigned = context.SubAssigned.Where(x => x.satStudyArmLinkID == model.studyArmID).ToList();
                foreach (var item in assigned)
                {
                    var sub = context.Subjects.FirstOrDefault(x => x.subPID == item.satSubjectLinkID);
                    model.subjects.Add(sub);
                }
            }

            foreach (Appointment app in model.appointments)
            {
                var box = new CheckBox();
                box.appPID    = app.appPID;
                box.isChecked = true;
                model.VisitActivitiesCheckBoxes.Add(box);
            }
            return(View("StudyArmDetailsView", model));
        }
コード例 #9
0
        public ActionResult StudyReportByID(int?id)
        {
            var sqlStuff = new SqlStuff();
            var data     = sqlStuff.StudyReportByID((int)id);

            var dbmodel = new List <StudyDetailViewModel>();

            dbmodel = ConvertDataTable <StudyDetailViewModel>(data);

            var model = new StudyReportBIGModel();

            model.studyDetails = dbmodel;

            using (var sc = new SiteContext())
            {
                var armIDs = sc.StudyArms.Where(x => x.sarStudyLinkID == id).ToList();
                model.subjects = new List <Subject>();
                model.doctors  = new List <Doctor>();

                foreach (var item in armIDs)
                {
                    var docAssigned = sc.DocAssigned.Where(x => x.datStudyArmLinkID == item.sarPID).ToList();
                    foreach (var doc in docAssigned)
                    {
                        var dbDoctor = sc.Doctors.FirstOrDefault(x => x.docPID == doc.datDoctorLinkID);
                        model.doctors.Add(dbDoctor);
                    }
                    var subAssigned = sc.SubAssigned.Where(x => x.satStudyArmLinkID == item.sarPID).ToList();
                    foreach (var sub in subAssigned)
                    {
                        var dbSubject = sc.Subjects.FirstOrDefault(x => x.subPID == sub.satSubjectLinkID);
                        model.subjects.Add(dbSubject);
                    }
                }
            }
            return(View(model));
        }
コード例 #10
0
 private Script DropTable()
 {
     return(TestsBase.DropTable.New("[Node]", SqlStuff.Escape(Table)));
 }