106 lines
4.0 KiB
C#
106 lines
4.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
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 Business = SuperMap.RealEstate.HighWay.Storage.Business;
|
|
|
|
namespace SuperMap.RealEstate.HighWay.CloudModule.Commodity
|
|
{
|
|
public partial class HighWayProinstPage : BasePage
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (IsPostBack) return;
|
|
|
|
//载入数据
|
|
ButtonDelete.Enabled = HighWayProinst1.LoadData();
|
|
//设置删除提示
|
|
SetControlConfirm(ButtonDelete, "您确认删除该记录,删除后将无法恢复数据?");
|
|
//设置按钮状态
|
|
if (HighWayProinst1.CurrObject.HIGHWAYPROINST_NEXTID == 9000)
|
|
{
|
|
ButtonSave.Visible = false;
|
|
ButtonDelete.Visible = false;
|
|
}
|
|
SetControlClientAction(ButtonDelete, false, true, true);
|
|
SetControlClientAction(ButtonSave);
|
|
//注册遮罩式窗口关闭脚本
|
|
SetControlClosePopDialog(ButtonClose);
|
|
}
|
|
|
|
#region ButtonSave_Click
|
|
protected void ButtonSave_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
//刷新类型
|
|
bool _RefreshType = ButtonDelete.Enabled;
|
|
//保存数据
|
|
ButtonDelete.Enabled = HighWayProinst1.Save();
|
|
//刷新弹出页列表
|
|
RefreshOpenerGridPage(_RefreshType ? RefreshGridPageType.Update : RefreshGridPageType.Insert);
|
|
HighWayProinst1.FindControl("CommodityList").Visible = true;
|
|
(HighWayProinst1.FindControl("BtnAdd") as Button).OnClientClick = GetOpenPopDialogClientScript(
|
|
"MessageSend.aspx?ID=" + HighWayProinst1.CurrObject.HIGHWAYPROINST_ID_Encrypt, "MessageSend", 1200, 700);
|
|
GridViewEx _GridViewEx = HighWayProinst1.FindControl("GridViewEx1") as GridViewEx;
|
|
ObjectDataSource _ObjectDataSource = HighWayProinst1.FindControl("ObjectDataSource1") as ObjectDataSource;
|
|
GridPageEx _GridPageEx = HighWayProinst1.FindControl("GridPageEx1") as GridPageEx;
|
|
_GridViewEx.SelectingWithInit<Business.MODIFYFROMSTORAGE>(_ObjectDataSource, _GridPageEx,
|
|
DictionaryHelper.GetDictionary(Transaction, "BUSINESSTYPE"),
|
|
DictionaryHelper.GetDictionary(Transaction, "COMMODITYGRADE").AsNewKeys("COMMODITY_GRADE"));
|
|
//提示信息
|
|
Alert("保存成功!", 3);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//回滚事务
|
|
Transaction.Rollback();
|
|
//记录日志
|
|
ErrorLogHelper.Write(ex);
|
|
#if DEBUG
|
|
Alert("保存失败!可能的原因:\n" + ex.Message);
|
|
#else
|
|
Alert("保存失败!");
|
|
#endif
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region ButtonDelete_Click
|
|
protected void ButtonDelete_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
//删除数据
|
|
ButtonDelete.Enabled = !HighWayProinst1.Delete();
|
|
//刷新弹出页列表
|
|
RefreshOpenerGridPage(RefreshGridPageType.Delete);
|
|
//提示信息
|
|
Alert("删除成功!", 3);
|
|
ClosePopDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//回滚事务
|
|
Transaction.Rollback();
|
|
//记录日志
|
|
ErrorLogHelper.Write(ex);
|
|
#if DEBUG
|
|
Alert("删除失败!可能的原因:\n" + ex.Message);
|
|
#else
|
|
Alert("删除失败!");
|
|
#endif
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
} |