Пример #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);
    }
Пример #2
0
    protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            string resid = DataList1.DataKeys[e.Item.ItemIndex].ToString();

            DataSet dscour = res.GetRecCourse(resid);
            string  course = "";
            for (int i = 0; i < dscour.Tables[0].Rows.Count; i++)
            {
                course += dscour.Tables[0].Rows[i]["CourseName"].ToString() + ",";
            }
            course = course.Substring(0, course.LastIndexOf(','));
            Label cour = e.Item.FindControl("lb_course") as Label;
            cour.Text = course;


            Label ifpass = e.Item.FindControl("lb_state") as Label;

            if (ifpass.Text.Equals("0"))
            {
                ifpass.Text      = "正在处理";
                ifpass.ForeColor = Color.Red;
                Label phone = e.Item.FindControl("lb_phone") as Label;
                phone.Text = "暂未获取";
                LinkButton send = e.Item.FindControl("bt_send") as LinkButton;
                send.Visible = false;
                LinkButton comment = e.Item.FindControl("bt_comment") as LinkButton;
                comment.Visible = false;
            }
            else if (ifpass.Text.Equals("1"))
            {
                ifpass.Text      = "审核通过";
                ifpass.ForeColor = Color.Green;
                LinkButton delete = e.Item.FindControl("lb_delete") as LinkButton;
                delete.Visible = false;
            }
            else if (ifpass.Text.Equals("2"))
            {
                ifpass.Text      = "授课结束";
                ifpass.ForeColor = Color.Blue;
                //LinkButton send = e.Item.FindControl("bt_send") as LinkButton;
                //send.Visible = false;
                LinkButton delete = e.Item.FindControl("lb_delete") as LinkButton;
                delete.Visible = false;
            }
            else if (ifpass.Text.Equals("-1"))
            {
                ifpass.Text      = "取消";
                ifpass.ForeColor = Color.DarkGray;
                LinkButton send = e.Item.FindControl("bt_send") as LinkButton;
                send.Visible = false;
                LinkButton delete = e.Item.FindControl("lb_delete") as LinkButton;
                delete.Visible = false;
                LinkButton comment = e.Item.FindControl("bt_comment") as LinkButton;
                comment.Visible = false;
            }
        }
    }