From efce6f32ed2631903727a9919b681f4ab5fac346 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 17 十二月 2024 08:08:27 +0800
Subject: [PATCH] 1
---
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs | 248 ++++++++++++++++++++++++------------------------
1 files changed, 124 insertions(+), 124 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs
index f30402e..e4a9323 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs
@@ -1,7 +1,6 @@
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
+using Gs.DevApp.UserControl;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
@@ -14,19 +13,16 @@
{
public partial class Frm_MesInvItemIns : DevExpress.XtraEditors.XtraForm
{
- string _webServiceName = "User/";
+ string _webServiceName = "MesInvItemInsManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
public Frm_MesInvItemIns()
{
InitializeComponent();
- 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;
+ toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+ toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+
getPageList(1, UtilityHelper.GetPageSize());
pageBar1.PagerEvent += PageBar1_PagerEvent;
gridView1.CustomDrawRowIndicator += (s, e) =>
@@ -88,49 +84,98 @@
}
/// <summary>
- /// 鍙栨秷浜嬩欢
+ /// 瀹℃牳浜嬩欢
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
- private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
+ private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- }
-
- /// <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_billNo, gridView1);
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_billNo, gridView1);
+ //toolBarMenu1.guidKey = rowGuid;
if (string.IsNullOrEmpty(rowGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
- return;
- List<dynamic> lst = new List<dynamic>();
- lst.Add(rowGuid);
- var _obj = lst;
+ var _obj = new
+ {
+ guid = rowGuid,
+ };
try
{
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ var strJson = UtilityHelper.HttpPost("",
+ _webServiceName + "EditModelSubmit",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ getModel(lbGuid.Text.Trim(), false, 999);
+ else
+ getPageList(1, UtilityHelper.GetPageSize());
}
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ else
+ {
+ 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>
+ /// <exception cref="NotImplementedException"></exception>
+ private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+ {
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_billNo, gridView1);
+ // toolBarMenu1.guidKey = rowGuid;
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+ //MsgHelper.Warning(rowGuid);
+
+ var _obj = new
+ {
+ guid = rowGuid,
+ };
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("",
+ _webServiceName + "DeApprove",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ if (_rtn.rtnCode > 0)
+ {
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ getModel(lbGuid.Text.Trim(), false, 999);
+ else
+ getPageList(1, UtilityHelper.GetPageSize());
+ }
+ else
+ {
+ MsgHelper.Warning(_rtn.rtnMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+
}
/// <summary>
@@ -140,84 +185,19 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
- if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
- else
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ getModel(lbGuid.Text.Trim(), false, 999);
+ else
+ getPageList(1, UtilityHelper.GetPageSize());
}
- /// <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_billNo, gridView1);
- if (string.IsNullOrEmpty(rowGuid))
- {
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
- return;
- }
- getModel(rowGuid, true, 1);
- }
- /// <summary>
- /// 鏂板浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
- {
- UtilityHelper.JumpToTab(xtraTabControl1, 1);
- lbGuid.Text = "";
- List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
- gridViews.Add(gvMx1);
- UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
- Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
- }
- /// <summary>
- /// 淇濆瓨浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
- {
- toolBarMenu1.isSetBtn = false;
- //if (string.IsNullOrEmpty(txt_account.Text.Trim()))
- {
- Gs.DevApp.ToolBox.MsgHelper.Warning("鐧诲綍璐﹀彿涓嶈兘涓虹┖锛�");
- // txt_account.Focus();
- return;
- }
- var _obj = new
- {
- guid =UtilityHelper.ToGuid( lbGuid.Text.Trim()), //涓诲缓
- };
- try
- {
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
- if (_rtn.rtnCode > 0)
- {
- lbGuid.Text = _rtn.rtnData;
- toolBarMenu1.isSetBtn = true;
- UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
- }
- }
- catch (Exception ex)
- {
- ToolBox.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, int pageSize)
{
+
System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
foreach (FilterEntity itm in _filterList)
{
@@ -230,29 +210,29 @@
string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
if (dd.rtnCode > 0)
- {
- 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();
- }
- else
- {
- ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
- }
+ {
+ 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.setTxt();
+ }
+ else
+ {
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
+ }
}
catch (Exception ex)
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
+
}
- private void getModel(string strGuid, bool isEdit, int tabIdx)
+ private void getModel(string strGuid, bool isEdit, int tabIdx)
{
if (string.IsNullOrEmpty(strGuid))
{
@@ -260,13 +240,14 @@
return;
}
UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
+
var _obj = new
{
guid = strGuid,//涓诲缓
};
try
{
- string strJson = UtilityHelper.HttpPost("", _webServiceName +"GetModel", JsonConvert.SerializeObject(_obj));
+ string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
@@ -274,6 +255,7 @@
lbGuid.Text = strGuid;
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
+ gvList.Add(gvMx2);
UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
@@ -292,6 +274,23 @@
{
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
}
+
+ JArray array2 = new JArray();
+ foreach (var a in _job["rtnData"]["list2"])
+ {
+ array2.Add(a);
+ }
+ DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString());
+ if (dt.Rows.Count > 0)
+ {
+ gcMx2.BindingContext = new BindingContext();
+ gcMx2.DataSource = dt2;
+ gcMx2.ForceInitialize();
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
+ }
}
else
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -300,6 +299,7 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
+
}
}
}
\ No newline at end of file
--
Gitblit v1.9.3