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

150 lines
5.0 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 SuperMap.RealEstate.Web.UI;
using SuperMap.RealEstate.ServiceModel;
using SuperMap.RealEstate.CoreFrameWork;
using WorkFlowBusiness = SuperMap.RealEstate.WorkFlow.Instance.Business;
using SuperMap.RealEstate.WorkFlow.Support.Business;
namespace SuperMap.RealEstate.HighWay.Compents.ApproveTender
{
/// T_Approved 的WebUserControl
public partial class Approved : UserControl<Running.Business.APPROVED>
{
Running.Business.HIGHWAYPROINST _HighWayProInst = null;
private short _Approved_Type;
public short Approved_Type
{
get
{
return _Approved_Type;
}
set
{
_Approved_Type = value;
}
}
public void Approved_Staff_Enabled()
{
Approved_Staff.Enabled = true;
Approved_Date.Enabled = true;
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
_HighWayProInst = Running.Business.HIGHWAYPROINST.CreateInstance(Page);
}
protected void Page_Load(object sender, EventArgs e)
{
if (Approved_ID.Text == "")
Approved_Date.Text = DateTime.Now.ToString("yyyy-MM-dd");
}
//在此加入界面的数据初始化(Page_Load之前)如DropDownList的数据源绑定等
public override void InitializeWebControl()
{
//Approved_Type.Items.Clear();
//DictionaryHelper.BindingDropDownList("Approved_Type", Approved_Type.Items, this.Transaction);
//Business.ApprovedType _ApprovedType = new Business.ApprovedType(Transaction);
//_ApprovedType.BindingDropDownList(ApprovedType_ID.Items, string.Empty);
}
public override bool LoadData()
{
if (Approved_Staff.Enabled == false)
{
Approved_Staff.Text = Page.PassportInfo.Name;
}
else
{
Approved_Date.AllowEmpty = false;
Approved_Staff.AllowEmpty = false;
Approved_Date.Text = DateTime.Now.ToString("yyyy-MM-dd");
}
if (_HighWayProInst.ProInst.Operation_Type_BaseValue >= 300000 &&
_HighWayProInst.ProInst.Operation_Type_BaseValue < 400000)
{
Approved_Info.Text = "同意";
}
this.CurrObject.AddSearchParameter("HIGHWAYPROINST_ID", _HighWayProInst.HIGHWAYPROINST_ID);
this.CurrObject.AddSearchParameter("Approved_Type", Approved_Type);
if (this.CurrObject.Search())
{
this.BindObjectToControl();
}
return true;
}
public override bool LoadDataEx(Web.UI.WebControls.ClientSetEventArgs ClientSet)
{
return base.LoadDataEx(ClientSet);
}
//public override bool Save(bool AutoBindData = true)
//{
// //if (Approved_ID.Text == "")
// //{
// // string textApprovedContent = Approved_Info.Text;
// // this.CurrObject.AddSearchParameter("PropertyProinst_ID", _ProInst.PropertyProinst_ID);
// // this.CurrObject.AddSearchParameter("Approved_Type", Approved_Type);
// // if (this.CurrObject.Search())
// // {
// // this.BindObjectToControl();
// // }
// // Approved_Info.Text = textApprovedContent;
// //}
// bool _bool=base.Save(AutoBindData);
// if(_bool)
// {
// }
// return _bool;
//}
public override bool SaveEx(Web.UI.WebControls.ClientSetEventArgs ClientSet)
{
Common.PageHelper.ReLoadExCompacts(_HighWayProInst, ClientSet, WorkFlowPage);
return base.SaveEx(ClientSet);
}
//OnDataAction_XXXXX 有一个系列可用,在此加入界面的逻辑处理
//e.CancelDataAction 来处理是否取消该动作;
//失败的原因可以用Page.Alert()传递到页面
public override void OnDataAction_BeforeSave(DataActionEventArgs<Running.Business.APPROVED> e)
{
e.CurrObject.HIGHWAYPROINST_ID = int.Parse(_HighWayProInst.HIGHWAYPROINST_ID.Value.ToString());
e.CurrObject.Approved_Type = Approved_Type;
if (Approved_Staff.Enabled == false)
{
e.CurrObject.Approved_Date = DateTime.Now;
e.CurrObject.Approved_Staff = Page.PassportInfo.Name;
e.CurrObject.Approved_Name = ((UserControl)(this.Parent)).TitleText;
}
base.OnDataAction_BeforeSave(e);
}
public override void OnDataAction_AfterSave(DataActionEventArgs<Running.Business.APPROVED> e)
{
base.OnDataAction_AfterSave(e);
}
public override void OnDataAction_BeforeSelect(DataActionEventArgs<Running.Business.APPROVED> e)
{
base.OnDataAction_BeforeSelect(e);
}
}
}