| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- /*******************************************************************************
- * Copyright(c) 2016 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_RPT_080110.cs
- * 2.功能描述:半成品检验判级明细表
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 冯林勇 2022/09/12 1.00 新建
- *******************************************************************************/
- 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 System;
- using System.Data;
- using System.Windows.Forms;
- using System.Linq;
- using System.Collections.Generic;
- using Dongke.IBOSS.PRD.Client.Controls;
- namespace Dongke.IBOSS.PRD.Client.ReportModule
- {
- /// <summary>
- /// 半检登记明细表
- /// </summary>
- public partial class F_RPT_080110 : DKDockPanelBase
- {
- #region 成员变量
- //单例模式
- private static F_RPT_080110 _instance;
- SemiCheckEntity _entity;
- #endregion
- #region 构造函数
- /// <summary>
- /// 废弃一览构造
- /// </summary>
- public F_RPT_080110()
- {
- InitializeComponent();
- this.tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
- this.tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
- this.btnSearch.Text = ButtonText.BTN_SEARCH;
- this.btnClearCondition.Text = ButtonText.BTN_CLEARCONDITION;
- }
- #endregion
- #region 单例模式
- /// <summary>
- /// 单例模式,防止重复创建窗体
- /// </summary>
- public static F_RPT_080110 Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new F_RPT_080110();
- }
- return _instance;
- }
- }
- #endregion
- #region 事件
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PM_2201_Load(object sender, EventArgs e)
- {
- try
- {
- // 加载权限
- FormPermissionManager.FormPermissionControl(this.Name, this,
- Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
- Dongke.IBOSS.PRD.Client.DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
- this.dgvSemiCheck.AutoGenerateColumns = false;
- // 设置日期控件默认值
- this.txtSemiCheckDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
- this.txtSemiCheckDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
- //下拉框绑定判断等级
- BindJudgmentLevel();
- //下拉框绑定登记工序
- BindRegisterTheOperation();
- //下拉框绑定登记状态
- BindRegistrationStatus();
-
- }
- 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
- {
- this.dgvSemiCheck.DataSource = null;
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.Properties["GoodsCode"] = this.txtGoodsCode.Text; //产品编号
- cre.Properties["GoodsTypeCode"] = this.scbGoodsType.Text; //产品类别
- cre.Properties["PROCEDUREID"] = this.scbRegisterTheOperation.SelectedValue;//登记工序
- cre.Properties["GROUTINGLINECODE"] = this.txtGroutingLineCode.Text; //成型线编码
- cre.Properties["GOODSLEVELID"] = this.scbJudgmentLevel.SelectedValue; //判定等级
- string state = this.scbRegistrationStatus.Text; //登记状态
- if (state == "有效")
- {
- cre.Properties["VALUEFLAG"] = "1";
- }
- else if (state == "历史")
- {
- cre.Properties["VALUEFLAG"] = "0";
- }
- else
- {
- cre.Properties["VALUEFLAG"] = "2";
- }
- cre.Properties["SemiCheckDateTimeStart"] = this.txtSemiCheckDateTimeStart.Value; //半检时间
- cre.Properties["SemiCheckDateTimeEnd"] = this.txtSemiCheckDateTimeEnd.Value; //半检时间
- cre.NameSpace = "R04";
- cre.Name = "F_RPT_080110_Seach";
- ServiceResultEntity dsSemiCheck = ReportModuleProxy.Service.DoRequest(cre);
- if (dsSemiCheck.Data != null && dsSemiCheck.Data.Tables.Count > 0 && dsSemiCheck.Data.Tables[0].Rows.Count > 0)
- {
- this.dgvSemiCheck.DataSource = (dsSemiCheck).Data.Tables[Constant.INT_IS_ZERO];
- this.dgvSemiCheck.ReadOnly = true;
- this.dgvSemiCheck.Rows[0].Selected = true;
- }
- else
- {
- // 提示未查找到数据
- 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>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnClearCondition_Click(object sender, EventArgs e)
- {
- this.scbJudgmentLevel.SelectedIndex = 3;
- this.scbRegisterTheOperation.SelectedIndex = 3;
- this.txtGroutingLineCode.Text = "";
- this.scbRegistrationStatus.SelectedValue = 0;
- this.scbGoodsType.ClearValue();
- this.txtGoodsCode.Text = string.Empty;
- this.txtSemiCheckDateTimeStart.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
- this.txtSemiCheckDateTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
- }
- /// <summary>
- /// 绑定判定等级下拉框
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BindJudgmentLevel()
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "R04";
- cre.Name = "F_RPT_080110";
- ServiceResultEntity sre = ReportModuleProxy.Service.DoRequest(cre);
- if (sre == null || sre.Data == null ||
- sre.Data.Tables.Count == 0 ||
- sre.Data.Tables[0].Rows.Count == 0)
- {
- return;
- }
- else
- {
- DataTable dtKilnInfo = sre.Data.Tables[Constant.INT_IS_ZERO];
- DataRow row = dtKilnInfo.NewRow();
- row["GOODSLEVELTYPEID"] = 0;
- row["GOODSLEVELTYPENAME"] = "全部";
- dtKilnInfo.Rows.Add(row);
- this.scbJudgmentLevel.DisplayMember = "GOODSLEVELTYPENAME";
- this.scbJudgmentLevel.ValueMember = "GOODSLEVELTYPEID";
- this.scbJudgmentLevel.DataSource = dtKilnInfo;
- this.scbJudgmentLevel.SelectedIndex = 3;
- }
- }
- /// <summary>
- /// 绑定登记状态下拉框
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BindRegistrationStatus()
- {
- Dictionary<int, string> dic = new Dictionary<int, string>()
- {
- {0,"全部" },
- {1,"有效" },
- {2,"历史" },
- };
- this.scbRegistrationStatus.ValueMember = "Key";
- this.scbRegistrationStatus.DisplayMember = "Value";
- this.scbRegistrationStatus.DataSource = new BindingSource() { DataSource = dic };
- this.scbRegistrationStatus.SelectedIndex = 0;
- }
- /// <summary>
- /// 绑定登记工序下拉框
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void BindRegisterTheOperation()
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "R04";
- cre.Name = "F_RPT_080110_2";
- ServiceResultEntity sre = ReportModuleProxy.Service.DoRequest(cre);
- if (sre == null || sre.Data == null ||
- sre.Data.Tables.Count == 0 ||
- sre.Data.Tables[0].Rows.Count == 0)
- {
- return;
- }
- else
- {
- DataTable dtKilnInfo = sre.Data.Tables[Constant.INT_IS_ZERO];
- DataRow row = dtKilnInfo.NewRow();
- row["PROCEDUREID"] = 0;
- row["PROCEDURENAME"] = "全部";
- dtKilnInfo.Rows.Add(row);
- this.scbRegisterTheOperation.DisplayMember = "PROCEDURENAME";
- this.scbRegisterTheOperation.ValueMember = "PROCEDUREID";
- this.scbRegisterTheOperation.DataSource = dtKilnInfo;
- this.scbRegisterTheOperation.SelectedIndex = 3;
- }
- }
- /// <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_2201_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.dgvSemiCheck.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
- }
- /// <summary>
- /// 半检时间复选框改变事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void cbSemiCheck_CheckedChanged(object sender, EventArgs e)
- {
-
- }
- #endregion
- #region 私有方法
- /// <summary>
- /// 根据界面查询条件获取数据集
- /// </summary>
- private DataSet GetSemiCheck(SemiCheckEntity _entity)
- {
- try
- {
- ServiceResultEntity resultEntity = ReportModuleProxy.Service.GetRPT080108IData(_entity);
- return resultEntity.Data;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- }
- }
|