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

93 lines
3.5 KiB
C#
Raw Permalink 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.IO;
using System.Data;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
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 SellerBusiness = SuperMap.RealEstate.Seller.Storage.Business;
namespace SuperMap.RealEstate.HighWay.CloudModule.Commodity
{
public partial class IMAGE : UserControl<SellerBusiness.IMAGE>
{
protected string _SELLER_IP = ConfigurationManager.AppSettings["Seller_ServicePoint"].ToString().Split('|')[1];
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;
//获得图片信息
foreach (SellerBusiness.IMAGE _IMAGE in (new SellerBusiness.IMAGE(this.Transaction)).FillCollection(
"where TABLE_NAME = 'T_SELLERCOMMODITY' AND TABLE_ID = " + Request["SELLERCOMMODITY_ID"].ToDecrypt() +
" ORDER BY IMAGE_ID"))
{
i++;
TreeNode _TreeNode = new TreeNode();
_TreeNode.NavigateUrl = null;
_TreeNode.Text = "[" + i.ToString() + "]&nbsp;&nbsp;" + _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<SellerBusiness.IMAGE> e)
{
base.OnDataAction_BeforeSave(e);
}
protected void MyTreeView_SelectedNodeChanged(object sender, EventArgs e)
{
TreeView _TreeView = (TreeView)sender;
//CurrObject.IMAGE_ID_Encrypt = _TreeView.SelectedNode.Value;
//this.Select();
foreach (SellerBusiness.IMAGE _IMAGE in (new SellerBusiness.IMAGE(this.Transaction)).FillCollection(
"where IMAGE_ID = " + _TreeView.SelectedNode.Value.ToDecrypt()))
{
IMAGE_PATH.Text = _SELLER_IP + _IMAGE.IMAGE_PATH;
Page.ExecClientScript("BindImg()");
}
}
}
}