| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286 |
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.Client.Controls;
- using Dongke.IBOSS.PRD.WCF.DataModels;
- using Dongke.IBOSS.PRD.WCF.Proxys;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Reflection;
- using System.Text;
- using System.Windows.Forms;
- namespace Dongke.IBOSS.PRD.Client.PCModule
- {
- public partial class F_PC_0801 : DKDockPanelBase
- {
- #region 成员变量
- // 单例模式
- private static F_PC_0801 _instance;
- // 正在查询
- private bool _isSearching = false;
- #endregion
- #region 构造函数
- public F_PC_0801()
- {
- InitializeComponent();
- this.Text = "线边仓组件配置";
- this.tsbtnEdit.Text = ButtonText.TSBTN_EDIT;
- 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_PC_0801 Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new F_PC_0801();
- }
- return _instance;
- }
- }
- #endregion
- #region 事件
- /// <summary>
- /// 加载
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PC_0801_Load(object sender, EventArgs e)
- {
- dgvLGORT.AutoGenerateColumns = false;
- dgvIDNRKTYPE.AutoGenerateColumns = false;
- }
- /// <summary>
- /// 查询
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSearch_Click(object sender, EventArgs e)
- {
- try
- {
- this._isSearching = true;
- this.dgvLGORT.DataSource = null;
- this.dgvIDNRKTYPE.DataSource = null;
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_PC_0801";
- cre.Name = "GetLGORT";
- cre.Properties["dictionaryvalue"] = this.txtLGORT.Text;
- cre.Properties["DICTIONARYTYPE"] = "TPC011"; //线边仓数据字典类别
- ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
- {
- return PCModuleProxyNew.Service.HandleRequest(cre);
- });
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- this.Tag = false;
- if (sre.Data.Tables[0] != null && sre.Data.Tables[0].Rows.Count > 0)
- {
- this.dgvLGORT.DataSource = sre.Data.Tables[0];
- this.Tag = true;
- dgvLGORT_SelectionChanged(null, null);
- }
- else
- {
- // 清空明细中的数据
- this.dgvLGORT.DataSource = null;
- // 提示未查找到数据
- MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- }
- catch (Exception ex)
- {
- this.btnSearch.Enabled = true;
- this.btnClearCondition.Enabled = true;
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- System.Reflection.MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 自适应列宽
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tsbtnAdaptive_Click(object sender, EventArgs e)
- {
- this.dgvLGORT.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
- this.dgvIDNRKTYPE.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
- }
- /// <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 tsbtnEdit_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.dgvLGORT.SelectedRows.Count != 0)
- {
- string dictionaryvalue = this.dgvLGORT.SelectedRows[0].Cells["dictionaryvalue"].Value + "";
- F_PC_0802 frmFPC0802 = new F_PC_0802(dictionaryvalue);
- DialogResult dialogresult = frmFPC0802.ShowDialog();
- if (dialogresult.Equals(DialogResult.OK))
- {
- DataGridViewRow currentRow = this.dgvLGORT.CurrentRow;
- if (currentRow != null)
- {
- string LGORT = currentRow.Cells["dictionaryvalue"].Value.ToString();
- // 调用服务器端获取数据集
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_PC_0801";
- cre.Name = "GetIDNRKTYPE";
- cre.Properties["LGORT"] = LGORT;
- ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
- {
- return PCModuleProxyNew.Service.HandleRequest(cre);
- });
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- this.dgvIDNRKTYPE.DataSource = sre.Data.Tables[0];
- }
- }
- }
- }
- }
- 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.txtLGORT.Clear();
- }
- /// <summary>
- /// 组件库选中事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void dgvLGORT_SelectionChanged(object sender, EventArgs e)
- {
- try
- {
- // 在绑定总表时 不查询明细
- if (!Convert.ToBoolean(this.Tag)
- || this.dgvLGORT.CurrentCell == null)
- {
- return;
- }
- else
- {
- DataGridViewRow currentRow = this.dgvLGORT.CurrentRow;
- if (currentRow != null)
- {
- string LGORT = currentRow.Cells["dictionaryvalue"].Value.ToString();
- // 调用服务器端获取数据集
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_PC_0801";
- cre.Name = "GetIDNRKTYPE";
- cre.Properties["LGORT"] = LGORT;
- if (!this.txtLGORT.ReadOnly)
- {
- ServiceResultEntity sre = DoAsync<ServiceResultEntity>(() =>
- {
- return PCModuleProxyNew.Service.HandleRequest(cre);
- });
- if (sre.Status == Constant.ServiceResultStatus.Success)
- {
- // 绑定明细数据
- if (sre.Data.Tables[0] != null && sre.Data.Tables[0].Rows.Count > 0)
- {
- this.dgvIDNRKTYPE.DataSource = sre.Data.Tables[0];
- this.dgvIDNRKTYPE.Focus();
- this.dgvIDNRKTYPE.CurrentCell = null;
- }
- }
- }
- }
- }
- }
- catch (Exception ex)
- {
- // 对异常进行共通处理
- ExceptionManager.HandleEventException(this.ToString(),
- MethodBase.GetCurrentMethod().Name, this.Text, ex);
- }
- }
- /// <summary>
- /// 释放窗体
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_PC_0801_FormClosed(object sender, FormClosedEventArgs e)
- {
- _instance = null;
- }
- #endregion
- }
- }
|