From 3fb5533f30f178dcdf5965a41c39fb62c61da4d8 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 06 二月 2025 17:15:47 +0800
Subject: [PATCH] 细节
---
DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs | 487 +++++++++++++++++++++++++++++------------------------
1 files changed, 264 insertions(+), 223 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs b/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
index eff27cf..c738bda 100644
--- a/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
@@ -1,307 +1,318 @@
-锘縰sing DevExpress.XtraEditors.Controls;
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
+锘縰sing System;
+using System.Collections.Generic;
+using System.Data;
+using System.Windows.Forms;
+using DevExpress.XtraEditors;
+using DevExpress.XtraEditors.Controls;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
-using System;
-using System.Data;
-using System.Windows.Forms;
namespace Gs.DevApp.DevFrm.Sys
{
- public partial class DocNoRule : DevExpress.XtraEditors.XtraForm
+ public partial class DocNoRule : XtraForm
{
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;
- gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
- gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
+ toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
+ toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
+ toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
+ toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
+ toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
+ toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+ toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+ });
+ Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
+ {
+ getModel(value);
+ }, (value) =>
+ {
+ getPageList(this.pageBar1.CurrentPage);
+ });
+ getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
- getPageList(1, UtilityHelper.GetPageSize());
getTree();
- txt_docCode.EditValueChanged += Txt_docCode_EditValueChanged;
- txxtItem1.EditValueChanged += TxxtItem1_EditValueChanged;
- txxtItem2.EditValueChanged += TxxtItem1_EditValueChanged;
- 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;
+ txt_docCode.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txxtItem1.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txxtItem2.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txxtItem3.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txxtItem4.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txt_noLength.ValueChanged += (s, e) => { DoPreviewCode(); };
+ txt_isIncludeDoc.CheckedChanged += (s, e) => { DoPreviewCode(); };
+ txt_isSpilit.CheckedChanged += (s, e) => { DoPreviewCode(); };
}
- 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());
- }
/// <summary>
- /// 鍙屽嚮浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- GridHitInfo info = gridView1.CalcHitInfo(e.Location);
- if (info.InRow)
- {
- 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;
- }
- }
- }
- }
- /// <summary>
- /// 鍒嗛〉浜嬩欢
+ /// 鍒嗛〉浜嬩欢
/// </summary>
/// <param name="curPage"></param>
/// <param name="pageSize"></param>
private void PageBar1_PagerEvent(int curPage, int pageSize)
{
- getPageList(curPage, pageSize);
- }
- /// <summary>
- /// 鏌ヨ浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
- {
- Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns);
- frm.UpdateParent += Frm_UpdateParent;
- frm.ShowDialog();
- }
- /// <summary>
- /// 鏌ヨ鍥炶皟
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Frm_UpdateParent(object sender, UpdateParentEventArgs e)
- {
- string strWhere = e.Data;
- MessageBox.Show(strWhere);
+ getPageList(1);
}
/// <summary>
- /// 鍙栨秷浜嬩欢
+ /// 鍙嶅鏍�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <exception cref="NotImplementedException"></exception>
+ private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+ {
+ _toolCk(0);
+ }
+
+ /// <summary>
+ /// 瀹℃牳浜嬩欢
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+ {
+ _toolCk(1);
+ }
+
+ /// <summary>
+ /// 鍙栨秷浜嬩欢
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
}
+
/// <summary>
- /// 鍒犻櫎浜嬩欢
+ /// 鍒犻櫎浜嬩欢
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
{
string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_docCode, gridView1);
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_docCode, gridView1, "docCode");
if (string.IsNullOrEmpty(rowGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
+
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
return;
- var _obj = new
- {
- guidList = rowGuid,//涓诲缓
- };
+
+ var lst = new List<string>();
+ lst.Add(rowGuid);
+ var _obj = lst;
try
{
- string strJson = UtilityHelper.HttpPost("", "DocNoRule/DeleteModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ var strJson = UtilityHelper.HttpPost("",
+ "DocNoRule/DeleteModel", JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 0)
+ { }
+ else
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
+ getPageList(this.pageBar1.CurrentPage);
}
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
+
/// <summary>
- /// 鍒锋柊浜嬩欢
+ /// 鍒锋柊浜嬩欢
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ getModel(lbGuid.Text.Trim());
+ else
+ {
+ //_filterList.Clear();
+ //if (gridView1.ActiveFilter.Count > 0)
+ //{
+ // gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ // gridView1.ActiveFilter.Clear();
+ // gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ //}
+ //getPageList(1);
+ getPageList(this.pageBar1.CurrentPage);
+ }
}
+
/// <summary>
- /// 淇敼浜嬩欢
+ /// 淇敼浜嬩欢
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
{
string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_docCode, gridView1);
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_docCode, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- getModel(rowGuid, true, 1);
- txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled= panelControl1.Enabled = true;
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+ UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
+ txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled = panelControl1.Enabled = true;
}
+
/// <summary>
- /// 鏂板浜嬩欢
+ /// 鏂板浜嬩欢
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 1);
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;
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
+ UtilityHelper.CleanValueByControl(panel1.Controls, true);
+ txxtItem1.SelectedIndex = txxtItem2.SelectedIndex =
+ txxtItem3.SelectedIndex = txxtItem4.SelectedIndex = 0;
+ txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled =
+ txxtItem4.Enabled = panelControl1.Enabled = true;
}
+
/// <summary>
- /// 淇濆瓨浜嬩欢
+ /// 淇濆瓨浜嬩欢
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
{
toolBarMenu1.isSetBtn = false;
- if (txt_docCode.EditValue == null || string.IsNullOrEmpty(txt_docCode.EditValue.ToString()))
+ if (txt_docCode.EditValue == null ||
+ string.IsNullOrEmpty(txt_docCode.EditValue.ToString()))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨鍗曟嵁绫诲瀷锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨鍗曟嵁绫诲瀷锛�");
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("璇疯嚦灏戦�夋嫨涓�涓弬鏁帮紒");
+ MsgHelper.Warning("璇疯嚦灏戦�夋嫨涓�涓弬鏁帮紒");
txxtItem1.Focus();
return;
}
- if (txt_ruleFormat.Text.Length <= 0)
+
+ if (txt_docFormat.Text.Length <= 0)
{
- ToolBox.MsgHelper.Warning("璇峰厛閰嶇疆鍙傛暟锛�");
+ 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(),//涓诲缓
+ guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
docCode = txt_docCode.EditValue.ToString(),
- ruleFormat = txt_ruleFormat.Text.ToString(),
- //currentValue = txt_currentValue.Text.ToString(),
+ docFormat = txt_docFormat.Text,
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
{
- string strJson = UtilityHelper.HttpPost("", "DocNoRule/EditModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ var strJson = UtilityHelper.HttpPost("", "DocNoRule/EditModel",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
if (_rtn.rtnCode > 0)
{
lbGuid.Text = _rtn.rtnData;
toolBarMenu1.isSetBtn = true;
- UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
+ UtilityHelper.ChangeEnableByControl(panel1.Controls, false);
}
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
+
/// <summary>
- ///
/// </summary>
/// <param name="curPage">绗嚑椤�</param>
/// <param name="pageSize">姣忛〉鍑犳潯</param>
- private void getPageList(int curPage, int pageSize)
+ private void getPageList(int curPage)
{
- PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "docCode", "asc", "", "");
- string json = JsonConvert.SerializeObject(pgq);
+ var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "doc_Code");
+ var json = JsonConvert.SerializeObject(pgq);
try
{
- string strReturn = UtilityHelper.HttpPost("", "DocNoRule/GetListPage", json);
- ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
- DataTable dt = dd.rtnData.list;
- gcMain.BindingContext = new BindingContext();
- gcMain.DataSource = dt;
- gcMain.ForceInitialize();
- int dddd = dd.rtnData.pages;//鎬婚〉
- pageBar1.TotalPages = dddd;
- pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟
- pageBar1.CurrentPage = curPage;//褰撳墠椤�
- pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
- pageBar1.setTxt();
+ var strReturn =
+ UtilityHelper.HttpPost("", "DocNoRule/GetListPage", json);
+ var dd = UtilityHelper.ReturnToTablePage(strReturn);
+ if (dd.rtnCode > 0)
+ {
+ DataTable dt = dd.rtnData.list;
+ gcMain.BindingContext = new BindingContext();
+ gcMain.DataSource = dt;
+ gcMain.ForceInitialize();
+ pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
+ pageBar1.CurrentPage = curPage;//褰撳墠椤�
+ pageBar1.RecordCount = dd.rtnData.total;//鎬昏褰曟暟
+ gridView1.BestFitColumns();
+ }
+ else
+ {
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
+ }
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
- private void getModel(string strGuid, bool isEdit, int tabIdx)
+
+ private void getModel(string strGuid)
{
+ bool isEdit = false;
+ if (toolBarMenu1.currentAction == "add") return;
+ if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
var _obj = new
{
- guid = strGuid,//涓诲缓
+ guid = strGuid //涓诲缓
};
try
{
- string strJson = UtilityHelper.HttpPost("", "DocNoRule/GetModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ var strJson = UtilityHelper.HttpPost("", "DocNoRule/GetModel",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- dynamic dy = _rtn.rtnData;
+ var dy = _rtn.rtnData;
lbGuid.Text = strGuid;
- UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit);
+ UtilityHelper.SetValueByObj(panel1.Controls, dy, isEdit);
txt_docCode.EditValue = dy.docCode.ToString();
-
- string _rule = dy.ruleFormat.ToString();
- string[] _ary = _rule.Split(new char[] { '<' }, StringSplitOptions.RemoveEmptyEntries);
+ string _rule = dy.docFormat.ToString();
+ var _ary = _rule.Split(new[] { '<' },
+ StringSplitOptions.RemoveEmptyEntries);
if (_ary.Length > 0)
txxtItem1.Text = "<" + _ary[0];
if (_ary.Length > 1)
@@ -310,100 +321,130 @@
txxtItem3.Text = "<" + _ary[2];
if (_ary.Length > 3)
txxtItem4.Text = "<" + _ary[3];
+ txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled = panelControl1.Enabled = false;
}
else
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
private void getTree()
{
- // 鍒涘缓鏁版嵁琛�
- DataTable dataTable = new DataTable();
+ var dataTable = new DataTable();
dataTable.Columns.Add("docCode", typeof(string));
- // 娣诲姞鏁版嵁琛�
- dataTable.Rows.Add("DH(鍒拌揣鍗�)");
- dataTable.Rows.Add("QO(鎶ヤ环鍗�)");
- dataTable.Rows.Add("PO(閲囪喘璁㈠崟)");
- dataTable.Rows.Add("IA(搴撳瓨璋冩暣)");
- dataTable.Rows.Add("IO(鍑哄簱鍗�)");
- dataTable.Rows.Add("AR(搴旀敹娆�)");
- dataTable.Rows.Add("SO(閿�鍞鍗�)");
- dataTable.Rows.Add("AP(搴斾粯娆�)");
- dataTable.Rows.Add("IV(閿�鍞彂绁�)");
- dataTable.Rows.Add("IV(閿�鍞彂绁�)");
- dataTable.Rows.Add("IN(鍏ュ簱)");
- dataTable.Rows.Add("PN(鐢熶骇搴�)");
- // 璁剧疆LookUpEdit鐨勬暟鎹簮
+ dataTable.Rows.Add("CGDH(鍒拌揣鍗�)");//V
+ dataTable.Rows.Add("CGJY(妫�楠屽崟)");//V
+ dataTable.Rows.Add("DBSQ(璋冩嫧鐢宠鍗�)");//V
+ dataTable.Rows.Add("GDPC(宸ュ崟鎺掍骇)");//V
+ dataTable.Rows.Add("WWPC(濮斿鎺掍骇)");//V
+ dataTable.Rows.Add("CKSQ(鍑哄簱鐢宠)");//V
+ dataTable.Rows.Add("RKSQ(鍏ュ簱鐢宠)");//V
+ dataTable.Rows.Add("TL(閫�鏂欏崟)");
+ dataTable.Rows.Add("IN(鍏ュ簱鍗�)");
+ dataTable.Rows.Add("SC(鐢熶骇宸ュ崟)");
+ dataTable.Rows.Add("OUT(鍑哄簱鍗�)");
+ dataTable.Rows.Add("HB(鐗╂枡鍚堝苟)");
+ dataTable.Rows.Add("QTSQ(鍏朵粬鍏ュ簱鐢宠)");
txt_docCode.Properties.DataSource = dataTable;
txt_docCode.Properties.DisplayMember = "docCode"; // 鏄剧ず鐨勫垪
- txt_docCode.Properties.ValueMember = "docCode"; // 瀹為檯鍊肩殑鍒�
- txt_docCode.Properties.TextEditStyle = TextEditStyles.Standard;
+ txt_docCode.Properties.ValueMember = "docCode"; // 瀹為檯鍊肩殑鍒�
+ txt_docCode.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
}
-
- private void Txt_flagIncludeDocCode_CheckedChanged(object sender, EventArgs e)
- {
- DoPreviewCode();
- }
-
- private void Txt_noLength_ValueChanged(object sender, EventArgs e)
- {
- DoPreviewCode();
- }
-
- private void TxxtItem1_EditValueChanged(object sender, EventArgs e)
- {
- DoPreviewCode();
- }
+
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 == "")
+ var text = txxtItem1.Text + txxtItem2.Text + txxtItem3.Text +
+ txxtItem4.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();
- }
preview = docCode + preview;
preview = preview.Replace("<鏃�>", "");
preview = preview.Replace("<骞村勾骞村勾>", "2024");
preview = preview.Replace("<骞村勾>", "24");
preview = preview.Replace("<鏈堟湀>", "06");
preview = preview.Replace("<鏃ユ棩>", "18");
- preview = preview + (txt_flagSpilitNo.Checked ? "-" : "") + "8".PadLeft(length, '0');
- lblPreview.Text = "鐢熸垚缂栧彿锛�" + preview;
+ preview = preview + (txt_isSpilit.Checked ? "-" : "") +
+ "8".PadLeft(length, '0');
+ lblPreview.Text = "鏍蜂緥锛�" + preview;
}
}
- private void Txt_docCode_EditValueChanged(object sender, EventArgs e)
+
+ /// <summary>
+ /// 宸ュ叿鏉′簨浠�
+ /// </summary>
+ /// <param name="inFieldValue"></param>
+ private void _toolCk(int _inFieldValue)
{
- DoPreviewCode();
+ string strMsg = "";
+ switch (_inFieldValue)
+ {
+ case 1:
+ strMsg = "瀹℃牳";
+ break;
+ case 0:
+ strMsg = "鍙嶅鏍�";
+ break;
+ };
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_docCode, gridView1, "docCode");
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
+ return;
+
+ var _obj = new
+ {
+ guid = rowGuid,
+ ckValue = _inFieldValue,
+ parameter = "SYS_DOC_RULE,check_date,check_status,check_by"
+ };
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("", "General/GeneralCheck",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
+ if (_rtn.rtnCode > 0)
+ {
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ {
+ getModel(lbGuid.Text.Trim());
+ }
+ int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+ gridView1.FocusedRowHandle = rowHandle;
+ UtilityHelper.SetCheckIco(gridView1, "checkStatus", "", "", picCheckBox, this, _inFieldValue.ToString());
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
}
-
}
-}
-
+}
\ No newline at end of file
--
Gitblit v1.9.3