using System;
using System.Windows.Forms;
using QMAPP.Entity;
using QMAPP.FJC.Entity;
using QMAPP.FJC.Entity.Basic;
using QMAPP.FJC.Entity.Equipment;
using QMAPP.FJC.Entity.ODS;
using QMAPP.ServicesAgent;
using QMAPP.WinForm.Common;
namespace QMAPP.WinForm.Forms.ODS
{
///
/// 模块编号:M11-3
/// 作 用:设备停机维护
/// 作 者:王庆男
/// 编写日期:2015年06月01日
///
public partial class VideoTypeEditForm : Form
{
VideoTypeEntity recorder = new VideoTypeEntity();
///
/// 新建 t
///
public VideoTypeEditForm()
{
InitializeComponent();
}
///
/// 编辑
///
///
public VideoTypeEditForm(string pid)
{
recorder.PID = pid;
//recorder.VideoType = videoType;
InitializeComponent();
}
///
/// 窗体加载
///
///
///
private void Form_Load(object sender, EventArgs e)
{
#region 绑定下拉列表
//BasicData basicData = new BasicData();
////加载设备下拉列表
//this.comMachineCode.DataSource = basicData.GetMachineInfoList(new string[]{}, true);
//this.comMachineCode.DisplayMember = "MACHINENAME";
//this.comMachineCode.ValueMember = "MACHINECODDE";
#endregion
//if (ClientContext.MachineInfo != null)
// this.comMachineCode.SelectedValue = ClientContext.MachineInfo.MACHINECODDE;
#region 编辑
//判断是否为编辑加载编辑数据
if (!string.IsNullOrEmpty(recorder.PID))
{
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
recorder = agent.InvokeServiceFunction("VideoTypeBLL_Get", recorder);
this.txtType.Text = recorder.VideoType;
}
#endregion
}
///
/// 窗体保存事件
///
///
///
private void tsbSave_Click(object sender, EventArgs e)
{
#region 绑定保存信息
recorder.VideoType = this.txtType.Text;
#endregion
#region 保存
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
DataResult result;//判断是否成功
if (string.IsNullOrEmpty(recorder.PID))
{
result = agent.InvokeServiceFunction>("VideoTypeBLL_Insert", recorder);
}
else
{
result = agent.InvokeServiceFunction>("VideoTypeBLL_Update", recorder);
}
//保存成功
MessageBox.Show(result.Msg);
if (result.IsSuccess)
{
this.DialogResult = System.Windows.Forms.DialogResult.OK;
this.Close();
}
#endregion
}
///
/// 窗体关闭
///
///
///
private void tsbClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}