Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //if (!this.IsPostBack)
     //{
     if (Session["uid"].ToString() == "")
     {
         this.Response.Redirect("login.aspx?url=" + this.Request.RawUrl.ToString());
     }
     else
     {
         TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers(Session["uid"].ToString());
         lbluserinfo.Text = JpUsers.uname;
         if (JpUsers.deptid != "")
         {
             TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
             DataTable dt = JpDepts.GetDept(JpUsers.deptid);
             if (dt.Rows.Count > 0)
             {
                 lbluserinfo.Text += "(" + dt.Rows[0]["deptname"].ToString() + ")";
             }
         }
         TPortalClass.JpSite JpSite = new TPortalClass.JpSite();
         webname.Text = JpSite.SiteName;
         weburl.Text = JpSite.host;
         webcompany.Text = "宁波移信";
         dbname.Text = JpSite.dbname;
         versions.Text = JpSite.version;
         //读取登录信息
         TPortalClass.JpLog JpLog = new TPortalClass.JpLog();
         DataTable dt_log = JpLog.Getlogs();
         if (dt_log.Rows.Count > 0)
         {
             litIP.Text = dt_log.Rows[0]["hy_oppip"].ToString();
         }
         if (dt_log.Rows.Count > 1)
         {
             litBackIP.Text = dt_log.Rows[1]["hy_oppip"].ToString();
             litBackTime.Text = dt_log.Rows[1]["hy_createtime"].ToString();
         }
     }
     //}
 }
Beispiel #2
0
    private void RptBind()
    {
        if (this.Request.QueryString["page"] != null)
            this.page = int.Parse(this.Request.QueryString["page"].ToString());
        else
            this.page = 1;

        this.txtdate_s.Text = this.keyword_s;
        this.txtdate_e.Text = this.keyword_e;
        txtPageNum.Text = this.pageSize.ToString();
        txtPage.Text = this.page.ToString();

        TPortalClass.JpLog JpLog = new TPortalClass.JpLog();
        DataTable dt = JpLog.Getlogs_search(this.txtdate_s.Text, this.txtdate_e.Text);
        this.totalCount = dt.Rows.Count;
        DataTable tempTable = dt.Clone();
        for (int i = (this.page - 1) * this.pageSize; i < this.page * this.pageSize; i++)
        {
            if (i > dt.Rows.Count - 1)
                break;

            DataRow dr = tempTable.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                dr[dt.Columns[j].ColumnName] = dt.Rows[i][j];
            }
            tempTable.Rows.Add(dr);
        }
        rptList.DataSource = tempTable;
        rptList.DataBind();

        //翻页
        //string pageUrl = Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}&page={4}",
        //        this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property, "__id__");
        TPortalClass.JpCommon JpCommon = new TPortalClass.JpCommon();
        string pageUrl = JpCommon.CombUrlTxt("list_log.aspx", "page={0}&rnd={1}&keyword_s={2}&keyword_e={3}",
            "__id__", "" + System.Guid.NewGuid().ToString() + "", "" + this.txtdate_s.Text + "", "" + this.txtdate_e.Text + "");
        PageContent.InnerHtml = JpCommon.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
    }
Beispiel #3
0
 public void WriteLog(string hy_oppip, string hy_opptype, string hy_oppcontent, string hy_oppuserid, string hy_oppusername)
 {
     JpLog JpLog = new JpLog();
     JpLog.ID = System.Guid.NewGuid().ToString();
     JpLog.hy_createtime = System.DateTime.Now.ToString();
     JpLog.hy_oppip = hy_oppip;
     JpLog.hy_opptype = hy_opptype;
     JpLog.hy_oppcontent = hy_oppcontent;
     JpLog.hy_oppuserid = hy_oppuserid;
     JpLog.hy_oppusername = hy_oppusername;
     JpLog.Insert();
 }