62,046
社区成员
发帖
与我相关
我的任务
分享
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.Idea;
using PatReview.BLL;
namespace PatReview.Idea
{
public partial class IdeaDetailView : PageBase
{
public string PatentMngNo = "";
protected override void Page_Load(object sender, EventArgs e)
{
if (Request.Params["PatentMngNo"] != null)
{
if (Request.Params["PatentMngNo"].ToString() != "")
{
PatentMngNo = Request.Params["PatentMngNo"].ToString();
}
}
if (Request.Params["comefrom"] != "ipline")
{
base.Page_Load(sender, e);
}
else
{
ToolBar1.Items[2].Visible = false;
}
if (Request.QueryString["comefrom"]=="ProjectIdeaInfo")
ToolBar1.Items[2].Visible = false;
InitProjectValue();
if (!this.IsPostBack)
{
ToolBar1.Items[0].Text = PatReview.BLL.ResourceManager.GetString("Idea_IdeaViewPosition");
ToolBar1.Items[2].Text = PatReview.BLL.ResourceManager.GetString("Return");
ToolBar1.Items[3].Text = PatReview.BLL.ResourceManager.GetString("Reload");
if (Request.QueryString["BackButtonVisable"] == "no")
{
ToolBar1.Items[2].Visible = false;
ToolBar1.Items[3].Visible = false;
}
}
this.HeaderIdea.InfoName = ResourceManager.GetString("Application_Patent"); //;
//不显示流程步骤信息
ExecJSScript("SetADm3NotVisible()");
Response.Expires = -1;
}
private void InitProjectValue()
{
hidProjectCode.Value = Request.QueryString["projectCode"];
HiddenSend.Value = Request.QueryString["projectSend"];
}
private void ExecJSScript(string js)
{
string script = string.Format("<script language='javascript'>{0} </script>", js);
ClientScriptManager cs = this.ClientScript;
cs.RegisterStartupScript(GetType(), "", script.ToString());
}
}
}
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;
}
/// <summary>
/// 绑定数据
/// </summary>
/// <param name="CurPage"></param>
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();
}
/// <summary>
/// 检索条件
/// </summary>
/// <returns></returns>
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
}
}