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 MediaPlayerEditForm : Form { VideoInfo recorder = new VideoInfo(); private int isUpdate = 0; /// /// 新建 t /// public MediaPlayerEditForm() { InitializeComponent(); } /// /// 编辑 /// /// public MediaPlayerEditForm(string pid) { recorder.PID = pid; isUpdate = 1; InitializeComponent(); } /// /// 窗体加载 /// /// /// private void Form_Load(object sender, EventArgs e) { #region 绑定下拉列表 BasicData basicData = new BasicData(); //加载下拉列表 this.comType.DataSource = basicData.GetVideoInfoList(); this.comType.DisplayMember = "VideoType"; this.comType.ValueMember = "VideoType"; #endregion #region 编辑 //判断是否为编辑加载编辑数据 if (!string.IsNullOrEmpty(recorder.PID)) { QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent(); recorder = agent.InvokeServiceFunction("VideoInfoBLL_Get", recorder); txtName.Text = recorder.VideoName; txtUrl.Text = recorder.VideoUrl; comType.Text = recorder.VideoType; } #endregion } /// /// 窗体保存事件 /// /// /// private void tsbSave_Click(object sender, EventArgs e) { #region 绑定保存信息 recorder.VideoName = this.txtName.Text; recorder.VideoUrl = this.txtUrl.Text; recorder.VideoType = this.comType.Text; #endregion #region 保存 QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent(); DataResult result = agent.InvokeServiceFunction>(string.IsNullOrEmpty(recorder.PID) ? "VideoInfoBLL_Insert" : "VideoInfoBLL_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(); } } }