1
lu
2024-12-06 4fcc278c745fe6801c82622e34b2ce2cb150a44c
DevApp/Gs.DevApp/ToolBox/UtilityHelper.cs
@@ -14,6 +14,7 @@
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.RichEdit.Export;
using DevExpress.XtraBars.Customization;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid;
@@ -21,6 +22,7 @@
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraTab;
using DevExpress.XtraTreeList;
using DevExpress.XtraWaitForm;
using Gs.DevApp.Entity;
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
@@ -105,7 +107,10 @@
        /// <returns></returns>
        public static string HttpPost(string url, string meth, string param)
        {
            DevExpress.Utils.WaitDialogForm wdf = new DevExpress.Utils.WaitDialogForm("拼命加载中,请稍后..." + meth, "友情提示");
            string _caption = "拼命加载中,请稍后...";
            DevExpress.Utils.WaitDialogForm wdf = new DevExpress.Utils.WaitDialogForm(_caption + meth, "友情提示");
            wdf.BackColor = System.Drawing.Color.LightSkyBlue;
            wdf.Padding = new Padding(15);
            HttpWebRequest request = null;
            StreamWriter requestStream = null;
            WebResponse response = null;
@@ -123,23 +128,27 @@
                request.Timeout = 15000;
                request.AllowAutoRedirect = false;
                request.ServicePoint.Expect100Continue = false;
                wdf.SetCaption("加载进度(10/100)");
                wdf.SetCaption(_caption+"(10/100)" + meth);
                HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
                request.CachePolicy = noCachePolicy;
                wdf.SetCaption("加载进度(20/100)");
                wdf.SetCaption(_caption + "(20/100)" + meth);
                requestStream = new StreamWriter(request.GetRequestStream());
                requestStream.Write(param);
                requestStream.Close();
                wdf.SetCaption(_caption + "30/100)" + meth);
                response = request.GetResponse();
                wdf.SetCaption(_caption + "(40/100)");
                if (response != null)
                {
                    wdf.SetCaption(_caption + "(50/100)" + meth);
                    var reader = new StreamReader(response.GetResponseStream(),
                        Encoding.UTF8);
                    responseStr = reader.ReadToEnd();
                    //File.WriteAllText(Server.MapPath("~/") + @"\test.txt", responseStr); 
                    reader.Close();
                    wdf.SetCaption(_caption + "(60/100)" + meth);
                }
                wdf.SetCaption("加载进度(80/100)");
                wdf.SetCaption(_caption + "(80/100)" + meth);
            }
            catch (Exception ex)
            {
@@ -153,7 +162,7 @@
                requestStream = null;
                response = null;
            }
            wdf.SetCaption("加载进度(90/100)");
            wdf.SetCaption(_caption + "(90/100)");
            wdf.Close();
            return responseStr;
        }
@@ -203,7 +212,7 @@
            var dt = new DataTable();
            foreach (GridColumn col in gv.Columns)
            {
                if (col.UnboundDataType == typeof(bool))
                if (col.UnboundDataType == typeof(System.Boolean))
                    dt.Columns.Add(col.FieldName, typeof(System.Boolean));
                else
                {