示例#1
0
        public static DataTable RefreshOneStudent(int provNum)
        {
            DataTable table = new DataTable();
            DataRow   row;

            //columns that start with lowercase are altered for display rather than being raw data.
            table.Columns.Add("appointment");
            table.Columns.Add("course");
            table.Columns.Add("done");
            table.Columns.Add("patient");
            table.Columns.Add("ReqStudentNum");
            table.Columns.Add("requirement");
            string command = "SELECT AptDateTime,CourseID,reqStudent.Descript ReqDescript,"
                             + "schoolcourse.Descript CourseDescript,reqstudent.DateCompleted, "
                             + "patient.LName,patient.FName,patient.MiddleI,patient.Preferred,ProcDescript,reqstudent.ReqStudentNum "
                             + "FROM reqstudent "
                             + "LEFT JOIN schoolcourse ON reqstudent.SchoolCourseNum=schoolcourse.SchoolCourseNum "
                             + "LEFT JOIN patient ON reqstudent.PatNum=patient.PatNum "
                             + "LEFT JOIN appointment ON reqstudent.AptNum=appointment.AptNum "
                             + "WHERE reqstudent.ProvNum=" + POut.PInt(provNum)
                             + " ORDER BY CourseID,ReqDescript";
            DataTable raw = General.GetTable(command);
            DateTime  AptDateTime;
            DateTime  dateCompleted;

            for (int i = 0; i < raw.Rows.Count; i++)
            {
                row         = table.NewRow();
                AptDateTime = PIn.PDateT(raw.Rows[i]["AptDateTime"].ToString());
                if (AptDateTime.Year > 1880)
                {
                    row["appointment"] = AptDateTime.ToShortDateString() + " " + AptDateTime.ToShortTimeString()
                                         + " " + raw.Rows[i]["ProcDescript"].ToString();
                }
                row["course"] = raw.Rows[i]["CourseID"].ToString();              //+" "+raw.Rows[i]["CourseDescript"].ToString();
                dateCompleted = PIn.PDate(raw.Rows[i]["DateCompleted"].ToString());
                if (dateCompleted.Year > 1880)
                {
                    row["done"] = "X";
                }
                row["patient"] = PatientB.GetNameLF(raw.Rows[i]["LName"].ToString(), raw.Rows[i]["FName"].ToString(),
                                                    raw.Rows[i]["Preferred"].ToString(), raw.Rows[i]["MiddleI"].ToString());
                row["ReqStudentNum"] = raw.Rows[i]["ReqStudentNum"].ToString();
                row["requirement"]   = raw.Rows[i]["ReqDescript"].ToString();
                table.Rows.Add(row);
            }
            return(table);
        }
示例#2
0
        ///<summary>Gets a filtered list of all labcases.</summary>
        public static DataTable Refresh(DateTime aptStartDate, DateTime aptEndDate)
        {
            DataTable table = new DataTable();
            DataRow   row;

            //columns that start with lowercase are altered for display rather than being raw data.
            table.Columns.Add("aptDateTime");
            table.Columns.Add("lab");
            table.Columns.Add("LabCaseNum");
            table.Columns.Add("patient");
            table.Columns.Add("phone");
            table.Columns.Add("ProcDescript");
            table.Columns.Add("status");
            string command = "SELECT AptDateTime,DateTimeChecked,DateTimeRecd,DateTimeSent,"
                             + "LabCaseNum,laboratory.Description,LName,FName,Preferred,MiddleI,Phone,ProcDescript "
                             + "FROM labcase,appointment,patient,laboratory "
                             + "WHERE labcase.AptNum=appointment.AptNum "
                             + "AND labcase.PatNum=patient.PatNum "
                             + "AND labcase.LaboratoryNum=laboratory.LaboratoryNum "
                             + "AND AptDateTime > " + POut.PDate(aptStartDate) + " "
                             + "AND AptDateTime < " + POut.PDate(aptEndDate.AddDays(1)) + " "
                             + "ORDER BY AptDateTime";
            DataTable raw = General.GetTable(command);
            DateTime  AptDateTime;
            DateTime  date;

            for (int i = 0; i < raw.Rows.Count; i++)
            {
                row                = table.NewRow();
                AptDateTime        = PIn.PDateT(raw.Rows[i]["AptDateTime"].ToString());
                row["aptDateTime"] = AptDateTime.ToShortDateString() + " " + AptDateTime.ToShortTimeString();
                row["lab"]         = raw.Rows[i]["Description"].ToString();
                row["LabCaseNum"]  = raw.Rows[i]["LabCaseNum"].ToString();
                row["patient"]     = PatientB.GetNameLF(raw.Rows[i]["LName"].ToString(), raw.Rows[i]["FName"].ToString(),
                                                        raw.Rows[i]["Preferred"].ToString(), raw.Rows[i]["MiddleI"].ToString());
                row["phone"]        = raw.Rows[i]["Phone"].ToString();
                row["ProcDescript"] = raw.Rows[i]["ProcDescript"].ToString();
                date = PIn.PDateT(raw.Rows[i]["DateTimeChecked"].ToString());
                if (date.Year > 1880)
                {
                    row["status"] = Lan.g("FormLabCases", "Quality Checked");
                }
                else
                {
                    date = PIn.PDateT(raw.Rows[i]["DateTimeRecd"].ToString());
                    if (date.Year > 1880)
                    {
                        row["status"] = Lan.g("FormLabCases", "Received");
                    }
                    else
                    {
                        date = PIn.PDateT(raw.Rows[i]["DateTimeSent"].ToString());
                        if (date.Year > 1880)
                        {
                            row["status"] = Lan.g("FormLabCases", "Sent");                         //sent but not received
                        }
                        else
                        {
                            row["status"] = Lan.g("FormLabCases", "Not Sent");
                        }
                    }
                }
                table.Rows.Add(row);
            }
            return(table);
        }