From ec44b893b2d267cc84d0aa44c65621c53f504dbc Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期三, 24 九月 2025 10:42:00 +0800
Subject: [PATCH] 增加考勤表导出功能
---
DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MesAttanCon.cs | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MesAttanCon.cs b/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MesAttanCon.cs
index 58b8491..93fce10 100644
--- a/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MesAttanCon.cs
+++ b/DevApp/Gs.DevApp/DevFrm/JJGZ/Frm_MesAttanCon.cs
@@ -11,9 +11,11 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
+using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -43,6 +45,7 @@
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
this.toolBarMenu1.btnGongZiClick += ToolBarMenu1_btnGongZiClick;
this.toolBarMenu1.btnLianBanClick += ToolBarMenu1_btnLianBanClick;
+ this.toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick;
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gridView2);
@@ -559,5 +562,49 @@
MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
+
+ private void ToolBarMenu1_btnOutClick(object sender, EventArgs e)
+ {
+ using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+ {
+ folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+ DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+ if (dialogResult == DialogResult.OK)
+ {
+ string _folder = folderBrowserDialog.SelectedPath;
+ var _params = new
+ {
+ inLineNo = lineNo,//涓诲缓
+ inDate = date,
+ inOrgId = orgId
+ };
+ var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOut_AttanCon", "", "", "", _params);
+ try
+ {
+ string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView_NEW", JsonConvert.SerializeObject(_obj));
+ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ if (_rtn.rtnCode > 0)
+ {
+ string _file = _rtn.rtnData.fileUrl.ToString();
+ string _folderName = _folder + "\\" + _file.Replace("down/", "");
+ string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file;
+ using (WebClient client = new WebClient())
+ {
+ client.DownloadFile(_url, _folderName);
+ }
+ ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�");
+ }
+ else
+ {
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3