122 lines
4.5 KiB
C#
122 lines
4.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
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;
|
|
|
|
namespace SuperMap.RealEstate.HighWay.Storage
|
|
{
|
|
public partial class PROINSTCOMPACTPage : SuperMap.RealEstate.Web.UI.Page
|
|
{
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (IsPostBack) return;
|
|
//载入数据
|
|
ButtonDelete.Enabled = PROINSTCOMPACT1.LoadData();
|
|
//设置删除提示
|
|
SetControlConfirm(ButtonDelete, "您确认删除该记录,删除后将无法恢复数据?");
|
|
//设置按钮状态
|
|
SetControlClientAction(ButtonDelete, false, true, true);
|
|
SetControlClientAction(ButtonSave);
|
|
//注册遮罩式窗口关闭脚本
|
|
SetControlClosePopDialog(ButtonClose);
|
|
}
|
|
|
|
protected void ButtonSave_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
//刷新类型
|
|
bool _RefreshType = ButtonDelete.Enabled;
|
|
//保存数据
|
|
ButtonDelete.Enabled = PROINSTCOMPACT1.Save();
|
|
//刷新弹出页列表
|
|
RefreshOpenerGridPage(_RefreshType ? RefreshGridPageType.Update : RefreshGridPageType.Insert);
|
|
//提示信息
|
|
Alert("保存成功!", 3);
|
|
//ClosePopDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//回滚事务
|
|
Transaction.Rollback();
|
|
//记录日志
|
|
ErrorLogHelper.Write(ex);
|
|
#if DEBUG
|
|
Alert("保存失败!可能的原因:\n" + ex.Message);
|
|
#else
|
|
Alert("保存失败!");
|
|
#endif
|
|
}
|
|
}
|
|
|
|
protected void ButtonDelete_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
bool DeleteFlag = false;
|
|
TextBoxEx HIGHWAYPROINST_ID = PROINSTCOMPACT1.FindControl("HIGHWAYPROINST_ID") as TextBoxEx;
|
|
if (!string.IsNullOrEmpty(HIGHWAYPROINST_ID.Text))
|
|
{
|
|
Business.HIGHWAYPROINST _HIGHWAYPROINST = new Business.HIGHWAYPROINST(Transaction);
|
|
_HIGHWAYPROINST.HIGHWAYPROINST_ID_Encrypt = HIGHWAYPROINST_ID.Text.ToEncrypt();
|
|
if (_HIGHWAYPROINST.Select())
|
|
{
|
|
WorkFlow.Instance.Business.ProInst _ProInst = new WorkFlow.Instance.Business.ProInst(Transaction);
|
|
_ProInst.ProInst_ID = _HIGHWAYPROINST.Proinst_ID;
|
|
if (_ProInst.Select())
|
|
{
|
|
_ProInst.ProInst_State = 0;
|
|
_ProInst.Update();
|
|
DeleteFlag = true;
|
|
}
|
|
}
|
|
}
|
|
if (DeleteFlag)
|
|
{
|
|
//删除数据
|
|
//ButtonDelete.Enabled = !PROINSTCOMPACT1.Delete();
|
|
//刷新弹出页列表
|
|
RefreshOpenerGridPage(RefreshGridPageType.Delete);
|
|
//提示信息
|
|
Alert("删除成功!", 3);
|
|
ClosePopDialog();
|
|
}
|
|
else
|
|
{
|
|
Alert("删除失败,未找到对应的流程信息!");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//回滚事务
|
|
Transaction.Rollback();
|
|
//记录日志
|
|
ErrorLogHelper.Write(ex);
|
|
#if DEBUG
|
|
Alert("删除失败!可能的原因:\n" + ex.Message);
|
|
#else
|
|
Alert("删除失败!");
|
|
#endif
|
|
}
|
|
}
|
|
|
|
protected void ButtonFile_CallBackClick(object sender, ClientSetEventArgs e)
|
|
{
|
|
e.ClientScript = this.GetOpenPopDialogClientScript("uploadData/Default.aspx?PRODEF_ID=" +
|
|
PROINSTCOMPACT1._HighWayProInst.ProInst.ProDef_ID.ToEncrypt() + "&HIGHWAYPROINST_ID=" +
|
|
PROINSTCOMPACT1._HighWayProInst.HIGHWAYPROINST_ID_Encrypt + "&PRODEF_NAME=" +
|
|
PROINSTCOMPACT1._HighWayProInst.ProInst.ProDef_Name.ToEncrypt(), "Default",
|
|
800, 500, true, false, true);
|
|
}
|
|
}
|
|
}
|