| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- /*******************************************************************************
- * Copyright(c) 2016 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_RPT_080112.cs
- * 2.功能描述:品管数据记录明细表
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 秦祺 2023/06/02 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.WCF.Proxys;
- using Dongke.IBOSS.PRD.WCF.Proxys.PMModuleService;
- using Dongke.IBOSS.PRD.WCF.Proxys.SystemModuleService;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.Client.Controls;
- namespace Dongke.IBOSS.PRD.Client.ReportModule
- {
- /// <summary>
- /// 品管数据记录明细表
- /// </summary>
- public partial class F_RPT_080112 : DKDockPanelBase
- {
- #region 成员变量
- //单例模式
- private static F_RPT_080112 _instance;
- #endregion
- #region 构造函数
- public F_RPT_080112()
- {
- InitializeComponent();
- }
- #endregion
- #region 单例模式
- /// <summary>
- /// 单例模式,防止重复创建窗体
- /// </summary>
- public static F_RPT_080112 Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new F_RPT_080112();
- }
- return _instance;
- }
- }
- #endregion
- #region 事件
- /// <summary>
- /// 窗体加载
- /// </summary>
- private void F_RPT_080112_Load(object sender, EventArgs e)
- {
- // 加载权限
- FormPermissionManager.FormPermissionControl(this.Name, this,
- Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
- Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
- this.dgvPinGuanDetail.AutoGenerateColumns = false;
- this.txtRecordDateStart.Value = DateTime.Now.Date;
- this.txtRecordDateEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
- this.Text = "品管数据记录明细表";
- // 巡检类别
- DataTable workStationTable = new DataTable();
- workStationTable.Columns.Add("WorkStationID", typeof(int));
- workStationTable.Columns.Add("WorkStation", typeof(string));
- DataRow drWorkStation = workStationTable.NewRow();
- drWorkStation["WorkStationID"] = 1;
- drWorkStation["WorkStation"] = "";
- workStationTable.Rows.Add(drWorkStation);
- drWorkStation = workStationTable.NewRow();
- drWorkStation["WorkStationID"] = 2;
- drWorkStation["WorkStation"] = "3#功能巡检";
- workStationTable.Rows.Add(drWorkStation);
- drWorkStation = workStationTable.NewRow();
- drWorkStation["WorkStationID"] = 3;
- drWorkStation["WorkStation"] = "3#外观巡检";
- workStationTable.Rows.Add(drWorkStation);
- drWorkStation = workStationTable.NewRow();
- drWorkStation["WorkStationID"] = 4;
- drWorkStation["WorkStation"] = "3#包装巡检";
- workStationTable.Rows.Add(drWorkStation);
- this.cbworkStation.DisplayMember = "WorkStation";
- this.cbworkStation.ValueMember = "WorkStationID";
- this.cbworkStation.DataSource = workStationTable;
- this.cbworkStation.SelectedValue = 1;
- }
- /// <summary>
- /// 获取数据
- /// </summary>
- private void btnSearch_Click(object sender, System.EventArgs e)
- {
- try
- {
- this.dgvPinGuanDetail.DataSource = null;
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_RPT_080112";
- cre.Name = "GetPinGuanDetail";
- cre.Properties["BarCode"] = this.txtBarcode.Text.Trim();
- cre.Properties["CreateTimeBegin"] = this.txtRecordDateStart.Value;
- cre.Properties["CreateTimeEnd"] = Convert.ToDateTime(this.txtRecordDateEnd.Value).AddSeconds(1);
- cre.Properties["WorkStation"] = this.cbworkStation.Text.Trim();
- cre.Properties["User"] = this.txtUser.Text.Trim();
- ServiceResultEntity sre = DoAsync(() =>
- {
- return PCModuleProxyNew.Service.HandleRequest(cre);
- });
- if (sre.Data != null && sre.Data.Tables.Count > 0 && sre.Data.Tables[0].Rows.Count > 0)
- {
- this.dgvPinGuanDetail.DataSource = sre.Data.Tables[0];
- }
- else
- {
- this.dgvPinGuanDetail.DataSource = null;
- // 提示未查找到数据
- MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 清空条件
- /// </summary>
- private void btnClearCondition_Click(object sender, EventArgs e)
- {
- this.txtBarcode.Text = "";
- this.txtRecordDateStart.Value = DateTime.Now;
- this.txtRecordDateEnd.Value = DateTime.Now;
- }
- /// <summary>
- /// 窗体关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_RPT_080112_FormClosed(object sender, FormClosedEventArgs e)
- {
- _instance = null;
- }
- /// <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 tsbtnAdaptive_Click(object sender, EventArgs e)
- {
- this.dgvPinGuanDetail.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
- }
- #endregion
- #region 私有方法
- #endregion
-
- }
- }
|