157 lines
7.9 KiB
C#
157 lines
7.9 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 SERVERPARTPage : SuperMap.RealEstate.Web.UI.Page
|
|
{
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (IsPostBack) return;
|
|
|
|
//载入数据
|
|
ButtonDelete.Enabled = SERVERPART1.LoadData();
|
|
if (SERVERPART1.CurrObject.SERVERPART_ID == null)
|
|
{
|
|
ButtonAdditManagerInfo.Visible = false;
|
|
ButtonServerPartShop.Visible = false;
|
|
ButtonAddServerPartPos.Visible = false;
|
|
ButtonOnSellCommodity.Visible = false;
|
|
ButtonCashWorker.Visible = false;
|
|
ButtonAsset.Visible = false;
|
|
ButtonPic.Visible = false;
|
|
}
|
|
else
|
|
{
|
|
ButtonAdditManagerInfo.OnClientClick = this.GetOpenPopDialogClientScript(
|
|
"ServerPartManager/SERVERPARTMANAGERList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTMANAGERList", 1000, 1000);
|
|
//添加门店
|
|
ButtonServerPartShop.OnClientClick = this.GetOpenPopDialogClientScript("ServerPartShop/SERVERPARTSHOPList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTWORKERList", 1600, 1000);
|
|
//服务区收银机信息
|
|
ButtonAddServerPartPos.OnClientClick = this.GetOpenPopDialogClientScript("ServerPartPos/SERVERPARTPOSList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTPOSList", 1000, 1000);
|
|
//在售商品情况
|
|
ButtonOnSellCommodity.OnClientClick = this.GetOpenPopDialogClientScript("OnSellCommodity/COMMODITYList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTPOSList", 1000, 1000);
|
|
//收银员管理
|
|
ButtonCashWorker.OnClientClick = this.GetOpenPopDialogClientScript("CashWorker/CASHWORKERList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTPOSList", 1000, 1000);
|
|
//服务区资产信息
|
|
ButtonAsset.OnClientClick = this.GetOpenPopDialogClientScript("Material/MATERIALList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTPOSList", 1000, 1000);
|
|
//服务区图片信息
|
|
ButtonPic.OnClientClick = this.GetOpenPopDialogClientScript("ImageManager/IMAGEPage.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "IMAGEPage", 1000, 1000);
|
|
}
|
|
//设置删除提示
|
|
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 = SERVERPART1.Save();
|
|
ButtonAdditManagerInfo.Visible = true;
|
|
ButtonServerPartShop.Visible = true;
|
|
ButtonAddServerPartPos.Visible = true;
|
|
ButtonOnSellCommodity.Visible = true;
|
|
ButtonCashWorker.Visible = true;
|
|
ButtonAsset.Visible = true;
|
|
ButtonPic.Visible = true;
|
|
ButtonAdditManagerInfo.OnClientClick = this.GetOpenPopDialogClientScript(
|
|
"ServerPartManager/SERVERPARTMANAGERList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTMANAGERList", 1000, 1000);
|
|
//添加门店
|
|
ButtonServerPartShop.OnClientClick = this.GetOpenPopDialogClientScript("ServerPartShop/SERVERPARTSHOPList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTWORKERList", 1600, 1000);
|
|
//服务区收银机信息
|
|
ButtonAddServerPartPos.OnClientClick = this.GetOpenPopDialogClientScript("ServerPartPos/SERVERPARTPOSList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTPOSList", 1000, 1000);
|
|
//在售商品情况
|
|
ButtonOnSellCommodity.OnClientClick = this.GetOpenPopDialogClientScript("OnSellCommodity/COMMODITYList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTPOSList", 1000, 1000);
|
|
//收银员管理
|
|
ButtonCashWorker.OnClientClick = this.GetOpenPopDialogClientScript("CashWorker/CASHWORKERList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTPOSList", 1000, 1000);
|
|
//服务区资产信息
|
|
ButtonAsset.OnClientClick = this.GetOpenPopDialogClientScript("Material/MATERIALList.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "SERVERPARTPOSList", 1000, 1000);
|
|
//服务区图片信息
|
|
ButtonPic.OnClientClick = this.GetOpenPopDialogClientScript("ImageManager/IMAGEPage.aspx?SERVERPART_ID=" +
|
|
SERVERPART1.CurrObject.SERVERPART_ID_Encrypt, "IMAGEPage", 1000, 1000);
|
|
//更新日志表信息
|
|
ExchangeData.Business.DOWNLOADUPDATE.UpdateDataVersion(Transaction, SERVERPART1.CurrObject.SERVERPART_CODE, "T_SERVERPART", DateTime.Now);
|
|
//刷新弹出页列表
|
|
RefreshOpenerGridPage(_RefreshType ? RefreshGridPageType.Update : RefreshGridPageType.Insert);
|
|
//提示信息
|
|
base.Redirect("parent.ObjectTreeView", "ServerPartTreeView.aspx?Type=ServerPart&ID=" +
|
|
this.SERVERPART1.CurrObject.SERVERPART_ID_Encrypt + "#selectNode", true, "");
|
|
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
|
|
{
|
|
//删除数据
|
|
ButtonDelete.Enabled = !SERVERPART1.Delete();
|
|
//刷新弹出页列表
|
|
RefreshOpenerGridPage(RefreshGridPageType.Delete);
|
|
//提示信息
|
|
base.Redirect("parent.ObjectTreeView", "ServerPartTreeView.aspx?Type=ServerPart&ID=" +
|
|
this.SERVERPART1.CurrObject.SERVERPART_ID_Encrypt + "#selectNode", true, "");
|
|
Alert("删除成功!", 3);
|
|
//ClosePopDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
//回滚事务
|
|
Transaction.Rollback();
|
|
//记录日志
|
|
ErrorLogHelper.Write(ex);
|
|
#if DEBUG
|
|
Alert("删除失败!可能的原因:\n" + ex.Message);
|
|
#else
|
|
Alert("删除失败!");
|
|
#endif
|
|
}
|
|
}
|
|
}
|
|
}
|