| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PM_3101.cs
- * 2.功能描述:品保抽查
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 陈晓野 2019/05/10 1.00 新建
- *******************************************************************************/
- using System;
- 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;
- namespace Dongke.IBOSS.PRD.Client.PMModule
- {
- /// <summary>
- /// 品保抽查
- /// </summary>
- public partial class F_PM_3101 : DockPanelBase
- {
- #region 成员变量
- private static F_PM_3101 _instance; //单例模式
- #endregion
- #region 构造函数
- /// <summary>
- /// 废弃一览构造
- /// </summary>
- private F_PM_3101()
- {
- InitializeComponent();
- this.Text = "品保抽查";
- this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
- this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
- this.tsbtnSuspend.Text = "抽查(&S)";
- this.cbSelectTime.Checked = true;
- this.txtDateStart.Value = DateTime.Now.Date;
- this.txtDateEnd.Value = DateTime.Now.Date.AddDays(1).AddMinutes(-1);
- }
- #endregion
- #region 单例模式
- /// <summary>
- /// 单例模式,防止重复创建窗体
- /// </summary>
- public static F_PM_3101 Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new F_PM_3101();
- }
- return _instance;
- }
- }
- #endregion
- #region 事件
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PM_3101_Load(object sender, EventArgs e)
- {
- try
- {
- this.dgvScrapProduct.AutoGenerateColumns = false;
- // 加载权限
- //FormPermissionManager.FormPermissionControl(this.Name, this,
- // Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
- // Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
- }
- 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 btnSearch_Click(object sender, EventArgs e)
- {
- try
- {
- DataSet dsScrapProduct = (DataSet)DoAsync(new AsyncMethod(() =>
- {
- return this.GetScrapProduct();
- }));
- if (dsScrapProduct != null)
- {
- if (dsScrapProduct.Tables[0].Rows.Count != Constant.INT_IS_ZERO)
- {
- this.dgvScrapProduct.DataSource = ((DataSet)dsScrapProduct).Tables[Constant.INT_IS_ZERO];
- this.dgvScrapProduct.ReadOnly = true;
- }
- else
- {
- this.dgvScrapProduct.DataSource = null;
- // 提示未查找到数据
- MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- else
- {
- this.dgvScrapProduct.DataSource = null;
- // 提示未查找到数据
- 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);
- }
- }
- /// <summary>
- /// 抽查按钮点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tsbtnSuspend_Click(object sender, EventArgs e)
- {
- // 抽查
- F_PM_3102 frm3102 = new F_PM_3102();
- DialogResult dialogResult = frm3102.ShowDialog();
- }
- /// <summary>
- /// 时间有效性切换
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void cbSelectTime_CheckedChanged(object sender, EventArgs e)
- {
- this.txtDateStart.Enabled = this.cbSelectTime.Checked;
- this.txtDateEnd.Enabled = this.cbSelectTime.Checked;
- }
- /// <summary>
- /// 清空条件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnClearCondition_Click(object sender, EventArgs e)
- {
- this.txtBarCode.Text = "";
- this.cbSelectTime.Checked = true;
- this.txtDateStart.Value = DateTime.Now.Date;
- this.txtDateEnd.Value = DateTime.Now.Date.AddDays(1).AddMinutes(-1);
- this.txtRemarks.Text = "";
- this.txtCheckUser.Text = "";
- this.txtGoodscode.Text = "";
- }
- /// <summary>
- /// 关闭一览窗体
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tsbtnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- /// <summary>
- /// 窗体关闭事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PM_3101_FormClosed(object sender, FormClosedEventArgs e)
- {
- _instance = null;
- }
- /// <summary>
- /// 自动列宽
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tsbtnAdaptive_Click(object sender, EventArgs e)
- {
- this.dgvScrapProduct.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
- }
- #endregion
- #region 私有方法
- /// <summary>
- /// 根据界面查询条件获取数据集
- /// </summary>
- private DataSet GetScrapProduct()
- {
- try
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "QASpotCheck";
- cre.Name = "GetAllQASpotCheck";
- cre.Properties["barcode"] = this.txtBarCode.Text.Trim();
- cre.Properties["goodscode"] = this.txtGoodscode.Text.Trim();
- cre.Properties["usercode"] = this.txtCheckUser.Text.Trim();
- cre.Properties["remarks"] = this.txtRemarks.Text.Trim();
- if (this.cbSelectTime.Checked)
- {
- cre.Properties["checktimebegin"] = this.txtDateStart.Value;
- cre.Properties["checktimeend"] = this.txtDateEnd.Value.AddMinutes(1);
- }
- ServiceResultEntity result = PMModuleProxyNew.Service.HandleRequest(cre);
- return result.Data;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- }
- }
|