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

100 lines
3.0 KiB
C#

using System;
using System.Data;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.Generic;
using SuperMap.RealEstate.CoreFrameWork;
using SuperMap.RealEstate.ServiceModel;
using System.Windows.Forms;
using SuperMap.RealEstate.Web.UI.WebControls;
namespace SuperMap.RealEstate.HighWay.Running.View
{
[ToolboxItem(true)]
/// <summary>
/// T_MODIFYFROMSTORAGE_正式库修改表 的Window UserControl
/// <summary>
public partial class MODIFYFROMSTORAGEControl : Design.MODIFYFROMSTORAGEDesign
{
public MODIFYFROMSTORAGEControl()
{
InitializeComponent();
this.UserControlObject = this.flowLayoutPanel1;
}
protected override void OnLoad(EventArgs e)
{
if (DesignMode)
return;
List<ListItemEx> ListItemCollection = new List<ListItemEx>();
}
public override bool LoadData(string ID_Encrypt)
{
bool LoadFlag = false;
if (!string.IsNullOrEmpty(ID_Encrypt))
{
//this.CurrObject.House_ID_Encrypt = ID_Encrypt;
LoadFlag = this.Select();
}
return LoadFlag;
}
private void Btn_Save_Click(object sender, EventArgs e)
{
try
{
if (!this.IsValidate())
return;
this.Transaction = new ServiceModel.Transaction();
if (this.Save())
{
this.Transaction.AutoCommit();
ShowInformation("保存成功!", MessageBoxButtons.OK);
}
else
ShowWarning("保存失败!");
}
catch (Exception ex)
{
if (this.Transaction != null)
{
if (this.Transaction.IsOpen)
this.Transaction.Rollback();
}
ShowError(ex.Message);
}
}
private void Btn_Delete_Click(object sender, EventArgs e)
{
try
{
if (!this.IsValidate())
return;
if (ShowInformation("是否删除!", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
this.Transaction = new ServiceModel.Transaction();
if (this.Delete())
{
this.Transaction.AutoCommit();
ShowInformation("删除成功!", MessageBoxButtons.OK);
}
else
ShowWarning("删除失败!");
}
}
catch (Exception ex)
{
if (this.Transaction != null)
{
if (this.Transaction.IsOpen)
this.Transaction.Rollback();
}
ShowError(ex.Message);
}
}
}
}