| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- using Dongke.IBOSS.PRD.Basics.BaseResources;
- using Dongke.IBOSS.PRD.Basics.DockPanel;
- using Dongke.IBOSS.PRD.Client.CommonModule;
- using Dongke.IBOSS.PRD.Client.DataModels;
- 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.Text;
- using System.Windows.Forms;
- namespace Dongke.IBOSS.PRD.Client.SystemModule
- {
- public partial class F_MST_1501 : DockPanelBase
- {
- #region 成员变量
- private static F_MST_1501 _instance;
- #endregion
- #region 构造函数
- public F_MST_1501()
- {
- InitializeComponent();
- this.Text = "版面信息";
- this.tsbtnAdd.Text = ButtonText.TSBTN_ADD;
- 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 单列模式
- public static F_MST_1501 Instance
- {
- get
- {
- if (_instance == null)
- {
- _instance = new F_MST_1501();
- }
- return _instance;
- }
- }
- #endregion
- #region 事件
- /// <summary>
- /// 页面加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_MST_1401_Load(object sender, EventArgs e)
- {
- // 按钮权限控制
- FormPermissionManager.FormPermissionControl(this.Name, this,
- LogInUserInfo.CurrentUser.CurrentUserEntity.UserRightData,
- LogInUserInfo.CurrentUser.CurrentUserEntity.FunctionData);
- //设置表格不自动创建列
- this.dgvLayout.AutoGenerateColumns = false;
- }
- /// <summary>
- /// 查询事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnSearch_Click(object sender, EventArgs e)
- {
- this.DataSource = this.GetSearchData();
- if (this.DataSource != null)
- {
- if (this.DataSource.Tables[0] != null && this.DataSource.Tables[0].Rows.Count > 0)
- {
- this.dgvLayout.DataSource = this.DataSource.Tables[0];
- }
- else
- {
- // 清空明细中的数据
- this.dgvLayout.DataSource = null;
- // 提示未查找到数据
- MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- else
- {
- // 清空明细中的数据
- this.dgvLayout.DataSource = null;
- // 提示未查找到数据
- MessageBox.Show(Messages.MSG_CMN_I002, this.Text,
- MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- /// <summary>
- /// 自适应列宽
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void tsbtnAdaptive_Click(object sender, EventArgs e)
- {
- this.dgvLayout.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.dgvLayout.SelectedRows.Count != 0)
- {
- string LayoutCode = this.dgvLayout.SelectedRows[0].Cells["LAYOUTCODE"].Value.ToString();
- string CustomerCode = this.dgvLayout.SelectedRows[0].Cells["CustomerCode"].Value.ToString();
- string GOODSCODE = this.dgvLayout.SelectedRows[0].Cells["GOODSCODE"].Value.ToString();
- F_MST_1502 frmFPC1302 = new F_MST_1502(Constant.FormMode.Edit, LayoutCode, CustomerCode, GOODSCODE);
- DialogResult dialogresult = frmFPC1302.ShowDialog();
- btnSearch_Click(sender, null);
- }
- }
- 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 tsbtnAdd_Click(object sender, EventArgs e)
- {
- try
- {
- F_MST_1502 frmMST1502 = new F_MST_1502(Constant.FormMode.Add, "","","");
- DialogResult dialogResult = frmMST1502.ShowDialog();
- // 重新加载GridView
- btnSearch_Click(sender, null);
- }
- 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.txtCustomerCode.Clear();
- this.txtLayoutCode.Clear();
- this.txtLayoutName.Clear();
- this.txtGoodsCode.Clear();
- this.cbflagtrue.Checked = true;
- this.cbflagfalse.Checked = true;
- }
- /// <summary>
- /// 窗体关闭事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void F_MST_1501_FormClosed(object sender, FormClosedEventArgs e)
- {
- _instance = null;
- }
- #endregion
- #region 私有方法
- /// <summary>
- /// 根据界面查询条件获取数据集
- /// </summary>
- private DataSet GetSearchData()
- {
- try
- {
- ClientRequestEntity cre = new ClientRequestEntity();
- cre.NameSpace = "F_MST_1501";
- cre.Name = "GetLayout";
- cre.Properties["CustomerCode"] = txtCustomerCode.Text;
- cre.Properties["LayoutCode"] = txtLayoutCode.Text;
- cre.Properties["LayoutName"] = txtLayoutName.Text;
- cre.Properties["GOODSCODE"] = txtGoodsCode.Text;
- if (this.cbflagtrue.Checked == true && this.cbflagfalse.Checked == true)
- {
- cre.Properties["ValueFlag"] = "";
- }
- else if (this.cbflagtrue.Checked == true && this.cbflagfalse.Checked == false)
- {
- cre.Properties["ValueFlag"] = 1;
- }
- else if (this.cbflagtrue.Checked == false && this.cbflagfalse.Checked == true)
- {
- cre.Properties["ValueFlag"] = 0;
- }
- else if (this.cbflagtrue.Checked == false && this.cbflagfalse.Checked == false)
- {
- cre.Properties["ValueFlag"] = 2;
- }
- ServiceResultEntity sre = SystemModuleProxy.Service.DoRequest(cre);
- if (sre.Status == Basics.BaseResources.Constant.ServiceResultStatus.Success)
- {
- return sre.Data;
- }
- return null;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- #endregion
- }
- }
|