可是在项目中明明有这个文件的,
BountyUserAdd.aspx这个文件的代码如下:
<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation ="false" CodeBehind="BountyUserAdd.aspx.cs" Inherits="PatReview.Bounty.BountyUserAdd" %>
<%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
<%@ Register TagPrefix="cc1" Namespace="PatReview.BLL" Assembly="PatReview.BLL" %>
奖金人员
BountyUserAdd.aspx.cs文件的代码如下:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using PatReview.BLL;
using Daweisoft.Utility;
using Daweisoft.ExceptionLog;
using System.Xml;
using PatReview.BLL.Patent;
namespace PatReview.Bounty
{
public partial class BountyUserAdd : PageBase
{
protected void Page_Error(object sender, EventArgs e)
{
Exception ex = Server.GetLastError();
if (ex is HttpRequestValidationException)
{
Server.Transfer("../Msg/JSErrorClose.aspx");
Server.ClearError(); // 如果不ClearError()这个异常会继续传到Application_Error()。
}
}
protected override void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
But_Save.Text = ResourceManager.GetString("SubmitSpace");
SearchButton.Text = ResourceManager.GetString("SearchSpace");
//加载部门树
UserAddInfo LoadTree = new UserAddInfo();
LoadTree.LoadDepartMentTree(DepartmentTree, "", 1);
GridViewDataBind(0);
if (Request.Params["DepartmentCode"] != null)
HidDepartmentCode.Value = Request.Params["DepartmentCode"].ToString();
}
Response.Expires = -1;
}
///
/// 绑定数据
///
///
private void GridViewDataBind(int CurPage)
{
string StrSort = "";
if (TxtSort.Text == "")
{
StrSort = "EmployeeCode DESC";
}
else
{
StrSort = TxtSort.Text;
}
string sWhere = GetWhere();
int Total = 0;
UserAddInfo rml = new UserAddInfo();
DataTable dt = rml.GetUserList(sWhere, this.Pager1.PageSize, CurPage, StrSort, ref Total);
Pager1.RecTotal = Total;
Pager1.DataBind();
Grid1.DataSource = dt;
Grid1.DataBind();
}
///
/// 检索条件
///
///
private string GetWhere()
{
DataSet BountySpecialUser = (DataSet)SessionGlobal.Get().GetObject("BountySpecial");
DataView ddv = new DataView(BountySpecialUser.Tables["TP_PatentBountyDetail"], "", "BountySeqNo", DataViewRowState.CurrentRows);
string IDGroup = "";
for (int i = 0; i < ddv.Count; i++)
{
IDGroup += "'" + ddv[i]["BountyEmployee"] + "'" + ",";
}
if (ddv.Count != 0)
{
IDGroup = IDGroup.Substring(0, IDGroup.Length - 2);
IDGroup = IDGroup.Substring(1);
}
string sWhere = " (1=1) and";
if (IDGroup != "")
{
sWhere += " (EmployeeCode not in ('" + IDGroup + "')) and";
}
if (!string.IsNullOrEmpty(Request.Params["DepartmentCode"]))
{
sWhere += " (DepartmentCode = '" + Request.Params["DepartmentCode"] + "') and";
}
if (TxtEmployeeName.Text != "")
{
sWhere += " (EmployeeName like '%" + StringEx.Replace(TxtEmployeeName.Text) + "%' or EmployeeCode like '%" + StringEx.Replace(TxtEmployeeName.Text) + "%')and";
}
sWhere = sWhere.Substring(0, sWhere.Length - 3);
return sWhere;
}
protected void Search_Click(object sender, EventArgs e)
{
GridViewDataBind(0);
}
protected void Pager1_PageChanged(object sender, EventArgs e)
{
GridViewDataBind(Pager1.CurPage); //得到当前页记录集绑定到DataGird表上
}
protected void But_Save_Click(object sender, EventArgs e)
{
string item = getAllModuleID.Text;
string MngNo = Request.Params["MngNo"];
if (item == null)
{
return;
}
string[] idArr = item.Split(',');
for (int i = 0; i < idArr.Length; i++)
{
string id = idArr[i].ToString();
string StrEmployeeName = "";
string StrDepartmentName = "";
//读出此用户的相关信息(用户名,部门名称)
Employee GetInfo = new Employee();
DataSet ds = GetInfo.GetEmployeeInfo(id);
DataTable dt = ds.Tables[0];
StrEmployeeName = dt.Rows[0]["EmployeeName"].ToString();
//在这INSERT进内存
if (SessionGlobal.Get().GetObject("BountySpecial") == null)
return;
DataSet BountySpecialUser = (DataSet)SessionGlobal.Get().GetObject("BountySpecial");
DataRow row = BountySpecialUser.Tables["TP_PatentBountyDetail"].NewRow();
row["BountyEmployee"] = id;
row["BountyEmployeeName"] = StrEmployeeName;
row["BountySeqNo"] = DataConvert.ObjectToInt(BountySpecialUser.Tables["TP_PatentBountyDetail"].Compute("Max(BountySeqNo)", "")) + 1;
row["ManagerNo"] = "特殊奖金";
//row["BountyType"] = "EEE";
row["BountyEmpPayState"] = "01";
row["Checked"] = true;
//row["BountyYear"] = DateTime.Now.Year;
row.EndEdit();
BountySpecialUser.Tables["TP_PatentBountyDetail"].Rows.Add(row);
SessionGlobal.Get().AddObject("BountySpecial", BountySpecialUser);
}
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "window.close();", true);
}
#region 列表排序
public void OnPageIndexChanged(object sender, ComponentArt.Web.UI.GridPageIndexChangedEventArgs args)
{
Grid1.CurrentPageIndex = args.NewIndex;
}
public void OnSort(object sender, ComponentArt.Web.UI.GridSortCommandEventArgs args)
{
TxtSort.Text = args.SortExpression;
}
public void OnNeedDataSource(object sender, EventArgs oArgs)
{
GridViewDataBind(0);
}
public void OnNeedRebind(object sender, System.EventArgs oArgs)
{
Grid1.DataBind();
}
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
//this.Load += new System.EventHandler(this.Page_Load);
Grid1.PageIndexChanged += new ComponentArt.Web.UI.Grid.PageIndexChangedEventHandler(OnPageIndexChanged);
Grid1.SortCommand += new ComponentArt.Web.UI.Grid.SortCommandEventHandler(OnSort);
Grid1.NeedRebind += new ComponentArt.Web.UI.Grid.NeedRebindEventHandler(OnNeedRebind);
Grid1.NeedDataSource += new ComponentArt.Web.UI.Grid.NeedDataSourceEventHandler(OnNeedDataSource);
}
#endregion
}
}
求大家帮忙看下问题是在哪儿了,,谢谢了,,,急等