You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
118 lines
3.5 KiB
118 lines
3.5 KiB
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
|
|
{
|
|
/// <summary>
|
|
/// 模块编号:M11-3
|
|
/// 作 用:设备停机维护
|
|
/// 作 者:王庆男
|
|
/// 编写日期:2015年06月01日
|
|
///</summary>
|
|
public partial class VideoTypeEditForm : Form
|
|
{
|
|
VideoTypeEntity recorder = new VideoTypeEntity();
|
|
|
|
/// <summary>
|
|
/// 新建 t
|
|
/// </summary>
|
|
public VideoTypeEditForm()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 编辑
|
|
/// </summary>
|
|
/// <param name="pid"></param>
|
|
public VideoTypeEditForm(string pid)
|
|
{
|
|
recorder.PID = pid;
|
|
//recorder.VideoType = videoType;
|
|
InitializeComponent();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 窗体加载
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
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<VideoTypeEntity>("VideoTypeBLL_Get", recorder);
|
|
|
|
this.txtType.Text = recorder.VideoType;
|
|
|
|
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
/// <summary>
|
|
/// 窗体保存事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void tsbSave_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
#region 绑定保存信息
|
|
|
|
recorder.VideoType = this.txtType.Text;
|
|
#endregion
|
|
|
|
#region 保存
|
|
QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
|
|
DataResult<int> result;//判断是否成功
|
|
if (string.IsNullOrEmpty(recorder.PID))
|
|
{
|
|
result = agent.InvokeServiceFunction<DataResult<int>>("VideoTypeBLL_Insert", recorder);
|
|
}
|
|
else
|
|
{
|
|
result = agent.InvokeServiceFunction<DataResult<int>>("VideoTypeBLL_Update", recorder);
|
|
}
|
|
//保存成功
|
|
MessageBox.Show(result.Msg);
|
|
if (result.IsSuccess)
|
|
{
|
|
this.DialogResult = System.Windows.Forms.DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
/// <summary>
|
|
/// 窗体关闭
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void tsbClose_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|