| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PC_0101_1_7.cs
- * 2.功能描述:操作时间及备注录入
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 王鑫 2015/09/25 1.00 新建
- *******************************************************************************/
- using System;
- using System.Windows.Forms;
- using System.Data;
- using Dongke.IBOSS.PRD.Basics.BaseControls;
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- namespace Dongke.IBOSS.PRD.Client.PCModule
- {
- public partial class F_PC_0101_1_7 : FormBase
- {
- #region 成员变量
- // 窗体标题
- private string _titleStr = "";
- private DataTable _dtBindSource = null;
- private string _S_PC_001 = "";
- private int _gridIndex = -1;
- private DataRowView _currentRow = null;
- #endregion
- #region 构造函数
- /// <summary>
- ///
- /// </summary>
- /// <param name="dtBindSource"></param>
- /// <param name="titleStr"></param>
- public F_PC_0101_1_7()
- {
- InitializeComponent();
- }
- #endregion
- #region 属性
- public DataTable SelData { set; get; }
- #endregion
- #region 事件
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PC_0101_1_2_Load(object sender, EventArgs e)
- {
- try
- {
- DataTable dt = new DataTable();
- dt.Columns.Add("TestMouldFlag");
- dt.Columns.Add("TestMouldFlagName");
- dt.Rows.Add("0", "正常");
- dt.Rows.Add("1", "试验");
- cmbTestMouldFlag.ValueMember = "TestMouldFlag";
- cmbTestMouldFlag.DisplayMember = "TestMouldFlagName";
- cmbTestMouldFlag.DataSource = dt;
- cmbTestMouldFlag.SelectedValue = SelData.Rows[0]["TestMouldFlag"];
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 保存按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSave_Click(object sender, EventArgs e)
- {
- try
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_PC_0101_1_7";
- cre.Name = "SaveTestMouldFlag";
- cre.Properties["TestMouldFlag"] = cmbTestMouldFlag.SelectedValue;
- string mouldIDs = ",";
- foreach (DataRow row in SelData.Rows)
- {
- mouldIDs += row["MouldID"] + ",";
- }
- cre.Properties["MouldIDs"] = mouldIDs;
- ServiceResultEntity sre = (ServiceResultEntity)DoAsync(() =>
- {
- return PCModuleProxyNew.Service.HandleRequest(cre);
- });
- if (sre.OtherStatus > 0)
- {
- MessageBox.Show(this.Text + "成功", this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.DialogResult = DialogResult.OK;
- }
- else if (sre.OtherStatus < 0 && !string.IsNullOrEmpty(sre.Message))
- {
- MessageBox.Show(this.Text + "失败,原因:" + sre.Message, this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- else
- {
- MessageBox.Show(this.Text + "失败", this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Warning);
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 取消按钮事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnCancel_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- #endregion
- }
- }
|