From 6ceeba7c1e8903c850d125a4823cc36507e43de9 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 26 十一月 2024 16:50:41 +0800
Subject: [PATCH] 排产
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs | 589 ++++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 380 insertions(+), 209 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
index 61561e9..1d8f5aa 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
@@ -1,9 +1,4 @@
-锘縰sing DevExpress.Pdf.Native.BouncyCastle.Asn1.Pkcs;
-using DevExpress.Utils.VisualEffects;
-using DevExpress.XtraGrid.Views.Base.ViewInfo;
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
-using Gs.DevApp.Entity;
+锘縰sing Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
@@ -13,9 +8,7 @@
using System.Configuration;
using System.Data;
using System.Drawing;
-using System.IO;
-using System.Net.Http;
-using System.Threading.Tasks;
+using System.Net;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm.QC
@@ -27,19 +20,19 @@
public Frm_MesQaItemsDetect01Check()
{
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.btnEdtClick += ToolBarMenu1_btnEdtClick;
+ this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
this.toolBarMenu1.btnZhiLiangChkClick += ToolBarMenu1_btnZhiLiangChkClick;
this.toolBarMenu1.btnZhiLiangFchkClick += ToolBarMenu1_btnZhiLiangFchkClick;
this.toolBarMenu1.btnCaiGouChkClick += ToolBarMenu1_btnCaiGouChkClick;
this.toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick;
+ this.toolBarMenu1.btnBoHuiClick += ToolBarMenu1_btnBoHuiClick;
+ toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
- gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
+ gcMx1.MouseClick += GcMx1_MouseClick;
getPageList(1, UtilityHelper.GetPageSize());
pageBar1.PagerEvent += PageBar1_PagerEvent;
gridView1.CustomDrawRowIndicator += (s, e) =>
@@ -56,16 +49,27 @@
Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
e.Graphics.DrawString(str, f, Brushes.Gray, r);
};
- //涓婁紶闄勪欢
- btnUpSelect.Click += BtnUpSelect_Click;
- btnUp.Click += BtnUp_Click;
//鍒濆鍖栫墿鏂欓�夋嫨鍜屽悇绉嶄笅鎷�
gvMx2.OptionsFind.ShowSearchNavButtons = false;
gvMx2.OptionsView.ShowGroupPanel = false;
- _setIno();
+ gvMx3.OptionsFind.ShowSearchNavButtons = false;
+ gvMx3.OptionsView.ShowGroupPanel = false;
+ txt_itemId.KeyFile = "id";
+ txt_itemId.EditChanged += (s, e) =>
+ {
+ txt_itemModel.Text = this.txt_itemId.GetModel();
+ txt_itemNo.Text = this.txt_itemId.GetCode();
+ };
+ ucUpFile1.UpChanged += UcUpFile1_UpChanged;
+ xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged;
}
-
-
+ private void GcMx1_MouseClick(object sender, MouseEventArgs e)
+ {
+ string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid");
+ if (string.IsNullOrEmpty(rowGuid))
+ return;
+ getList12(rowGuid);
+ }
/// <summary>
/// 鍙屽嚮浜嬩欢
/// </summary>
@@ -107,7 +111,7 @@
_filterList = e.FilterList;
getPageList(1, pageBar1.RowsCount);
}
- private void ToolBarMenu1_btnCaiGouFchkClick(object sender, EventArgs e)
+ private void ToolBarMenu1_btnLogClick(object sender, EventArgs e)
{
toolBarMenu1.guidKey = "";
string rowGuid, rowName;
@@ -115,34 +119,6 @@
lbGuid, txt_releaseNo, gridView1);
toolBarMenu1.guidKey = rowGuid;
}
-
- private void ToolBarMenu1_btnCaiGouChkClick(object sender, EventArgs e)
- {
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_releaseNo, gridView1);
- toolBarMenu1.guidKey = rowGuid;
- }
-
- private void ToolBarMenu1_btnZhiLiangFchkClick(object sender, EventArgs e)
- {
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_releaseNo, gridView1);
- toolBarMenu1.guidKey = rowGuid;
- }
-
- private void ToolBarMenu1_btnZhiLiangChkClick(object sender, EventArgs e)
- {
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_releaseNo, gridView1);
- toolBarMenu1.guidKey = rowGuid;
- }
-
/// <summary>
/// 鍙栨秷浜嬩欢
/// </summary>
@@ -152,84 +128,6 @@
{
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_releaseNo, gridView1);
- if (string.IsNullOrEmpty(rowGuid))
- {
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
- return;
- }
- if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
- return;
- List<dynamic> lst = new List<dynamic>();
- lst.Add(rowGuid);
- var _obj = lst;
- try
- {
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0)
- {
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
- }
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
- }
- catch (Exception ex)
- {
- ToolBox.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());
- }
- /// <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_releaseNo, 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);
- gridViews.Add(gvMx2);
- UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
- Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
- }
/// <summary>
/// 淇濆瓨浜嬩欢
/// </summary>
@@ -238,15 +136,23 @@
private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
{
toolBarMenu1.isSetBtn = false;
- //if (string.IsNullOrEmpty(txt_account.Text.Trim()))
+ if (string.IsNullOrEmpty(txt_fngHandle.Text.Trim()))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("鐧诲綍璐﹀彿涓嶈兘涓虹┖锛�");
- // txt_account.Focus();
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨澶勭悊鏂瑰紡锛�");
+ txt_fngDesc.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(txt_fmrmode.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨閫�鏂欐柟寮忥紒");
+ txt_fmrmode.Focus();
return;
}
var _obj = new
{
guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+ fngHandle = txt_fngHandle.Text.Trim(),
+ fmrmode = txt_fmrmode.Text.Trim(),
};
try
{
@@ -264,6 +170,211 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
+ }
+
+ /// <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_releaseNo, 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_btnBoHuiClick(object sender, EventArgs e)
+ {
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_releaseNo, gridView1);
+ toolBarMenu1.guidKey = rowGuid;
+
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾瑕侀┏鍥炲悧锛�"))
+ return;
+
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit13",
+ JsonConvert.SerializeObject(rowGuid));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ /// <summary>
+ /// 閲囪喘鍙嶅鏍�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnCaiGouFchkClick(object sender, EventArgs e)
+ {
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_releaseNo, gridView1);
+ toolBarMenu1.guidKey = rowGuid;
+
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾瑕侀噰璐弽瀹℃牳鍚楋紵"))
+ return;
+
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit12",
+ JsonConvert.SerializeObject(rowGuid));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ /// <summary>
+ /// 閲囪喘瀹℃牳
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnCaiGouChkClick(object sender, EventArgs e)
+ {
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_releaseNo, gridView1);
+ toolBarMenu1.guidKey = rowGuid;
+
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾瑕侀噰璐鏍稿悧锛�"))
+ return;
+
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcCGAudit",
+ JsonConvert.SerializeObject(rowGuid));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ /// <summary>
+ /// 璐ㄩ噺鍙嶅鏍�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnZhiLiangFchkClick(object sender, EventArgs e)
+ {
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_releaseNo, gridView1);
+ toolBarMenu1.guidKey = rowGuid;
+
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾璐ㄩ噺瀹℃牳鍚楋紵"))
+ return;
+
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit11",
+ JsonConvert.SerializeObject(rowGuid));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ /// <summary>
+ /// 璐ㄩ噺瀹℃牳
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnZhiLiangChkClick(object sender, EventArgs e)
+ {
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_releaseNo, gridView1);
+ toolBarMenu1.guidKey = rowGuid;
+
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾璐ㄩ噺瀹℃牳鍚楋紵"))
+ return;
+
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit",
+ JsonConvert.SerializeObject(rowGuid));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+
+ /// <summary>
+ /// 鍒锋柊浜嬩欢
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <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());
}
/// <summary>
@@ -309,7 +420,7 @@
}
_loading.Stop();
}
- private void getModel(string strGuid, bool isEdit, int tabIdx)
+ private async void getModel(string strGuid, bool isEdit, int tabIdx)
{
if (string.IsNullOrEmpty(strGuid))
{
@@ -317,13 +428,14 @@
return;
}
UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
+ UcLoading _loading = new UcLoading();
var _obj = new
{
guid = strGuid,//涓诲缓
};
try
{
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
+ string strJson = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
@@ -334,7 +446,7 @@
UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
- foreach (var a in _job["rtnData"]["list"])
+ foreach (var a in _job["rtnData"]["list5"])
{
array.Add(a);
}
@@ -344,6 +456,8 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
+ ucUpFile1.parentGuid = lbGuid.Text.Trim();
+ getList12(dt.Rows[0]["guid"].ToString());
}
else
{
@@ -357,99 +471,71 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
+ _loading.Stop();
}
-
-
-
- #region 鏂囦欢涓婁紶
-
/// <summary>
- /// 閫夋嫨涓婁紶鏂囦欢
+ /// 閫夐」鍗″垏鎹�
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
- private void BtnUpSelect_Click(object sender, EventArgs e)
+ private void XtraTabControl2_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e)
{
- var openFileDialog = new OpenFileDialog();
- // 璁剧疆鍒濆鐩綍
- openFileDialog.InitialDirectory = "c:\\";
- // 璁剧疆鏂囦欢杩囨护閫夐」锛屽锛�"鏂囨湰鏂囦欢 (*.txt)|*.txt|鎵�鏈夋枃浠� (*.*)|*.*"
- openFileDialog.Filter = "鏂囨湰鏂囦欢 (*.txt)|*.txt|鎵�鏈夋枃浠� (*.*)|*.*";
- // 璁剧疆鏍囬
- openFileDialog.Title = "閫夋嫨鏂囦欢";
- // 鏄剧ず瀵硅瘽妗�
- var result = openFileDialog.ShowDialog();
- // 纭鐢ㄦ埛娌℃湁鍙栨秷鎿嶄綔
- if (result == DialogResult.OK)
+ if (e.Page.Name == "tabMxPage3")
{
- // 鑾峰彇閫変腑鐨勬枃浠惰矾寰�
- var filePath = openFileDialog.FileName;
- Console.WriteLine($"閫変腑鐨勬枃浠�: {filePath}");
- txtUpUrl.Text = filePath;
+ getFileList();
}
}
-
/// <summary>
- /// 纭畾涓婁紶
+ /// 涓婁紶鍚庡埛鏂版枃浠跺垪琛�
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
- private async void BtnUp_Click(object sender, EventArgs e)
+ private void UcUpFile1_UpChanged(object sender, EventArgs e)
{
- var WebApiUrl = ConfigurationSettings.AppSettings.Get("WebApiUrl");
- var address = WebApiUrl + "Upload/UploadFile";
- var filePath = txtUpUrl.Text.Trim();
- var apiUrl = address; // 鏇挎崲涓轰綘鐨凙PI鍦板潃
- await UploadFileAsync(apiUrl, filePath);
+ getFileList();
}
-
- private async Task UploadFileAsync(string url, string filePath)
+ private void getFileList()
{
- UcLoading _loading = new UcLoading();
- using (var httpClient = new HttpClient())
- using (var form = new MultipartFormDataContent())
- {
- httpClient.DefaultRequestHeaders.Add("token",
- UtilityHelper.GetBasicAuthTicket());
- using (var fs = File.OpenRead(filePath))
- using (var streamContent = new StreamContent(fs))
- {
- form.Add(streamContent, "file", Path.GetFileName(filePath));
- var response = await httpClient.PostAsync(url, form);
- var responseString =
- await response.Content.ReadAsStringAsync();
- MessageBox.Show(responseString);
- }
- }
- _loading.Close();
- }
-
- #endregion
-
- private void _setIno()
- {
- txt_itemId.KeyFile = "id";
- txt_itemId.EditChanged += (s, e) =>
- {
- txt_itemModel.Text = this.txt_itemId.GetModel();
- txt_itemNo.Text = this.txt_itemId.GetCode();
- };
- }
- /// <summary>
- /// 璇诲彇妫�楠岀粨鏋�
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
- {
- var rowGuid = "";
- var myDataRow = gvMx1.GetDataRow(e.FocusedRowHandle);
- if (myDataRow == null) return;
- rowGuid = myDataRow["id"].ToString();
- var json = JsonConvert.SerializeObject(rowGuid);
+ System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+ _sbSqlWhere.Append(" and parent_Guid='" + lbGuid.Text.Trim() + "'");
+ PageQueryModel pgq = new PageQueryModel(1, 100, "create_date", "asc", "", _sbSqlWhere.ToString());
+ string json = JsonConvert.SerializeObject(pgq);
try
{
- var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetCheckResultList", json);
+ string strReturn = UtilityHelper.HttpPost("", "MesFile/GetListPage", json);
+ ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
+ if (dd.rtnCode > 0)
+ {
+ DataTable dt = dd.rtnData.list;
+ gcMx3.BindingContext = new BindingContext();
+ gcMx3.DataSource = dt;
+ gcMx3.ForceInitialize();
+ }
+ else
+ {
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ /// <summary>
+ /// 鏍规嵁妫�楠岄」鐩鍙栨娊鏍风粨鏋�
+ /// </summary>
+ /// <param name="guid5"></param>
+ private async void getList12(string guid5)
+ {
+ UcLoading _loading = new UcLoading();
+ var _obj = new
+ {
+ parentGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
+ guid = UtilityHelper.ToGuid(guid5), //涓诲缓
+ };
+ try
+ {
+ var strReturn = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetModel12", JsonConvert.SerializeObject(_obj));
var dd = UtilityHelper.ReturnToList(strReturn);
var dt = dd.rtnData;
gcMx2.BindingContext = new BindingContext();
@@ -460,8 +546,93 @@
{
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
+ _loading.Stop();
+ }
+ private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+ {
+ var rowhandle = gvMx3.FocusedRowHandle;
+ if (rowhandle < 0)
+ return;
+ if (e.Button.Index == 0)
+ {
+ var dr = gvMx3.GetDataRow(rowhandle);
+ var mxGuid = dr["guid"].ToString();
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
+ return;
+ var strJson = "";
+ var lst = new List<string>();
+ lst.Add(mxGuid);
+ try
+ {
+ strJson = UtilityHelper.HttpPost("", "MesFile/DeleteModel",
+ JsonConvert.SerializeObject(lst));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ if (_rtn.rtnCode > 0) gvMx3.DeleteRow(rowhandle);
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ }
+ private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+ {
+ var rowhandle = gvMx3.FocusedRowHandle;
+ if (rowhandle < 0)
+ return;
+ if (e.Button.Index == 0)
+ {
+ try
+ {
+ var dr = gvMx3.GetDataRow(rowhandle);
+ var urlPath = dr["urlPath"].ToString();
+ Gs.DevApp.UserControl.ShowFile frm = new ShowFile(urlPath);
+ frm.ShowDialog();
+ }
+ catch (Exception ex)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
+ }
+
+ }
}
-
+ private void repositoryItemButtonEdit3_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+ {
+ var rowhandle = gvMx3.FocusedRowHandle;
+ if (rowhandle < 0)
+ return;
+ if (e.Button.Index == 0)
+ {
+ try
+ {
+ var dr = gvMx3.GetDataRow(rowhandle);
+ var urlPath = dr["urlPath"].ToString();
+ using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+ {
+ folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+ DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+ if (dialogResult == DialogResult.OK)
+ {
+ string _folder = folderBrowserDialog.SelectedPath;
+ string _folderName = _folder + "\\" + urlPath;
+ string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + "upload/" + urlPath;
+ using (WebClient client = new WebClient())
+ {
+ client.DownloadFile(_url, _folderName);
+ }
+ ToolBox.MsgHelper.ShowInformation("涓嬭浇鎴愬姛锛�");
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
+ }
+
+ }
+
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3