using System;
using System.Data;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EKETEAM.Data;
using EKETEAM.FrameWork;

namespace eFrameWork.Customs.Base
{
    public partial class CheckupRecords : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            string AppItem = eParameters.QueryString("AppItem");
            string parentModelID = eParameters.QueryString("modelid");
            string parentID = eParameters.QueryString("id");
            string modelid = eParameters.QueryString("modelid");
            if ((parentModelID.Length > 0 || AppItem.Length > 0) && parentID.Length > 0)
            {
                eList elist = new eList("a_eke_sysCheckupRecords");
                elist.Where.Add("CheckupContentId='" + parentID + "'");
                if (modelid.Length > 0) elist.Where.Add("modelid='" + modelid + "'");
                elist.OrderBy.Add("addTime");

                if (eBase.IsMobile())
                {
                    Rep.ItemDataBound += new RepeaterItemEventHandler(Rep_ItemDataBound);
                    elist.Bind(Rep);
                }
                else
                {
                   
                    elist.Bind(eListControl1);
                }
            }
            string act = eParameters.QueryString("act");
            if (act == "add")
            {
               // Response.Write("暂无审核记录!");
            }
        }
        protected void Rep_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string userid = DataBinder.Eval(e.Item.DataItem, "UserID").ToString();
                Control ctrl = e.Item.Controls[0];
                Literal lit = (Literal)ctrl.FindControl("LitUser");
                if (lit != null && userid.Length>0)
                {
                    lit.Text = eOleDB.getValue("select xm from a_eke_sysUsers where UserId='" + userid + "'");
                }
            }
        }
    }
}