| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:F_PM_3301.cs
- * 2.功能描述:废弃产品信息一览
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 付斌 2020/11/06 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_3301 : DockPanelBase
- {
- #region 成员变量
- private static F_PM_3301 _instance; //单例模式
- #endregion
- #region 构造函数
- /// <summary>
- /// 废弃一览构造
- /// </summary>
- public F_PM_3301()
- {
- InitializeComponent();
- Text = FormTitles.F_PM_3301;
- dtpScrapDateStart.Enabled = true;
- dtpScrapDateEnd.Enabled = true;
- tsbtnAdaptive.Text = ButtonText.TSBTN_ADAPTIVE;
- tsbtnClose.Text = ButtonText.TSBTN_CLOSE;
- }
- #endregion
- #region 单例模式
- /// <summary>
- /// 单例模式,防止重复创建窗体
- /// </summary>
- public static F_PM_3301 Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new F_PM_3301();
- }
- return _instance;
- }
- }
- #endregion
- #region 事件
- /// <summary>
- /// 窗体加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PM_3301_Load(object sender, EventArgs e)
- {
- try
- {
- // 加载权限
- FormPermissionManager.FormPermissionControl(Name, this,
- DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
- DataModels.LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
- // 损坯原因
- DataSet dsRreason = (DataSet)DoAsync(
- () => { return SystemModuleProxy.Service.GetDictionaryData(0, "TPC009"); });
- DataRow row = dsRreason.Tables[0].NewRow();
- row["DictionaryValue"] = "";
- row["DictionaryID"] = 0;
- dsRreason.Tables[0].Rows.InsertAt(row, 0);
- cmbRreason.DisplayMember = "DictionaryValue";
- cmbRreason.ValueMember = "DictionaryID";
- cmbRreason.DataSource = dsRreason.Tables[0];
- dgvScrapProduct.AutoGenerateColumns = false;
- dtpScrapDateStart.Value = DateTime.Now.Date;
- dtpScrapDateEnd.Value = DateTime.Now.Date;
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
- }
- }
- /// <summary>
- /// 查询事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSearch_Click(object sender, EventArgs e)
- {
- try
- {
- dgvScrapProduct.DataSource = null;
- // 异步处理
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_PM_3302";
- cre.Name = "GetAllocateOut";
- cre.Data = new DataSet();
- cre.Properties["barcode"] = txtBarCode.Text.Trim();
- cre.Properties["goodscode"] = txtGoodsCode.Text.Trim();
- cre.Properties["goodsname"] = txtGoodsName.Text.Trim();
- cre.Properties["scrapdatestart"] = dtpScrapDateStart.Value;
- cre.Properties["scrapdateend"] = dtpScrapDateEnd.Value.AddDays(1);
- cre.Properties["groutinglinecode"] = txtGroutingLineCode.Text.Trim();
- cre.Properties["groutinglinename"] = txtGroutingLineName.Text.Trim();
- cre.Properties["rreason"] = cmbRreason.Text.Trim();
- cre.Properties["remarks"] = txtRemarks.Text.Trim();
- ServiceResultEntity sre = (ServiceResultEntity)DoAsync(
- () => { return PMModuleProxyNew.Service.HandleRequest(cre); });
- if (sre.Data != null && sre.Data.Tables[0].Rows.Count > 0)
- {
- dgvScrapProduct.DataSource = sre.Data.Tables[Constant.INT_IS_ZERO];
- }
- else
- {
- // 提示未查找到数据
- MessageBox.Show(Messages.MSG_CMN_I002, Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
- }
- }
- /// <summary>
- /// 清空条件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnClearCondition_Click(object sender, EventArgs e)
- {
- txtBarCode.Text = "";
- txtGoodsCode.Text = "";
- txtGoodsName.Text = "";
- txtGroutingLineCode.Text = "";
- txtGroutingLineName.Text = "";
- txtRemarks.Text = "";
- cmbRreason.SelectedIndex = 0;
- dtpScrapDateStart.Value = DateTime.Now.Date;
- dtpScrapDateEnd.Value = DateTime.Now.Date;
- }
- /// <summary>
- /// 调出窗体打开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tsbtnAllocateOut_Click(object sender, EventArgs e)
- {
- try
- {
- F_PM_3302 frm = new F_PM_3302();
- frm.FormType = Constant.FormMode.Add;
- DialogResult dialogresult = frm.ShowDialog();
- if (dialogresult.Equals(DialogResult.OK))
- {
- btnSearch_Click(null, null);
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
- }
- }
- /// <summary>
- /// 撤销窗体打开事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tsbtnCancelAllocateOut_Click(object sender, EventArgs e)
- {
- try
- {
- F_PM_3302 frm = new F_PM_3302();
- frm.FormType = Constant.FormMode.Edit;
- DialogResult dialogresult = frm.ShowDialog();
- if (dialogresult.Equals(DialogResult.OK))
- {
- btnSearch_Click(null, null);
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, Text, ex);
- }
- }
- /// <summary>
- /// 自动列宽
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tsbtnAdaptive_Click(object sender, EventArgs e)
- {
- dgvScrapProduct.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
- }
- /// <summary>
- /// 关闭一览窗体
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tsbtnClose_Click(object sender, EventArgs e)
- {
- Close();
- }
- /// <summary>
- /// 窗体关闭事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PM_3301_FormClosed(object sender, FormClosedEventArgs e)
- {
- _instance = null;
- }
- #endregion
- }
- }
|