Exemple #1
0
        ///<summary>This is only allowed because it's PRIVATE.</summary>
        private static List <Schedule> RefreshAndFill(string command)
        {
            //Not a typical refreshandfill, as it contains a query.
            //The GROUP_CONCAT() function returns a comma separated list of items.
            //In this case, the ops column is filled with a comma separated list of
            //operatories for the corresponding schedule record.
            command = "SELECT s.*,"
                      + DbHelper.IfNull(DbHelper.CastToChar("(SELECT " + DbHelper.GroupConcat("so.OperatoryNum") +
                                                            "FROM scheduleop so " +
                                                            "WHERE so.ScheduleNum=s.ScheduleNum " +
                                                            "GROUP BY so.ScheduleNum)"), "") + " ops " +
                      "FROM (" + command + ") s";
            DataTable table = Db.GetTable(command);

            return(ConvertTableToList(table));
        }