127 lines
4.2 KiB
C#
127 lines
4.2 KiB
C#
using System;
|
||
using System.Web.UI;
|
||
using System.Web.UI.WebControls;
|
||
using SuperMap.RealEstate.CoreFrameWork;
|
||
using SuperMap.RealEstate.Web.UI;
|
||
using SuperMap.RealEstate.Web.UI.WebControls;
|
||
using Business = SuperMap.RealEstate.HighWay.Storage.Business;
|
||
|
||
namespace SuperMap.RealEstate.HighWay.Modules.ProblemDeal
|
||
{
|
||
public partial class IMAGE : UserControl<Business.IMAGE>
|
||
{
|
||
protected void Page_Load(object sender, EventArgs e)
|
||
{
|
||
if (IsPostBack) return;
|
||
|
||
BindTreeView();
|
||
}
|
||
|
||
//在此加入界面的数据初始化(Page_Load之前),如DropDownList的数据源绑定等
|
||
public override void InitializeWebControl()
|
||
{
|
||
//是否有效
|
||
ISVALID.Clear();
|
||
DictionaryHelper.BindingDropDownList("ISVALID", ISVALID.Items, this.Transaction);
|
||
}
|
||
|
||
#region BindTreeView()
|
||
public void BindTreeView()
|
||
{
|
||
MyTreeView.Nodes.Clear();
|
||
string PartString = string.Empty;
|
||
string ProwerString = string.Empty;
|
||
int i = 0;
|
||
if (!string.IsNullOrEmpty(Request["ENDACCOUNT_ID"]))
|
||
{
|
||
//获得图片信息
|
||
foreach (Storage.Business.IMAGE _IMAGE in (new Storage.Business.IMAGE(this.Transaction)).FillCollection(
|
||
"WHERE TABLE_NAME = 'HIGHWAY_SELLDATA.T_ENDACCOUNT' AND TABLE_ID = " + Request["ENDACCOUNT_ID"].ToDecrypt()))
|
||
{
|
||
TreeNode _TreeNode = new TreeNode();
|
||
i++;
|
||
_TreeNode.NavigateUrl = null;
|
||
_TreeNode.Text = "[" + i.ToString() + "] " + _IMAGE.IMAGE_TITLE;
|
||
_TreeNode.Value = _IMAGE.Image_ID_Encrypt;
|
||
MyTreeView.Nodes.Add(_TreeNode);
|
||
}
|
||
}
|
||
|
||
MyTreeView.ExpandAll();
|
||
}
|
||
#endregion
|
||
|
||
//载入数据
|
||
public override bool LoadData()
|
||
{
|
||
//如果是工作流组件请自行修改载入的逻辑,以下是功能模块的默认代码
|
||
if (!String.IsNullOrEmpty(Request["ID"]))
|
||
{
|
||
CurrObject.Image_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.IMAGE> e)
|
||
{
|
||
|
||
|
||
base.OnDataAction_BeforeSave(e);
|
||
}
|
||
|
||
public override void OnDataAction_AfterSave(DataActionEventArgs<Business.IMAGE> e)
|
||
{
|
||
//绑定列表
|
||
base.OnDataAction_AfterSave(e);
|
||
BindTreeView();
|
||
}
|
||
|
||
public override bool Save(bool AutoBindData = true)
|
||
{
|
||
//判断是否有
|
||
bool FLAG = base.Save(AutoBindData);
|
||
|
||
Image_ID.Text = "";
|
||
|
||
return FLAG;
|
||
}
|
||
|
||
public override bool SaveEx(ClientSetEventArgs ClientSet)
|
||
{
|
||
return base.SaveEx(ClientSet);
|
||
}
|
||
|
||
public override bool Delete(bool AutoBindData = true)
|
||
{
|
||
bool Flag = base.Delete(AutoBindData);
|
||
BindTreeView();
|
||
return Flag;
|
||
}
|
||
|
||
protected void BtnAdd_Click(object sender, EventArgs e)
|
||
{
|
||
Image_ID.Text = "";
|
||
//IMAGE_DESC.Text = "";
|
||
if (!string.IsNullOrEmpty(Request["ENDACCOUNT_ID"]))
|
||
{
|
||
Table_Name.Text = "HIGHWAY_SELLDATA.T_ENDACCOUNT";
|
||
Table_ID.Text = Request["ENDACCOUNT_ID"].ToDecrypt();
|
||
}
|
||
|
||
rotImg.Src = "";
|
||
}
|
||
|
||
protected void MyTreeView_SelectedNodeChanged(object sender, EventArgs e)
|
||
{
|
||
TreeView _TreeView = (TreeView)sender;
|
||
CurrObject.Image_ID_Encrypt = _TreeView.SelectedNode.Value;
|
||
this.Select();
|
||
Page.ExecClientScript("BindImg()");
|
||
}
|
||
}
|
||
} |