Esempio n. 1
0
    //private DataSet allds;
    public string GetComment(string tutorid, string filename, int pagesize, int pagenum)
    {
        DataSet ds  = tuC.GetTutorComment(tutorid);
        int     num = allnum = ds.Tables[0].Rows.Count;
        string  re  = "";

        for (int i = (pagenum - 1) * pagesize; i < pagenum * pagesize && i < ds.Tables[0].Rows.Count; i++)
        {
            DataRow dr      = ds.Tables[0].Rows[i];
            string  recid   = dr["ReservationID"].ToString();
            string  time    = dr["Time"].ToString();
            string  star    = dr["Start"].ToString();
            string  comment = dr["Comment"].ToString();
            DataSet per     = rec.GetRecPersonInfo(recid);
            DataSet dscour  = rec.GetRecCourse(recid);
            string  name    = "";
            string  grade   = "";
            string  course  = "";
            if (per.Tables[0].Rows.Count > 0)
            {
                name = per.Tables[0].Rows[0]["StuName"].ToString();
            }
            if (dscour.Tables[0].Rows.Count > 0)
            {
                grade = dscour.Tables[0].Rows[0]["Grade"].ToString();
                for (int j = 0; j < dscour.Tables[0].Rows.Count; j++)
                {
                    course += dscour.Tables[0].Rows[j]["CourseName"].ToString() + ",";
                }
            }
            string extra = time + "  " + "课程:" + course + "  年级:" + grade;
            re += GetCommentTemp(name, int.Parse(star), comment, extra, filename);
        }
        return(re);
    }