From 9ae6f47ca642d1d52c42dbb5bb771bd5910b60d6 Mon Sep 17 00:00:00 2001
From: cnf <3283105747@qq.com>
Date: 星期三, 17 十二月 2025 18:00:59 +0800
Subject: [PATCH] 工单复选框开启可编辑
---
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs | 499 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 456 insertions(+), 43 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
index db352f3..bbcec6c 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
@@ -1,3 +1,4 @@
+using DevExpress.XtraRichEdit.Model;
using Gs.DevApp.DevFrm.Rpt;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
@@ -7,6 +8,7 @@
using System;
using System.Collections.Generic;
using System.Data;
+using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -24,59 +26,77 @@
this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL1);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL2);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMxL3);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
{
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
- }, tips);
+ }, tips, true, (strGuid) =>
+ {
+ getModelList(strGuid);
+ });
Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
{
+
getModel(value);
+
+
}, (value) =>
{
getPageList(this.pageBar1.CurrentPage);
}, lbGuid);
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
- //鎵撳嵃浜嬩欢
+
+
+ #region 鎵撳嵃鐩稿叧 2025-10-18
+
+ // -------------------- gvMx1 鎵撳嵃浜嬩欢 --------------------
+ //娴忚鎵撳嵃浜嬩欢
this.ucBtnPrint1.btnPrintClick += (s, e) =>
{
- string rowGuid = lbMxGuid.Text.Trim();
- ucBtnPrint1.guidKey = rowGuid;
- if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim(), txt_yuliang_1.Text.Trim()))
- {
- Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑鏉$爜鏁伴噺锛�");
- txt_iCount_1.Focus();
- this.ucBtnPrint1.rptParameter = "return false";
- return;
- }
- if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_1.Text.Trim()))
- {
- Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
- txt_psnQty_1.Focus();
- this.ucBtnPrint1.rptParameter = "return false";
- return;
- }
- if (lbMxGuid.Text.Trim().Length < 10)
- {
- Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
- this.ucBtnPrint1.rptParameter = "return false";
- return;
- }
- this.ucBtnPrint1.rptParameter = "rpt_Arrival{"
- + lbMxGuid.Text.Trim()//鍏宠仈涓婚敭
- + "," + ""
- + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())//浣欐暟
- + "," + txt_iCount_1.Text.Trim()//寮犳暟
- + "," + txt_psnQty_1.Text.Trim()//姣忓紶鏉$爜鏁伴噺
- + "}";
- txt_iCount_1.Text = "";
- txt_psnQty_1.Text = "";
+ _print(0);
+
};
+ //鐩存帴鎵撳嵃浜嬩欢
+ this.ucBtnPrint1.btnZhiJieClick += (s, e) =>
+ {
+ _print(1);
+ };
+
//鎵撳嵃鎵归噺鎿嶄綔浜嬩欢
this.ucBtnPrint1.btnAllClick += (s, e) =>
{
string rowGuid = lbMxGuid.Text.Trim();
SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "閲囪喘鍏ュ簱");
+ _print100(rowGuid, frm);//閲嶆墦閮芥槸浼�100锛�
+ };
+
+
+
+ // -------------------- gvMx3 鎵撳嵃浜嬩欢 --------------------
+ this.ucBtnPrint2.btnPrintClick += (s, e) =>
+ {
+ _print2(0);
+ };
+ //鐩存帴鎵撳嵃浜嬩欢
+ this.ucBtnPrint2.btnZhiJieClick += (s, e) =>
+ {
+ _print2(1);
+ };
+ // gvMx1 1鎵撳嵃浜嬩欢
+ this.ucBtnPrint2.btnAllClick += (s, e) =>
+ {
+ // string rowGuid = lbMxGuid3.Text.Trim(); // 浣跨敤gvMx3鐨凣UID
+ string rowGuid = txt_releaseNo.Text.Trim();
+ SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "鍒拌揣鏉$爜锛堝悎骞讹級鐮�"); // 鏍囬鍖哄垎鏉ユ簮
+
+
+ // _print100(rowGuid, frm);//閲嶆墦閮芥槸浼�100锛�
+
+
string strCodeList = "";
string strAction = "";
frm.UpdateParent += (ss, ee) =>
@@ -87,10 +107,11 @@
frm.ShowDialog();
if (string.IsNullOrEmpty(strCodeList))
return;
- if (strAction == "print") {
+ if (strAction == "print")
+ {
try
{
- string rptParameter = "rpt_Arrival{"
+ string rptParameter = "rpt_Arrival_Hb{"
+ "100"//閲嶆墦閮芥槸浼�100锛�
+ "," + ""
+ "," + ""
@@ -109,9 +130,43 @@
MsgHelper.ShowError(ex.Message);
}
}
+
+
};
+
+ // --------------------gvMx1 ucBtnPrintOne1 鏄庣粏鎵撳嵃浜嬩欢锛堜紭鍖栫増锛�--------------------
+
+ //涓�閿墦鍗颁簨浠�
+ this.ucBtnPrintOne1.btnPrintClick += (s, e) =>
+ {
+ _print3(101); //涓�閿墦鍗�101
+ };
+ this.ucBtnPrintOne1.btnAllClick += (s, e) =>
+ {
+ string mainGuid = lbGuid.Text.Trim();
+ SelectDeleteBar frm = new SelectDeleteBar(mainGuid, "鎵归噺鏉$爜"); // 鏍囬鍖哄垎鏉ユ簮
+ _print100(mainGuid, frm);//閲嶆墦閮芥槸浼�100锛�
+ };
+
+ // --------------------gvMx3 ucBtnPrintOne2 鍚堝苟鎵归噺鎵撳嵃浜嬩欢锛堜紭鍖栫増锛�--------------------
+
+ //涓�閿墦鍗颁簨浠�
+ this.ucBtnPrintOne2.btnPrintClick += (s, e) =>
+ {
+ _print4(102); //涓�閿悎骞舵墦鍗�102
+ };
+ this.ucBtnPrintOne2.btnAllClick += (s, e) =>
+ {
+ string mainGuid = lbGuid.Text.Trim();
+ SelectDeleteBar frm = new SelectDeleteBar(mainGuid, "鎵归噺鏉$爜"); // 鏍囬鍖哄垎鏉ユ簮
+ _print100(mainGuid, frm);//閲嶆墦閮芥槸浼�100锛�
+ };
+
+ //鏄庣粏琛屽垏鎹簨浠�
+ // 鍏抽敭锛氱粦瀹歡vMx1鍜実vMx3鐨勭劍鐐硅鍙樺寲浜嬩欢
gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
- //鎵撳嵃鑷姩璁$畻
+ gvMx3.FocusedRowChanged += GvMx3_FocusedRowChanged; // 鍙栨秷娉ㄩ噴骞剁粦瀹氫簨浠�
+ //gvMx1鎵撳嵃鑷姩璁$畻
txt_psnQty_1.TextChanged += (s, e) =>
{
Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_1, txt_iCount_1, txt_kQty.Text.Trim(), radOut, txt_yuliang_1);
@@ -120,13 +175,225 @@
{
Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
};
+ // gvMx3鐨勮嚜鍔ㄨ绠�
+ txt_psnQty_2.TextChanged += (s, e) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_2, txt_iCount_2, txt_kQtyHb.Text.Trim(), radOut2, txt_yuliang_2);
+ };
+ radOut2.SelectedIndexChanged += (s, e) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_2, txt_iCount_2, radOut2, txt_yuliang_2);
+ };
+ #endregion
+
+ ////搴曢儴姹囨�诲惎鐢�
+ //gvMx1.OptionsView.ShowFooter = true;
+ //// 涓烘煇涓�鍒楄缃眰鍜屾眹鎬�
+ //gvMx1.Columns["quantity"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
+ //gvMx1.Columns["quantity"].SummaryItem.DisplayFormat = "鍚堣: {0}";
+
+ // 涓轰簡鏂逛究浣跨敤鏁村悎鍒� UtilityHelper 绫讳腑鐨� SetupGridSummary 鏂规硶
+ UtilityHelper.SetupGridSummary(gvMx1, "quantity", "okRkqty");
+ UtilityHelper.SetupGridSummary(gvMxL1, "quantity", "okRkqty");
+ UtilityHelper.SetupGridSummary(gvMx2, "quantity", "okRkqty");
+ UtilityHelper.SetupGridSummary(gvMxL2, "quantity", "okRkqty");
+ UtilityHelper.SetupGridSummary(gvMx3, "quantity", "okRkqty");
+ UtilityHelper.SetupGridSummary(gvMxL3, "quantity", "okRkqty");
+ // 妫�鏌ユ暟鎹姞杞藉悗鍐嶈缃鑹�
+ this.Load += (s, e) =>
+ {
+ System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
+ timer.Interval = 1000; // 1绉掑悗鎵ц锛岀‘淇濇暟鎹凡鍔犺浇
+ timer.Tick += (sender, args) =>
+ {
+ timer.Stop();
+ timer.Dispose();
+
+ // 浣跨敤鏂扮殑绠�鍖栨牸寮忚缃楠岀粨鏋滈鑹�
+ //UtilityHelper.SetSimpleGridColor(gvMxL1, "jyjg", "contains涓嶅悎鏍�", "Cell", Color.Red);
+ //UtilityHelper.SetSimpleGridColor(gvMxL1, "jyjg", "contains鍚堟牸", "Cell", Color.Green);
+ //UtilityHelper.SetSimpleGridColor(gvMxL1, "jyjg", "contains鍏嶆", "Cell", Color.Green);
+
+ //UtilityHelper.SetSimpleGridColor(gvMxL2, "jyjg", "contains涓嶅悎鏍�", "Cell", Color.Red);
+ //UtilityHelper.SetSimpleGridColor(gvMxL2, "jyjg", "contains鍚堟牸", "Cell", Color.Green);
+ //UtilityHelper.SetSimpleGridColor(gvMxL2, "jyjg", "contains鍏嶆", "Cell", Color.Green);
+
+ //UtilityHelper.SetSimpleGridColor(gvMx1, "jyjg", "contains涓嶅悎鏍�", "Cell", Color.Red);
+ //UtilityHelper.SetSimpleGridColor(gvMx1, "jyjg", "contains鍚堟牸", "Cell", Color.Green);
+ //UtilityHelper.SetSimpleGridColor(gvMx1, "jyjg", "contains鍏嶆", "Cell", Color.Green);
+
+ //UtilityHelper.SetSimpleGridColor(gvMx3, "jyjg", "contains涓嶅悎鏍�", "Cell", Color.Red);
+ //UtilityHelper.SetSimpleGridColor(gvMx3, "jyjg", "contains鍚堟牸", "Cell", Color.Green);
+ //UtilityHelper.SetSimpleGridColor(gvMx3, "jyjg", "contains鍏嶆", "Cell", Color.Green);
+
+ // 褰撴敹璐ф暟閲�(quantity)澶т簬宸插叆搴撴暟閲�(okRkqty)鏃讹紝鏁磋鏄剧ず姗欒壊
+ // UtilityHelper.SetSimpleGridColor(gvMx1, "", "quantity-okRkqty>0", "Row", Color.Orange);
+
+ // 褰撳彲鎵撳嵃鏁伴噺(kQty)灏忎簬绛変簬0鏃讹紝鏁磋鏄剧ず鐏拌壊
+ //UtilityHelper.SetSimpleGridColor(gvMx1, "", "kQty<=0", "Row", Color.Gray);
+ //UtilityHelper.SetSimpleGridColor(gridView1, "barRatio", "=100.00%", "Cell", Color.Green);
+ ////鍏ュ簱姣斾緥
+ //UtilityHelper.SetSimpleGridColor(gridView1, "rkbl", "=100.00%", "Cell", Color.Green);
+ };
+ timer.Start();
+ };
+
}
+ /// <summary>
+ /// 鎵撳嵃
+ /// </summary>
+ /// <param name="type">0琛ㄧず棰勮鎵撳嵃锛�1琛ㄧず鐩存帴鎵撳嵃</param>
+ private void _print(int type)
+ {
+ string rowGuid = lbMxGuid.Text.Trim();
+ ucBtnPrint1.guidKey = rowGuid;
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim(), txt_yuliang_1.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑鏉$爜鏁伴噺锛�");
+ txt_iCount_1.Focus();
+ this.ucBtnPrint1.rptParameter = "return false";
+ return;
+ }
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_1.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
+ txt_psnQty_1.Focus();
+ this.ucBtnPrint1.rptParameter = "return false";
+ return;
+ }
+ if (lbMxGuid.Text.Trim().Length < 10)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
+ this.ucBtnPrint1.rptParameter = "return false";
+ return;
+ }
+ this.ucBtnPrint1.rptParameter = "rpt_Arrival{"
+ + lbMxGuid.Text.Trim()//鍏宠仈涓婚敭
+ + "," + ""
+ + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())//浣欐暟
+ + "," + txt_iCount_1.Text.Trim()//寮犳暟
+ + "," + txt_psnQty_1.Text.Trim()//姣忓紶鏉$爜鏁伴噺
+ + "}";
+ txt_iCount_1.Text = "";
+ txt_psnQty_1.Text = "";
+ }
+ private void _print2(int type)
+ {
+ string rowGuid = txt_releaseNo.Text.Trim(); // 鏂板lbMxGuid3鐢ㄤ簬瀛樺偍gvMx3鐨勯�変腑琛孏UID
+ ucBtnPrint2.guidKey = rowGuid;
+
+ // 楠岃瘉杈撳叆锛堜娇鐢╣vMx3瀵瑰簲鐨勮緭鍏ユ帶浠讹級
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_2.Text.Trim(), txt_yuliang_2.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑鏉$爜鏁伴噺锛�");
+ txt_iCount_2.Focus();
+ this.ucBtnPrint2.rptParameter = "return false";
+ return;
+ }
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_2.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
+ txt_psnQty_2.Focus();
+ this.ucBtnPrint2.rptParameter = "return false";
+ return;
+ }
+ if (rowGuid.Length < 10)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
+ this.ucBtnPrint2.rptParameter = "return false";
+ return;
+ }
+
+ // 缁勮鎵撳嵃鍙傛暟锛堜娇鐢╣vMx3鐨勬帶浠跺�硷級
+ this.ucBtnPrint2.rptParameter = "rpt_Arrival_Hb{"
+ + rowGuid//鍏宠仈涓婚敭锛坓vMx3鐨凣UID锛�
+ + "," + ""
+ + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_2.Text.Trim())//浣欐暟
+ + "," + txt_iCount_2.Text.Trim()//寮犳暟
+ + "," + txt_psnQty_2.Text.Trim()//姣忓紶鏉$爜鏁伴噺
+ + "}";
+
+ // 娓呯┖杈撳叆妗�
+ txt_iCount_2.Text = "";
+ txt_psnQty_2.Text = "";
+ }
+ private void _print3(int type)
+ {
+ string mainGuid = lbGuid.Text.Trim();
+ ucBtnPrintOne1.guidKey = mainGuid;
+ this.ucBtnPrintOne1.rptParameter = "rpt_Arrival{"
+ + type
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "}";
+
+ txt_iCount_1.Text = "";
+ txt_psnQty_1.Text = "";
+ }
+ private void _print4(int type)
+ {
+ string mainGuid = lbGuid.Text.Trim();
+ ucBtnPrintOne2.guidKey = mainGuid;
+ this.ucBtnPrintOne2.rptParameter = "rpt_Arrival{"
+ + type
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "}";
+
+ txt_iCount_1.Text = "";
+ txt_psnQty_1.Text = "";
+ }
+ private void _print100(string mainGuid, SelectDeleteBar frm)
+ {
+
+ string strCodeList = "";
+ string strAction = "";
+ frm.UpdateParent += (ss, ee) =>
+ {
+ strCodeList = ee.StringSingle;
+ strAction = ee.Data;
+ };
+ frm.ShowDialog();
+ if (string.IsNullOrEmpty(strCodeList))
+ return;
+ if (strAction == "print")
+ {
+ try
+ {
+ string rptParameter = "rpt_Arrival{"
+ + "100"//閲嶆墦閮芥槸浼�100锛�
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + strCodeList
+ + "}";
+ using (Form rpt = new RptPreview(mainGuid, rptParameter))
+ {
+ rpt.ShowDialog();
+ }
+ frm.Close();
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.ShowError(ex.Message);
+ }
+ }
+ }
+
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
_filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
Task.Delay(100);
getPageList(1);
}
+
+
+
private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
if (e.FocusedRowHandle >= 0)
@@ -155,6 +422,39 @@
txt_iCount_1.Text = "";
}
}
+
+ //鏄庣粏琛屽垏鎹簨浠�
+
+ private void GvMx3_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
+ {
+ if (e.FocusedRowHandle >= 0)
+ {
+ DataRow row = gvMx3.GetDataRow(e.FocusedRowHandle);
+ //lbMxGuid.Text = row["guid"].ToString();
+ txtItemNo.Text = row["itemNo"].ToString();
+ txtItemModel.Text = row["itemModel"].ToString();
+ txtItemName.Text = row["itemName"].ToString();
+ txtQuantityHb.Text = row["quantity"].ToString();//鏈鏀惰揣鎬婚噺
+ txt_yQtyHb.Text = row["yQty"].ToString();//宸叉墦鍗版�婚噺
+ txt_kQtyHb.Text = row["kQty"].ToString(); //鍙墦鍗版�婚噺
+ txt_psnQty_2.Text = row["mrtmsl"].ToString(); //榛樿姣忓紶鏉$爜鏁伴噺
+ txt_releaseNo.Text = row["releaseNo"].ToString(); //鍙墦鍗版�婚噺
+ }
+ else
+ {
+ lbMxGuid.Text = "";
+ ucBtnPrint1.guidKey = "";
+ txtItemNo.Text = "";
+ txtItemModel.Text = "";
+ txtItemName.Text = "";
+ txtQuantityHb.Text = "";
+ txt_yQtyHb.Text = "";
+ txt_kQtyHb.Text = "";
+ txt_psnQty_2.Text = "";
+ txt_iCount_2.Text = "";
+ }
+ }
+
/// <summary>
/// 鍒嗛〉浜嬩欢
/// </summary>
@@ -218,11 +518,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- gcMain1.DataSource = null;
- System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
- _sbSqlWhere.Append(" and a.ReceiveOrgId in");
- _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
- _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
+ gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date",
"asc", "", _sbSqlWhere.ToString());
var json = JsonConvert.SerializeObject(pgq);
@@ -261,7 +557,10 @@
}
private void getModel(string strGuid)
{
+ gcMx3.DataSource = null;
gcMx1.DataSource = null;
+ gcMx2.DataSource = null;
+
bool isEdit = false;
if (toolBarMenu1.currentAction == "add") return;
if (toolBarMenu1.currentAction == "edit") isEdit = true;
@@ -278,6 +577,7 @@
{
string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+
if (_rtn.rtnCode > 0)
{
dynamic dy = _rtn.rtnData;
@@ -285,12 +585,35 @@
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
gvList.Add(gvMx2);
+ gvList.Add(gvMx3);
UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
+
+ JArray array3 = new JArray();
+ foreach (var a in dy["list3"])
+ {
+ array3.Add(a);
+ }
+ DataTable dt3 = JsonConvert.DeserializeObject<DataTable>(array3.ToString());
+ if (dt3.Rows.Count > 0)
+ {
+ gcMx3.BindingContext = new BindingContext();
+ gcMx3.DataSource = dt3;
+ gcMx3.ForceInitialize();
+ gvMx3.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx3);
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx3, gvMx3);
+ }
+
+
JArray array1 = new JArray();
foreach (var a in dy["list1"])
{
array1.Add(a);
}
+
DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString());
if (dt1.Rows.Count > 0)
{
@@ -304,6 +627,7 @@
{
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
}
+
JArray array2 = new JArray();
foreach (var a in dy["list2"])
{
@@ -322,13 +646,102 @@
{
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
}
+
}
+
+
else
- ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ /// <summary>
+ /// 鏂板鏂规硶锛氬垪琛ㄦ樉绀�
+ /// </summary>
+ /// <param name="strGuid">涓昏〃id</param>
+
+ private void getModelList(string strGuid)
+ {
+ gcMxL1.DataSource = null;
+ gcMxL2.DataSource = null;
+ gcMxL3.DataSource = null;
+ var _obj = new
+ {
+ guid = strGuid,//涓诲缓
+ };
+ try
+ {
+ string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
+ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ if (_rtn.rtnCode > 0)
+ {
+ dynamic dy = _rtn.rtnData;
+
+ JArray array1 = new JArray();
+ foreach (var a in dy["list1"])
+ {
+ array1.Add(a);
+ }
+ DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString());
+ if (dt1.Rows.Count > 0)
+ {
+ gcMxL1.BindingContext = new BindingContext();
+ gcMxL1.DataSource = dt1;
+ gcMxL1.ForceInitialize();
+ gvMxL1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL1);
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL1, gvMxL1);
+ }
+ JArray array2 = new JArray();
+ foreach (var a in dy["list3"])
+ {
+ array2.Add(a);
+ }
+
+ DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString());
+ if (dt2.Rows.Count > 0)
+ {
+ gcMxL2.BindingContext = new BindingContext();
+ gcMxL2.DataSource = dt2;
+ gcMxL2.ForceInitialize();
+ gvMxL2.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL2);
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL2, gvMxL2);
+ }
+ JArray array3 = new JArray();
+ foreach (var a in dy["list2"])
+ {
+ array3.Add(a);
+ }
+ DataTable dt3 = JsonConvert.DeserializeObject<DataTable>(array3.ToString());
+ if (dt3.Rows.Count > 0)
+ {
+ gcMxL3.BindingContext = new BindingContext();
+ gcMxL3.DataSource = dt3;
+ gcMxL3.ForceInitialize();
+ gvMxL3.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL3);
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL3, gvMxL3);
+ }
+ }
+ else
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ catch (Exception ex)
+ {
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
--
Gitblit v1.9.3