WFLog.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:5k
源码类别:

.net编程

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using com.etong.DAL.FC;
  12. using com.etong.user;
  13. using com.etong.Inform;
  14. public partial class Workflow_WFLog : System.Web.UI.Page
  15.     protected void Page_Load(object sender, EventArgs e)
  16.     {
  17.         if (!IsPostBack)
  18.         {          
  19.             this.GridView1.PageSize =3; 
  20.             write.Visible = false;
  21.             int projectid = -1;
  22.             string prjid = Request.QueryString["ProjectID"].ToString().Trim();
  23.            // if (Session["projectid"].ToString() != "")
  24.             if (prjid != "")
  25.             {
  26.                  projectid = Convert.ToInt32(Request.QueryString["ProjectID"].ToString().Trim());
  27.                //  projectid = Convert.ToInt32(Session["projectid"].ToString());
  28.             }            
  29.             EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
  30.             log.PrjID = projectid;
  31.             DataView dv = log.LogQuery();
  32.             GridView1.DataSource = dv;
  33.             //为Repeater1控件指定数据源
  34.             //iPageCount = pds().PageCount;
  35.             GridView1.DataBind();
  36.             //这个当然是必须的,绑定上去            
  37.         }
  38.        
  39.     }
  40.     protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
  41.     {
  42.         int currentpageindex;
  43.         currentpageindex = Convert.ToInt32(e.NewPageIndex);
  44.         if (currentpageindex == -2)
  45.         {
  46.             TextBox txtNewPageIndex;
  47.             txtNewPageIndex = GridView1.BottomPagerRow.FindControl("LinkTextBoxNewPage") as TextBox;
  48.             if (txtNewPageIndex != null)
  49.             {
  50.                 try
  51.                 {
  52.                     currentpageindex = Convert.ToInt32(txtNewPageIndex.Text) - 1;
  53.                 }
  54.                 catch
  55.                 {
  56.                     currentpageindex = 0;
  57.                 }
  58.             }
  59.         }
  60.         currentpageindex = currentpageindex < 0 ? 0 : currentpageindex;
  61.         currentpageindex = currentpageindex >= GridView1.PageCount ? GridView1.PageCount - 1 : currentpageindex;
  62.         GridView1.PageIndex = currentpageindex;
  63.       
  64.        // int projectid = Convert.ToInt32(Session["projectid"].ToString());
  65.         int projectid = Convert.ToInt32(Request.QueryString["ProjectID"].ToString().Trim());
  66.         EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
  67.         log.PrjID = projectid;
  68.         DataView dv = log.LogQuery();
  69.         dv.Sort = (string)ViewState["sortFieldName"];
  70.         GridView1.DataSource = dv;
  71.         //为Repeater1控件指定数据源
  72.         //iPageCount = pds().PageCount;
  73.         GridView1.DataBind();
  74.         //这个当然是必须的,绑定上去 
  75.     }
  76.     protected void IB_new_Click(object sender, ImageClickEventArgs e)
  77.     {     
  78.         CheckUserInfo checkuserinfo = (CheckUserInfo)Session["checkuserinfo"];  
  79.         write.Visible = true;
  80.         if (checkuserinfo.EmpName !=null)
  81.         {
  82.            TB_User.Text = checkuserinfo.EmpName;
  83.         }
  84.         else
  85.             TB_User.Text = "系统管理员";
  86.         TB_Time.Text = DateTime.Now.ToString();
  87.         TB_Counent.Text = "";
  88.         IB_save.Enabled = true;
  89.         IB_quxiao.Enabled = true;
  90.     }
  91.     protected void IB_quxiao_Click(object sender, ImageClickEventArgs e)
  92.     {
  93.         write.Visible = false;
  94.        // int projectid = Convert.ToInt32(Session["projectid"].ToString());
  95.         int projectid = Convert.ToInt32(Request.QueryString["ProjectID"].ToString().Trim());
  96.         EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
  97.         log.PrjID = projectid;
  98.         DataView dv = log.LogQuery();
  99.         GridView1.DataSource = dv;
  100.         //为Repeater1控件指定数据源
  101.         //iPageCount = pds().PageCount;
  102.         GridView1.DataBind();
  103.         //这个当然是必须的,绑定上去
  104.         IB_save.Enabled = false;
  105.         IB_quxiao.Enabled = false;
  106.     }
  107.     protected void IB_save_Click(object sender, ImageClickEventArgs e)
  108.     {
  109.        // int projectid = Convert.ToInt32(Session["projectid"].ToString());
  110.         int projectid = Convert.ToInt32(Request.QueryString["ProjectID"].ToString().Trim());
  111.         EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
  112.         //CheckUserInfo checkuserinfo = (CheckUserInfo)Session["checkuserinfo"];
  113.         log.PrjID = projectid;
  114.         log.LogWriter = TB_User.Text.Trim().ToString();
  115.         log.LogDate = Convert.ToDateTime(TB_Time.Text.Trim().ToString());
  116.         log.LogInfo = TB_Counent.Text.Trim().ToString();
  117.         log.LogInsert();
  118.         ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加日志成功!');</script>");
  119.         //int projectid = Convert.ToInt32(Session["projectid"].ToString());
  120.         //EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
  121.         //log.PrjID = projectid;
  122.         DataView dv = log.LogQuery();
  123.         GridView1.DataSource = dv;
  124.         //为Repeater1控件指定数据源
  125.         //iPageCount = pds().PageCount;
  126.         GridView1.DataBind();
  127.         //这个当然是必须的,绑定上去
  128.         TB_Counent.Text = "";
  129.     }