| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | /// <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; |
| | |
| | | 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) |
| | | { |
| | |
| | | requestStream = null; |
| | | response = null; |
| | | } |
| | | wdf.SetCaption("加载进度(90/100)"); |
| | | wdf.SetCaption(_caption + "(90/100)"); |
| | | wdf.Close(); |
| | | return responseStr; |
| | | } |
| | |
| | | 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 |
| | | { |