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

160 lines
5.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Data;
using System.Linq;
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.HighWay.Storage.Business;
namespace SuperMap.RealEstate.HighWay.Modules.CompactManager
{
/// <summary>
/// T_PAYCOMPACTDETAIL_支付情况 的WebUserControl
/// <summary>
public partial class PAYCOMPACTDETAIL : UserControl<Business.PAYCOMPACTDETAIL>
{
#region -> RetCOMPACT_ID
private string RetCOMPACT_ID
{
get
{
return Request["COMPACT_ID"].ToDecrypt();
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
}
//在此加入界面的数据初始化(Page_Load之前)如DropDownList的数据源绑定等
public override void InitializeWebControl()
{
}
//载入数据
public override bool LoadData()
{
//初始化并加载列表
GridViewEx1.SelectingWithInit<Business.IMAGE>(ObjectDataSource1, GridPageEx1, DictionaryHelper.GetDictionary(Transaction, "ISVALID"));
//设置回车焦点按钮
Page.SetControlClientAction(ButtonSearch);
//如果是工作流组件请自行修改载入的逻辑,以下是功能模块的默认代码
if (!String.IsNullOrEmpty(Request["ID"]))
{
CurrObject.PAYCOMPACTDETAIL_ID_Encrypt = Request["ID"];
return this.Select();
}
//默认返回值工作流组件返回True,功能模块返回False。
return (WorkFlowPage != null);
}
//OnDataAction_XXXXX 有一个系列可用,在此加入界面的逻辑处理
//e.CancelDataAction 来处理是否取消该动作;
//失败的原因可以用Page.Alert()传递到页面
public override void OnDataAction_BeforeSave(DataActionEventArgs<Business.PAYCOMPACTDETAIL> e)
{
e.CurrObject.COMPACT_ID = int.Parse(RetCOMPACT_ID);
base.OnDataAction_BeforeSave(e);
}
#region
protected void ButtonSearch_CallBackClick(object sender, ClientSetEventArgs e)
{
GridViewEx1.Selecting<Business.IMAGE>(ObjectDataSource1, GridPageEx1);
//设置UI变化
e.SetValue(GridViewEx1);
e.SetValue(GridPageEx1);
}
//翻页事件
protected void GridPageEx1_CallBackPageChanged(object src, ClientSetEventArgs e)
{
GridViewEx1.Pagging<Business.IMAGE>(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);
//且搜索条件
//添加合同
e.AddAndParams("COMPACT_ID", RetCOMPACT_ID);
//或搜索条件
//e.AddOrParams(字段名, 值);
//排序
e.AddOrderByParams(GridViewOrderBy1);
}
public override bool Save(bool AutoBindData = true)
{
bool FLAG = base.Save(AutoBindData);
//初始化并加载列表
GridViewEx1.SelectingWithInit<Business.PAYCOMPACTDETAIL>(ObjectDataSource1, GridPageEx1);
//设置回车焦点按钮
Page.SetControlClientAction(ButtonSearch);
this.CurrObject.ResetProperty();
BindObjectToControl();
return FLAG;
}
#endregion
#region ->
protected void SelectButton_CallBackClick(object sender, ClientSetEventArgs e)
{
CallBackButton _button = (CallBackButton)sender;
GridViewRow _Row = (GridViewRow)_button.NamingContainer;
string _PAYCOMPACTDETAIL_ID = GridViewEx1.DataKeys[_Row.RowIndex][0].ToString();
Business.PAYCOMPACTDETAIL _PAYCOMPACTDETAIL = new Business.PAYCOMPACTDETAIL(this.Transaction);
_PAYCOMPACTDETAIL.PAYCOMPACTDETAIL_ID = int.Parse(_PAYCOMPACTDETAIL_ID);
if (_PAYCOMPACTDETAIL.Select())
{
BindObjectToControl(_PAYCOMPACTDETAIL);
e.SetValue<TextBoxEx>(this);
e.SetValue<DropDownListEx>(this);
}
//
}
#endregion
#region ->
protected void DeleteButton_CallBackClick(object sender, ClientSetEventArgs e)
{
CallBackButton _button = (CallBackButton)sender;
GridViewRow _Row = (GridViewRow)_button.NamingContainer;
string _PAYCOMPACTDETAIL_ID = GridViewEx1.DataKeys[_Row.RowIndex][0].ToString();
Business.PAYCOMPACTDETAIL _PAYCOMPACTDETAIL = new Business.PAYCOMPACTDETAIL(this.Transaction);
_PAYCOMPACTDETAIL.Delete(int.Parse(_PAYCOMPACTDETAIL_ID));
//刷新列表
ButtonSearch_CallBackClick(null, e);
}
#endregion
}
}