可是在項(xiàng)目中明明有這個(gè)文件的,
BountyUserAdd.aspx這個(gè)文件的代碼如下:
獎(jiǎng)金人員
//給tree加選中時(shí)的狀態(tài)
var lastnode = "";
var nodeValue="0";
function SetNode(node)
{
document.getElementById(node).style.backgroundColor='#808080';
document.getElementById(node).style.color='#F1F5F6';
var pos=node.indexOf("_");
nodeValue=node.substring(pos+1);
window.document.node=node;
window.document.getElementById("HidDepartmentCode").value=nodeValue;
if(lastnode!="" && lastnode!=node)
{
if (document.getElementById(lastnode) != null && document.getElementById(lastnode) != undefined)
{
document.getElementById(lastnode).style.backgroundColor='';// '#F1F5F6';
document.getElementById(lastnode).style.color='';
}
}
lastnode=node;
}
function setLastSelect()//如果在同樣節(jié)點(diǎn)上連續(xù)添加,記住用戶上次的選擇
{
if(window.document.getElementById("HidDepartmentCode").value!="")
{
lastnode="spnode_"+window.document.getElementById("HidDepartmentCode").value;//如果用戶未選擇,默認(rèn)選中根節(jié)點(diǎn)
}
else
{
lastnode="spnode_0"
}
SetNode(lastnode);
}
function DepatmentAdd()
{
window.opener.window.document.getElementById("TxtStaff").value = document.getElementById("getAllModuleID").value;
window.opener.window.document.getElementById("TxtStaff2").value = document.getElementById("getAllModuleName").value;
window.close();
}
function selectCheckBox()
{
var allCheckBox=document.getElementsByName("ResultList");
var i;
var allProjectID="";
var t=0;
var openHref;
var str ="";
for(i=0;i
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()這個(gè)異常會(huì)繼續(xù)傳到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;
}
///
/// 綁定數(shù)據(jù)
///
///
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); //得到當(dāng)前頁(yè)記錄集綁定到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 = "";
//讀出此用戶的相關(guān)信息(用戶名,部門名稱)
Employee GetInfo = new Employee();
DataSet ds = GetInfo.GetEmployeeInfo(id);
DataTable dt = ds.Tables[0];
StrEmployeeName = dt.Rows[0]["EmployeeName"].ToString();
//在這INSERT進(jìn)內(nèi)存
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"] = "特殊獎(jiǎng)金";
//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
}
}
求大家?guī)兔聪聠?wèn)題是在哪兒了,,謝謝了,,,急等
- 2 回答
- 0 關(guān)注
- 853 瀏覽
添加回答
舉報(bào)
0/150
提交
取消