From 7a7dc53fdcf3de71c5464c7ca0e7aea176640dbe Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 24 十月 2024 16:04:18 +0800
Subject: [PATCH] Merge branch 'master' of http://43.142.96.171:8080/r/~tjx/GsMesClient
---
DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs | 132 ++++++++++++++++----------------------------
1 files changed, 48 insertions(+), 84 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs b/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
index eff27cf..25acef1 100644
--- a/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
@@ -1,10 +1,9 @@
锘縰sing DevExpress.XtraEditors.Controls;
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
+using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
@@ -15,18 +14,17 @@
public DocNoRule()
{
InitializeComponent();
- txt_docCode.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
- this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+ this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+ this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
- gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
- pageBar1.PagerEvent += PageBar1_PagerEvent;
getPageList(1, UtilityHelper.GetPageSize());
+ pageBar1.PagerEvent += PageBar1_PagerEvent;
getTree();
txt_docCode.EditValueChanged += Txt_docCode_EditValueChanged;
txxtItem1.EditValueChanged += TxxtItem1_EditValueChanged;
@@ -34,20 +32,8 @@
txxtItem3.EditValueChanged += TxxtItem1_EditValueChanged;
txxtItem4.EditValueChanged += TxxtItem1_EditValueChanged;
txt_noLength.ValueChanged += Txt_noLength_ValueChanged;
- txt_flagIncludeDocCode.CheckedChanged += Txt_flagIncludeDocCode_CheckedChanged;
- txt_flagSpilitNo.CheckedChanged += Txt_flagIncludeDocCode_CheckedChanged;
- }
-
- private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
- {
- //// 鑾峰彇GridView缁勪欢
- //GridView view = sender as GridView;
- //// 纭繚view涓嶄负null
- //if (view == null) return;
- //// 鑾峰彇搴旂敤鐨勭瓫閫夊櫒淇℃伅
- //string filter = view.ActiveFilterString;
- //MessageBox.Show(filter);
- //getPageList(1, UtilityHelper.GetPageSize());
+ txt_isIncludeDoc.CheckedChanged += Txt_flagIncludeDocCode_CheckedChanged;
+ txt_isSpilit.CheckedChanged += Txt_flagIncludeDocCode_CheckedChanged;
}
/// <summary>
/// 鍙屽嚮浜嬩欢
@@ -56,20 +42,12 @@
/// <param name="e"></param>
private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
{
- GridHitInfo info = gridView1.CalcHitInfo(e.Location);
- if (info.InRow)
+ string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
+ if (!string.IsNullOrEmpty(rowGuid))
{
- GridView view = info.View as GridView;
- if (view != null)
- {
- DataRow row = view.GetDataRow(info.RowHandle);
- if (row != null)
- {
- string rowGuid = (row["guid"].ToString());
- getModel(rowGuid, false, 999);
- txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled = false;
- }
- }
+ getModel(rowGuid, false, 999);
+ txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled = false;
+
}
}
/// <summary>
@@ -82,27 +60,30 @@
getPageList(curPage, pageSize);
}
/// <summary>
- /// 鏌ヨ浜嬩欢
+ /// 鍙嶅鏍�
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
- private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
+ /// <exception cref="NotImplementedException"></exception>
+ private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
{
- Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns);
- frm.UpdateParent += Frm_UpdateParent;
- frm.ShowDialog();
+ this.toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_docCode, gridView1);
+ this.toolBarMenu1.guidKey = rowGuid;
}
/// <summary>
- /// 鏌ヨ鍥炶皟
+ /// 瀹℃牳浜嬩欢
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
- private void Frm_UpdateParent(object sender, UpdateParentEventArgs e)
+ private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
{
- string strWhere = e.Data;
- MessageBox.Show(strWhere);
+ this.toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_docCode, gridView1);
+ this.toolBarMenu1.guidKey = rowGuid;
}
-
/// <summary>
/// 鍙栨秷浜嬩欢
/// </summary>
@@ -128,10 +109,10 @@
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
return;
- var _obj = new
- {
- guidList = rowGuid,//涓诲缓
- };
+
+ List<string> lst = new List<string>();
+ lst.Add(rowGuid);
+ var _obj = lst;
try
{
string strJson = UtilityHelper.HttpPost("", "DocNoRule/DeleteModel", JsonConvert.SerializeObject(_obj));
@@ -173,7 +154,7 @@
return;
}
getModel(rowGuid, true, 1);
- txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled= panelControl1.Enabled = true;
+ txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled = panelControl1.Enabled = true;
}
/// <summary>
/// 鏂板浜嬩欢
@@ -186,7 +167,7 @@
lbGuid.Text = "";
UtilityHelper.CleanValueByControl(this.panel1.Controls, true);
txxtItem1.SelectedIndex = txxtItem2.SelectedIndex = txxtItem3.SelectedIndex = txxtItem4.SelectedIndex = 0;
- txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled= panelControl1.Enabled = true;
+ txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled = panelControl1.Enabled = true;
}
/// <summary>
/// 淇濆瓨浜嬩欢
@@ -202,34 +183,27 @@
txt_docCode.Focus();
return;
}
- if ((txxtItem1.SelectedIndex+ txxtItem2.SelectedIndex+ txxtItem3.SelectedIndex+ txxtItem4.SelectedIndex)<=0)
+ if ((txxtItem1.SelectedIndex + txxtItem2.SelectedIndex + txxtItem3.SelectedIndex + txxtItem4.SelectedIndex) <= 0)
{
ToolBox.MsgHelper.Warning("璇疯嚦灏戦�夋嫨涓�涓弬鏁帮紒");
txxtItem1.Focus();
return;
}
- if (txt_ruleFormat.Text.Length <= 0)
+ if (txt_docFormat.Text.Length <= 0)
{
ToolBox.MsgHelper.Warning("璇峰厛閰嶇疆鍙傛暟锛�");
txt_docCode.Focus();
- return;
- }
- if (txt_resetZero.SelectedIndex <= 0)
- {
- Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨褰掗浂鏂瑰紡锛�");
- txt_resetZero.Focus();
return;
}
var _obj = new
{
guid = lbGuid.Text.Trim(),//涓诲缓
docCode = txt_docCode.EditValue.ToString(),
- ruleFormat = txt_ruleFormat.Text.ToString(),
- //currentValue = txt_currentValue.Text.ToString(),
+ docFormat = txt_docFormat.Text.ToString(),
noLength = txt_noLength.Value.ToString(),
- resetZero = txt_resetZero.SelectedIndex.ToString(),
- flagSpilitNo = txt_flagSpilitNo.Checked ? 1 : 2,
- flagIncludeDocCode = txt_flagIncludeDocCode.Checked ? 1 : 2,
+ resetZero = txt_resetZero.Checked,
+ isSpilit = txt_isSpilit.Checked,
+ isIncludeDoc = txt_isIncludeDoc.Checked,
};
try
{
@@ -255,7 +229,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage, int pageSize)
{
- PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "docCode", "asc", "", "");
+ PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "doc_Code", "asc", "", "");
string json = JsonConvert.SerializeObject(pgq);
try
{
@@ -299,8 +273,7 @@
lbGuid.Text = strGuid;
UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit);
txt_docCode.EditValue = dy.docCode.ToString();
-
- string _rule = dy.ruleFormat.ToString();
+ string _rule = dy.docFormat.ToString();
string[] _ary = _rule.Split(new char[] { '<' }, StringSplitOptions.RemoveEmptyEntries);
if (_ary.Length > 0)
txxtItem1.Text = "<" + _ary[0];
@@ -322,10 +295,8 @@
private void getTree()
{
- // 鍒涘缓鏁版嵁琛�
DataTable dataTable = new DataTable();
dataTable.Columns.Add("docCode", typeof(string));
- // 娣诲姞鏁版嵁琛�
dataTable.Rows.Add("DH(鍒拌揣鍗�)");
dataTable.Rows.Add("QO(鎶ヤ环鍗�)");
dataTable.Rows.Add("PO(閲囪喘璁㈠崟)");
@@ -338,11 +309,10 @@
dataTable.Rows.Add("IV(閿�鍞彂绁�)");
dataTable.Rows.Add("IN(鍏ュ簱)");
dataTable.Rows.Add("PN(鐢熶骇搴�)");
- // 璁剧疆LookUpEdit鐨勬暟鎹簮
txt_docCode.Properties.DataSource = dataTable;
txt_docCode.Properties.DisplayMember = "docCode"; // 鏄剧ず鐨勫垪
txt_docCode.Properties.ValueMember = "docCode"; // 瀹為檯鍊肩殑鍒�
- txt_docCode.Properties.TextEditStyle = TextEditStyles.Standard;
+ txt_docCode.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
}
private void Txt_flagIncludeDocCode_CheckedChanged(object sender, EventArgs e)
@@ -361,31 +331,25 @@
}
private void DoPreviewCode()
{
- if (txt_docCode.Enabled == false
- || txxtItem1.Enabled==false
- || txxtItem2.Enabled == false
- || txxtItem3.Enabled == false
+ if (txt_docCode.Enabled == false
+ || txxtItem1.Enabled == false
+ || txxtItem2.Enabled == false
+ || txxtItem3.Enabled == false
|| txxtItem4.Enabled == false)
return;
var text = txxtItem1.Text + txxtItem2.Text + txxtItem3.Text + txxtItem4.Text;
- txt_ruleFormat.Text = text;
- if (txt_docCode.EditValue == null)
- {
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨鍗曟嵁绫诲瀷");
- txt_docCode.Focus();
- return;
- }
- if (txt_ruleFormat.Text == "")
+ txt_docFormat.Text = text;
+ if (txt_docFormat.Text == "")
{
lblPreview.Text = "璇峰畾涔夎鍒�.";
}
else
{
// txtRuleFormat="<骞村勾>", "<骞村勾骞村勾>", "<鏈堟湀>", "<鏃ユ棩>" });
- var preview = txt_ruleFormat.Text;
+ var preview = txt_docFormat.Text;
var length = int.Parse(txt_noLength.Value.ToString());
var docCode = "";
- if (txt_flagIncludeDocCode.Checked)
+ if (txt_isIncludeDoc.Checked)
{
docCode = txt_docCode.EditValue.ToString();
}
@@ -395,7 +359,7 @@
preview = preview.Replace("<骞村勾>", "24");
preview = preview.Replace("<鏈堟湀>", "06");
preview = preview.Replace("<鏃ユ棩>", "18");
- preview = preview + (txt_flagSpilitNo.Checked ? "-" : "") + "8".PadLeft(length, '0');
+ preview = preview + (txt_isSpilit.Checked ? "-" : "") + "8".PadLeft(length, '0');
lblPreview.Text = "鐢熸垚缂栧彿锛�" + preview;
}
}
--
Gitblit v1.9.3