| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- /*******************************************************************************
- * 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 单例模式
- /// <summary>
- /// 单例模式,防止重复创建窗体
- /// </summary>
- 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
- }
- }
|