/******************************************************************************* * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential * 类的信息: * 1.程序名称:F_PC_0501.cs * 2.功能描述:成型线变产履历 * 编辑履历: * 作者 日期 版本 修改内容 * 庄天威 2014/09/28 1.00 新建 *******************************************************************************/ using System; using System.Collections.Generic; using System.Data; using System.Windows.Forms; using Dongke.IBOSS.PRD.Basics.BaseResources; using Dongke.IBOSS.PRD.Basics.DockPanel; using Dongke.IBOSS.PRD.Client.CommonModule; using Dongke.IBOSS.PRD.WCF.DataModels; using Dongke.IBOSS.PRD.WCF.Proxys; using Dongke.IBOSS.PRD.WCF.Proxys.PCModuleService; namespace Dongke.IBOSS.PRD.Client.PCModule { public partial class F_PC_0501 : DockPanelBase { #region 成员变量 private static F_PC_0501 _instance; public GetLineChangeEntity _glcEntity; #endregion #region 构造函数 public F_PC_0501() { InitializeComponent(); } #endregion #region 单例模式 /// /// 单例模式,防止重复创建窗体 /// public static F_PC_0501 Instance { get { if (_instance == null) { _instance = new F_PC_0501(); } return _instance; } } #endregion #region 事件处理 private void F_PC_0501_Load(object sender, EventArgs e) { this.Text = FormTitles.F_PC_0501; } private void btnSearch_Click(object sender, EventArgs e) { try { this.BindEntity(); DataSet dsSourse = (DataSet)DoAsync(this.GetGridInfo); if (dsSourse != null) { if (dsSourse.Tables.Count != Constant.INT_IS_ZERO) { this.dgvChangeInfo.DataSource = dsSourse.Tables[0]; this.dgvChangeInfo.ReadOnly = true; if (this.dgvChangeInfo.Rows.Count == Constant.INT_IS_ZERO) { // 提示未查找到数据 MessageBox.Show(Messages.MSG_CMN_I002, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } else { // 提示未查找到数据 MessageBox.Show(Messages.MSG_CMN_I002, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch(Exception ex) { // 对异常进行共通处理 ExceptionManager.HandleEventException(this.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex); } } private void btnClearCondition_Click(object sender, EventArgs e) { this.txtBuildingNo.Text = ""; this.txtFloorNo.Text = ""; this.txtGroutingLineNo.Text = ""; this.txtGroutingLineCode.Text = ""; this.txtGoodsCodeB.Text = ""; this.txtGoodsCodeA.Text = ""; this.cblStartTime.Checked = false; this.cblEndTime.Checked = false; } private void tsbtnAdaptive_Click(object sender, EventArgs e) { this.dgvChangeInfo.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); } private void tsbtnClose_Click(object sender, EventArgs e) { this.Close(); } private void cblStartTime_CheckedChanged(object sender, EventArgs e) { this.dtpStartTime.Enabled = this.cblStartTime.Checked; } private void cblEndTime_CheckedChanged(object sender, EventArgs e) { this.cblEndTime.Enabled = this.cblEndTime.Checked; } #endregion private void F_PC_0501_FormClosed(object sender, FormClosedEventArgs e) { _instance = null; } #region 私有方法 private void BindEntity() { _glcEntity = new GetLineChangeEntity(); this.dgvChangeInfo.AutoGenerateColumns = false; _glcEntity.BuildingNo = this.txtBuildingNo.Text.Trim(); _glcEntity.FloorNo = this.txtFloorNo.Text.Trim(); _glcEntity.GroutingLineNo = this.txtGroutingLineNo.Text.Trim(); _glcEntity.GroutingLineCode = this.txtGroutingLineCode.Text.Trim(); _glcEntity.GoodsCodeB = this.txtGoodsCodeB.Text.Trim(); _glcEntity.GoodSCodeA = this.txtGoodsCodeA.Text.Trim(); if (this.cblStartTime.Checked) { _glcEntity.BeginDate = this.dtpStartTime.Value.Date; } if (this.cblEndTime.Checked) { _glcEntity.EndDate = this.dtpEndTime.Value.Date; } } private DataSet GetGridInfo() { return PCModuleProxy.Service.GetLineChange(this._glcEntity); } #endregion } }