2025-03-27 15:05:14 +08:00

175 lines
7.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using SuperMap.RealEstate.CoreFrameWork;
using SuperMap.RealEstate.ServiceModel;
using SuperMap.RealEstate.Utility;
using SuperMap.RealEstate.Web.UI;
using SuperMap.RealEstate.Web.UI.WebControls;
using SuperMap.RealEstate.Web.Utility;
using Business = SuperMap.RealEstate.SendRec.Storage.Business;
namespace SuperMap.RealEstate.SendRec.Modules.PrintBill
{
public partial class Default : BasePage
{
protected override void OnLoadComplete(EventArgs e)
{
base.OnLoadComplete(e);
}
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
InitWebControls();
//初始化并加载列表
GridViewEx1.SelectingWithInit<Business.APPLYPROINST>(ObjectDataSource1, GridPageEx1,
DictionaryHelper.GetDictionary(Transaction, "APPLYPROINST_TYPE"));
//工具条按钮事件
//GridViewEx1.SetOpenControl(ButtonNew);
//设置回车焦点按钮
SetControlClientAction(ButtonSearch);
}
private void InitWebControls()
{
APPLYPROINST_TYPE.Clear();
ListItemEx _ListItemEx = new ListItemEx();
_ListItemEx.Text = "全部业务";
_ListItemEx.Value = "1=1";
APPLYPROINST_TYPE.Items.Add(_ListItemEx);
DictionaryHelper.BindingDropDownList("APPLYPROINST_TYPE", APPLYPROINST_TYPE.Items, this.Transaction);
APPLYPROINST_TYPE.SelectedIndex = 1;
}
//查询
protected void ButtonSearch_CallBackClick(object sender, ClientSetEventArgs e)
{
GridViewEx1.Selecting<Business.APPLYPROINST>(ObjectDataSource1, GridPageEx1);
//设置UI变化
e.SetValue(GridViewEx1);
e.SetValue(GridPageEx1);
}
//翻页事件
protected void GridPageEx1_CallBackPageChanged(object src, ClientSetEventArgs e)
{
GridViewEx1.Pagging<Business.APPLYPROINST>(ObjectDataSource1, GridPageEx1);
//设置UI变化
e.SetValue(GridViewEx1);
}
//查询SQL设置
protected void GridViewEx1_SelectMethodParameters(object sender, SelectMethodParametersArgs e)
{
//搜索选项的搜索条件过滤
if (!string.IsNullOrEmpty(TextBox_Search.Text))
e.AddOrParams(GridViewSearch1, TextBox_Search.Text);
//且搜索条件
//添加填写人过滤
if (APPLYPROINST_TYPE.SelectedIndex > -1 && APPLYPROINST_TYPE.SelectedValue != "1=1")
{
e.AddAndParams("APPLYPROINST_TYPE", APPLYPROINST_TYPE.SelectedValue);
}
//添加人员条件
if (PassportInfo.UserName != "system")
{
e.AddAndParams("APPROVED_PASSPORT", PassportInfo.ID);
}
//或搜索条件
//e.AddOrParams(字段名, 值);
//排序
e.AddOrderByParams(GridViewOrderBy1);
}
#region ->
protected void GridViewEx1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string _APPLYPROINST_ID = GridViewEx1.DataKeys[e.Row.RowIndex].Values["APPLYPROINST_ID"].ToString().ToEncrypt();
e.Row.Attributes["data-code"] = _APPLYPROINST_ID;
e.Row.Attributes["ondblclick"] = "showDetail(this)";
e.Row.Attributes["itemtype"] = "datatype";
e.Row.ToolTip = "双击查看详情";
LinkButton ApprovedBill = (LinkButton)e.Row.FindControl("ApprovedBill");
#region
//APPLYPROINST_TYPE APPLYPROINST_STATE 7
switch (e.Row.Cells[6].Text)
{
case "申购业务":
switch (e.Row.Cells[7].Text)
{
case "1000":
e.Row.Cells[7].Text = "申请填写";
break;
case "2000":
e.Row.Cells[7].Text = "部门负责人审核";
break;
case "3000":
e.Row.Cells[7].Text = "财务审核";
break;
case "4000":
e.Row.Cells[7].Text = "经理审批";
break;
default:
e.Row.Cells[7].Text = "办结"; break;
}
ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript("BillDefault.aspx?ID=" + _APPLYPROINST_ID, 800, 600);
break;
case "入库业务":
switch (e.Row.Cells[7].Text)
{
case "1000":
e.Row.Cells[7].Text = "采购员填写";
break;
case "2000":
e.Row.Cells[7].Text = "验收员审核";
break;
case "3000":
e.Row.Cells[7].Text = "仓管审核";
break;
default:
e.Row.Cells[7].Text = "办结"; break;
}
ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript("BillDefaultForRk.aspx?ID=" + _APPLYPROINST_ID, 800, 600);
break;
case "领料业务":
switch (e.Row.Cells[7].Text)
{
case "1000":
e.Row.Cells[7].Text = "领料填写";
break;
case "2000":
e.Row.Cells[7].Text = "仓管审核";
break;
case "3000":
e.Row.Cells[7].Text = "部门负责人审核";
break;
case "4000":
e.Row.Cells[7].Text = "财务审核";
break;
case "5000":
e.Row.Cells[7].Text = "经理审批";
break;
default:
e.Row.Cells[7].Text = "办结"; break;
}
ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript("BillDefaultForLy.aspx?ID=" + _APPLYPROINST_ID, 800, 600);
break;
}
#endregion
}
}
#endregion
}
}