- 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;
- public partial class Project_ProjectCheck : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- try
- {
- GridView1.PageSize = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["MorePageNum"]);
- }
- catch
- {
- GridView1.PageSize = 10;
- }
- EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
- EFlyPrj.PrjStatus = -1;
- EFlyPrj.PrjType = -1;
- DataView dv = EFlyPrj.PrjQuery();
- GridView1.DataSource = dv;
- 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;
- EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
- EFlyPrj.PrjType = Convert.ToInt32(this.RListType.SelectedValue.ToString());
- EFlyPrj.PrjStatus = Convert.ToInt32(this.RListStatus.SelectedValue.ToString());
- DataView dv = EFlyPrj.PrjQuery();
- dv.Sort = (string)ViewState["sortFieldName"];
- this.GridView1.DataSource = dv;
- this.GridView1.DataBind();
- }
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- int iRow;
- iRow = e.Row.DataItemIndex;
- iRow = iRow % 2;
- if (iRow > 0)
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='#f0f0f0';");
- else
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';");
- e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#E8F2FA';");
- int state;
- int projectsort;
- if (e.Row.Cells[7].Text != null || e.Row.Cells[7].Text != "")
- {
- try
- {
- state = Convert.ToInt32(e.Row.Cells[7].Text);
- }
- catch
- {
- state = -1;
- }
- switch (state)
- {
- case 0:
- e.Row.Cells[7].Text = "正常";
- break;
- case 1:
- e.Row.Cells[7].Text = "申请完成";
- break;
- case 2:
- e.Row.Cells[7].Text = "作废";
- break;
- case 3:
- e.Row.Cells[7].Text = "施工";
- break;
- case 4:
- e.Row.Cells[7].Text = "竣工";
- break;
- case 5:
- e.Row.Cells[7].Text = "完成";
- break;
- default:
- e.Row.Cells[7].Text = "未知";
- break;
- }
- try
- {
- projectsort = Convert.ToInt32(e.Row.Cells[3].Text);
- }
- catch
- {
- projectsort = -1;
- }
- switch (projectsort)
- {
- case 1:
- e.Row.Cells[3].Text = "生产类";
- break;
- case 2:
- e.Row.Cells[3].Text = "科技类";
- break;
- case 3:
- e.Row.Cells[3].Text = "营销类";
- break;
- default:
- e.Row.Cells[3].Text = "未知";
- break;
- }
- }
- }
- }
- protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
- {
- string sPrjID = Convert.ToString(e.CommandArgument);
- string sURL;
- if (e.CommandName == "Eq")
- {
- sURL = "EqFeeCheck.aspx?sPrjID=" + sPrjID;
- Response.Redirect(sURL);
- }
- if (e.CommandName == "Mat")
- {
- sURL = "MatFeeCheck.aspx?sPrjID=" + sPrjID;
- Response.Redirect(sURL);
- }
- if (e.CommandName == "Other")
- {
- sURL = "OtherFeeCheck.aspx?sPrjID=" + sPrjID;
- Response.Redirect(sURL);
- }
- }
- protected void imgSearch_Click(object sender, ImageClickEventArgs e)
- {
- EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
- EFlyPrj.PrjStatus = Convert.ToInt32(RListStatus.SelectedValue);
- EFlyPrj.PrjType = Convert.ToInt32(RListType.SelectedValue);
- DataView dv = EFlyPrj.PrjQuery();
- GridView1.DataSource = dv;
- GridView1.DataBind();
- }
- }