WFLog.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:5k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using com.etong.DAL.FC;
- using com.etong.user;
- using com.etong.Inform;
- public partial class Workflow_WFLog : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- this.GridView1.PageSize =3;
- write.Visible = false;
- int projectid = -1;
- string prjid = Request.QueryString["ProjectID"].ToString().Trim();
- // if (Session["projectid"].ToString() != "")
- if (prjid != "")
- {
- projectid = Convert.ToInt32(Request.QueryString["ProjectID"].ToString().Trim());
- // projectid = Convert.ToInt32(Session["projectid"].ToString());
- }
- EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
- log.PrjID = projectid;
- DataView dv = log.LogQuery();
- GridView1.DataSource = dv;
- //为Repeater1控件指定数据源
- //iPageCount = pds().PageCount;
- GridView1.DataBind();
- //这个当然是必须的,绑定上去
- }
-
- }
- protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- int currentpageindex;
- currentpageindex = Convert.ToInt32(e.NewPageIndex);
- if (currentpageindex == -2)
- {
- TextBox txtNewPageIndex;
- txtNewPageIndex = GridView1.BottomPagerRow.FindControl("LinkTextBoxNewPage") as TextBox;
- if (txtNewPageIndex != null)
- {
- try
- {
- currentpageindex = Convert.ToInt32(txtNewPageIndex.Text) - 1;
- }
- catch
- {
- currentpageindex = 0;
- }
- }
- }
- currentpageindex = currentpageindex < 0 ? 0 : currentpageindex;
- currentpageindex = currentpageindex >= GridView1.PageCount ? GridView1.PageCount - 1 : currentpageindex;
- GridView1.PageIndex = currentpageindex;
-
- // int projectid = Convert.ToInt32(Session["projectid"].ToString());
- int projectid = Convert.ToInt32(Request.QueryString["ProjectID"].ToString().Trim());
- EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
- log.PrjID = projectid;
- DataView dv = log.LogQuery();
- dv.Sort = (string)ViewState["sortFieldName"];
- GridView1.DataSource = dv;
- //为Repeater1控件指定数据源
- //iPageCount = pds().PageCount;
- GridView1.DataBind();
- //这个当然是必须的,绑定上去
- }
- protected void IB_new_Click(object sender, ImageClickEventArgs e)
- {
- CheckUserInfo checkuserinfo = (CheckUserInfo)Session["checkuserinfo"];
- write.Visible = true;
- if (checkuserinfo.EmpName !=null)
- {
- TB_User.Text = checkuserinfo.EmpName;
- }
- else
- TB_User.Text = "系统管理员";
- TB_Time.Text = DateTime.Now.ToString();
- TB_Counent.Text = "";
- IB_save.Enabled = true;
- IB_quxiao.Enabled = true;
- }
- protected void IB_quxiao_Click(object sender, ImageClickEventArgs e)
- {
- write.Visible = false;
- // int projectid = Convert.ToInt32(Session["projectid"].ToString());
- int projectid = Convert.ToInt32(Request.QueryString["ProjectID"].ToString().Trim());
- EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
- log.PrjID = projectid;
- DataView dv = log.LogQuery();
- GridView1.DataSource = dv;
- //为Repeater1控件指定数据源
- //iPageCount = pds().PageCount;
- GridView1.DataBind();
- //这个当然是必须的,绑定上去
- IB_save.Enabled = false;
- IB_quxiao.Enabled = false;
- }
- protected void IB_save_Click(object sender, ImageClickEventArgs e)
- {
- // int projectid = Convert.ToInt32(Session["projectid"].ToString());
- int projectid = Convert.ToInt32(Request.QueryString["ProjectID"].ToString().Trim());
- EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
- //CheckUserInfo checkuserinfo = (CheckUserInfo)Session["checkuserinfo"];
- log.PrjID = projectid;
- log.LogWriter = TB_User.Text.Trim().ToString();
- log.LogDate = Convert.ToDateTime(TB_Time.Text.Trim().ToString());
- log.LogInfo = TB_Counent.Text.Trim().ToString();
- log.LogInsert();
- ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加日志成功!');</script>");
- //int projectid = Convert.ToInt32(Session["projectid"].ToString());
- //EtongFlyChouWFPrj log = new EtongFlyChouWFPrj();
- //log.PrjID = projectid;
- DataView dv = log.LogQuery();
- GridView1.DataSource = dv;
- //为Repeater1控件指定数据源
- //iPageCount = pds().PageCount;
- GridView1.DataBind();
- //这个当然是必须的,绑定上去
- TB_Counent.Text = "";
- }
- }