智云外网版WMS\MES\SCM(作废)
jhz
2023-01-02 9bf1acf98038b905831a56e438517ffda4a12911
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
using System;
using System.Collections.Generic;
using System.Text;
using DBUtility;
using System.Data;
using Pub_Class;
using System.Windows.Forms;
using System.Drawing;
 
namespace SCM
{
    public class ClsPub1
    {
        //public static string WEBSURL = "http://124.70.129.242/WEBS-WMS/WebService1.asmx";             //雅琪诺
        //public static string WEBSURL = "http://192.168.1.29/WEBS-WMS/WebService1.asmx";               //圣龙    内网
        //public static string WEBSURL = "http://122.227.138.236/WEBS-WMS/WebService1.asmx";            //圣龙(不用)
        //public static string WEBSURL = "http://220.189.218.154:8092/WEBS-WMS/WebService1.asmx";   //四维尔    新中间层    外网
        //public static string WEBSURL = "http://192.168.0.178/WEBS-WMS/WebService1.asmx";          //四维尔    新中间层    内网
        //public static string WEBSURL = "http://122.227.199.62:5050/LMESWEBS/WebService1.asmx";        //韩电    外网JIT(不用)
        //public static string WEBSURL = "http://122.227.199.62:5050/WMSWEBS/WebService1.asmx";         //韩电    外网
        //public static string WEBSURL = "http://192.168.10.60/WMSWEBS/WebService1.asmx";               //韩电    内网宁波
        //public static string WEBSURL = "http://60.190.50.86:5050/WEBS_CE/WebService1.asmx";           //飞龙
        //public static string WEBSURL = "http://192.192.192.13/WMSWEBS/WebService1.asmx";              //卓力
        //public static string WEBSURL = "http://120.195.29.36:1230/WEBS-WMS/WebService1.asmx";         //江苏龙亨
        public static string WEBSURL = "http://60.191.27.141:8090/WEBS-WMS/WebService1.asmx";         //森楷
        //public static string WEBSURL = "http://192.168.63.195/WEBS-WMS/WebService1.asmx";
        //public static string WEBSURL = "http://192.168.2.18/WEBS-WMS/WebService1.asmx";              //公司台式机
        //public static string WEBSURL = "http://192.168.0.107/WEBS-WMS/WebService1.asmx";              //家
 
        //public static string WEBSURL = "http://47.96.97.237/WEBS-WMS/WebService1.asmx";              //公司服务器
        public static long HOrgID = 0;
        public static string HOrgNumber = "";
        public static long HPersonL = 2;   // 仓库人员为1,车间人员为2
        public static long HPersonWHID = 100225;   // 车间人员绑定的仓库ID
        public static string VersionNew = "";
        public static string VersionOld = "";
        public static SCM.WMSWeb.WebService1 PubWeb = new SCM.WMSWeb.WebService1();
        
        public static string CreateBillCode(string BillCode, ref string sReturn, bool Add)
        {
            SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
            oWeb.Url = ClsPub1.WEBSURL;
            Int64 BillCodeMode;
            string Profix;
            Int64 Glida;
            Int32 CodeLen;
            string sBillNo = "";
            char c = Convert.ToChar("0");
            string sKjYear = DateTime.Today.Year.ToString();
            string sPeriod = DateTime.Today.Month.ToString();
            string sDay = DateTime.Today.Day.ToString();
            //得到单据号表 信息
            //ClsOracleHelper oCn = new ClsOracleHelper();
            DataSet Ds = new DataSet();
            Ds = oWeb.getDataSetBySQL("Select * from Gy_BillNumber where BillCode='" + BillCode.Trim() + "'", "Gy_BillNumber", ref DBUtility.ClsPub.sExeReturnInfo);
            if (Ds.Tables[0].Rows.Count != 0)
            {
                BillCodeMode = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["BillCodeMode"].ToString());
                Profix = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["Profix"].ToString());
                Glida = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["Glida"].ToString());
                CodeLen = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["CodeLen"].ToString());
            }
            else
            {
                return "";
            }
            //
            string sStr;
            switch (BillCodeMode)
            {
                case 0:
                    switch (Glida)
                    {
                        case 0:
                            Ds = oWeb.getDataSetBySQL("Select * from Gy_MaxNum where BillCode='" + BillCode.Trim() + "'", "Gy_MaxNum", ref DBUtility.ClsPub.sExeReturnInfo);
                            if (Ds.Tables[0].Rows.Count != 0)
                            {
                                sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["NowNumBer"].ToString()).Length);
                                sBillNo = Profix.Trim() + sStr + Ds.Tables[0].Rows[0]["NowNumBer"].ToString().Trim();
                            }
                            else //插入新记录
                            {
                                sStr = new string(c, CodeLen - 1);
                                oWeb.getRunProc("insert into Gy_MaxNum(BillCode,NowNumber) values('" + BillCode.Trim() + "',1)", ref DBUtility.ClsPub.sExeReturnInfo);
                                sBillNo = Profix.Trim() + sStr + 1;
                            }
                            if (Add == true)
                            {
                                oWeb.getRunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "'", ref DBUtility.ClsPub.sExeReturnInfo);
                            }
                            return sBillNo;
 
                        case 1:
                            return sBillNo;
 
                        case 2:      //当前年当前期间 生成单据号
                            Ds = oWeb.getDataSetBySQL("Select * from Gy_MaxNum where BillCode='" + BillCode.Trim() + "' and KjYear=" + sKjYear + " and Period=" + sPeriod + " and Day=" + sDay, "Gy_MaxNum", ref DBUtility.ClsPub.sExeReturnInfo);
                            if (Ds.Tables[0].Rows.Count != 0)
                            {
                                sStr = new string(c, CodeLen - (Ds.Tables[0].Rows[0]["NowNumBer"].ToString()).Length);
                                sBillNo = Profix.Trim() + sKjYear + DBUtility.ClsPub.isStrNull(("0" + sPeriod)).Substring(DBUtility.ClsPub.isStrNull(("0" + sPeriod)).Length - 2, 2) + DBUtility.ClsPub.isStrNull(("0" + sDay)).Substring(DBUtility.ClsPub.isStrNull(("0" + sDay)).Length - 2, 2) + sStr + Ds.Tables[0].Rows[0]["NowNumBer"].ToString().Trim();
                            }
                            else //插入新记录
                            {
                                sStr = new string(c, CodeLen - 1);
                                oWeb.getRunProc("insert into Gy_Maxnum(BillCode,Kjyear,Period,Day,NowNumber)  values('" + BillCode.Trim() + "'," + sKjYear + "," + sPeriod + "," + sDay + ",1)", ref DBUtility.ClsPub.sExeReturnInfo);
                                sBillNo = Profix.Trim() + sKjYear + DBUtility.ClsPub.isStrNull(("0" + sPeriod)).Substring(DBUtility.ClsPub.isStrNull(("0" + sPeriod)).Length - 2, 2) + DBUtility.ClsPub.isStrNull(("0" + sDay)).Substring(DBUtility.ClsPub.isStrNull(("0" + sDay)).Length - 2, 2) + sStr + 1;
                            }
                            if (Add == true)
                            {
                                oWeb.getRunProc("update Gy_Maxnum set NowNumBer=NowNumBer+1 where BillCode='" + BillCode.Trim() + "' and KjYear=" + sKjYear + " and Period=" + sPeriod + " and Day=" + sDay, ref DBUtility.ClsPub.sExeReturnInfo);
                            }
                            return sBillNo;
                        default:
                            return sBillNo;
 
                    }
 
                case 1:
                    return sBillNo;
 
                default:
                    return sBillNo;
 
            }
        }
 
 
        public static Int64 CreateBillID(string BillCode, ref string sReturn)
        {
            SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
            oWeb.Url = WEBSURL;
            string BillType = "";
            DataSet Ds;
            //ClsOracleHelper oCn = new ClsOracleHelper();
            Int64 lID;
            Ds = oWeb.getDataSetBySQL("select * from Gy_BillNumber with (nolock) where BillCode='" + BillCode.Trim() + "'", "Gy_BillNumber", ref DBUtility.ClsPub.sExeReturnInfo);
            if (Ds.Tables[0].Rows.Count != 0)
            {
                lID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["IDNow"].ToString());
                BillType = Ds.Tables[0].Rows[0]["BillType"].ToString().Trim();
            }
            else
            {
                lID = 0;
            }
            //同类型单据 自增1
            if (BillType.Trim() != "")
            {
                oWeb.getRunProc("update Gy_BillNumber set IDNow=IDNow+1 where BillType='" + BillType.Trim() + "'", ref DBUtility.ClsPub.sExeReturnInfo);
            }
            Ds = null;
            return lID;
        }
 
        //
        //检验 最新版本
        public static bool CheckUpdate()
        {
 
            SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
            oWeb.Url = ClsPub1.WEBSURL;
            DataSet oDs = new DataSet();
            //ClsSqlHelperMaster oCn = new ClsSqlHelperMaster();
            string LastNumber1 = "";
            string LastNumber2 = "";
            string BbNumber = "";      
            string sTableName = "";
            //得到更新表
            sTableName = ClsIni.ReadIni("UpDateCounts", "sTableName", Pub_Class.ClsPub.AppPath + @"\" + "UpDatePrj.ini");
            if (sTableName == "没有找到!" || sTableName == "")
            {
                sTableName = "HX_UPdateForWInce";
            }
            //得到最新版本
            try
            {
                oDs = oWeb.getDataSetBySQL("select top 1 * from master.." + sTableName + " order by FItemID", sTableName, ref DBUtility.ClsPub.sExeReturnInfo);
                if (oDs == null || oDs.Tables[0].Rows.Count == 0)
                {
                    return false;
                }
                else
                {
                    LastNumber1 = oDs.Tables[0].Rows[0]["FNumber"].ToString().Trim();
                    VersionNew = LastNumber1;
                }
                //得到本地版本
                LastNumber2 = ClsIni.ReadIni("UpDateCounts", "LastUpdateID", Pub_Class.ClsPub.AppPath + @"\" + "UpDatePrj.ini");
                VersionOld = LastNumber2;
                if (LastNumber2 == "没有找到!")
                {
                    return false;
                }
                if (LastNumber2.Trim().ToUpper() == LastNumber1.Trim().ToUpper())
                {
                    return false;
                }
                return true;
            }
            catch (Exception e)
            {
                throw (e);
            }
 
        }
        //
 
        // 读取列宽datagridview
        public static void GetGridView(DataGridView oGrd, string KeyItem, string AppPath)
        {
 
            int Cols;
            char c = Convert.ToChar(",");
            string sStr = ClsIni.ReadIni("GridSave", KeyItem, AppPath + @"\" + "grdWidth.wyini");
            if (sStr != "没有找到!")
            {
                string[] ColWidth = sStr.Split(c);
                if (oGrd.ColumnCount > ColWidth.Length)
                {
                    Cols = ColWidth.Length;
                }
                else
                {
                    Cols = oGrd.ColumnCount;
                }
                for (int i = 0; i < Cols; i++)
                {
                    if (DBUtility.ClsPub.isInt(ColWidth[i]) > 500)
                    {
                        oGrd.Columns[i].Width = DBUtility.ClsPub.isInt(ColWidth[i]);
                    }
                    else
                    {
                        oGrd.Columns[i].Width = DBUtility.ClsPub.isInt(ColWidth[i]);
                    }
                }
            }
        }
        // 读取隐藏列datagridview  并设置 对齐方式
        /// <summary>
        /// 读取隐藏列datagridview  并设置 对齐方式
        /// </summary>
        /// <param name="oGrd"></param>
        /// <param name="KeyItem"></param>
        /// <param name="AppPath"></param>
        public static void HideGridView(DataGridView oGrd, string KeyItem, string AppPath)
        {
            int Cols;
            char c = Convert.ToChar(",");
            char s = Convert.ToChar("|");
            string sStr = Fun_GetGridStrByModName(KeyItem);
            if (sStr != "没有找到!")
            {
                string[] Col = sStr.Split(c);
                for (int i = 0; i < Col.Length; i++)
                {
                    if (i >= oGrd.ColumnCount)
                    {
                        break;
                    }
                    string[] sCol = Col[i].Split(s);
                    if (sCol.Length > 1)
                    {
                        if (DBUtility.ClsPub.isStrNull(sCol[1]) == "1")
                        {
                            oGrd.Columns[DBUtility.ClsPub.isInt(sCol[0])].Visible = false;                           //隐藏列
                        }
                        else
                        {
                            oGrd.Columns[DBUtility.ClsPub.isInt(sCol[0])].Visible = true;                           //隐藏列
                        }
                        //h开头的隐藏
                        if (oGrd.Columns[DBUtility.ClsPub.isInt(sCol[0])].HeaderText != "")
                        {
                            if (oGrd.Columns[DBUtility.ClsPub.isInt(sCol[0])].HeaderText.Substring(0, 1).ToLower() == "h")
                            {
                                oGrd.Columns[DBUtility.ClsPub.isInt(sCol[0])].Visible = false;
                            }
                        }
                        else
                        {
                            oGrd.Columns[DBUtility.ClsPub.isInt(sCol[0])].Visible = false;
                        }
                    }
                    //
                    //if (sCol.Length > 2)
                    //{
                    //    if (DBUtility.ClsPub.isStrNull(sCol[2]) == "L")
                    //    {
                    //        oGrd.Columns[DBUtility.ClsPub.isInt(sCol[0])].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;                           // 
                    //    }
                    //    else if (DBUtility.ClsPub.isStrNull(sCol[2]) == "R")
                    //    {
                    //        oGrd.Columns[DBUtility.ClsPub.isInt(sCol[0])].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;    // 
                    //    }
                    //    else if (DBUtility.ClsPub.isStrNull(sCol[2]) == "M")
                    //    {
                    //        oGrd.Columns[DBUtility.ClsPub.isInt(sCol[0])].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;    // 
                    //    }
                    //    else
                    //    {
                    //        //;
                    //    }
                    //}
                }
            }
        }
 
        //根据模块名 返回 网格 信息
        public static string Fun_GetGridStrByModName(string KeyItem)
        {
            try
            {
                SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
                oWeb.Url = WEBSURL;
                //ClsOracleHelper oCn = new ClsOracleHelper();
                DataSet ds;
                ds = oWeb.getDataSetBySQL("select top 1 HGridString from Xt_grdAlignment where HUserName='" + DBUtility.ClsPub.CurUserName + "' and HModName='" + KeyItem + "'", "Xt_grdAlignment", ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    //oCn.CnDispose();
                    //oCn = null;
                    return "没有找到!";
                }
                else
                {
                    //oCn.CnDispose();
                    //oCn = null;
                    return DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HGridString"]);
                }
            }
            catch (Exception e)
            {
                //oCn.CnDispose();
                //oCn = null;
                return "没有找到!";
            }
        }
 
        //初始化网格
        public static void initGridFst(DataGridView grdMain, string Name)
        {
            grdMain.RowTemplate.Height = 18;                //行高设置
            grdMain.RowTemplate.MinimumHeight = 18;         //最小行高
            grdMain.ColumnHeadersHeight = 40;               //标题行高
            grdMain.RowHeadersVisible = false;              //固定列是否显示
            grdMain.ColumnHeadersVisible = true;            //固定行是否显示
            grdMain.RowCount = 1;                           //总行数
            for (int i = 0; i < grdMain.ColumnCount; i++)
            {
                grdMain.Columns[i].Width = 100;                                 //设置 列宽
                grdMain.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable; //列 排序模式
 
            }
            //
            grdMain.RowsDefaultCellStyle.SelectionForeColor = Color.Black;          //行选中字体颜色
            //grdMain.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;  //内容布局(居中,靠右)
            grdMain.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;//标题行布局(居中,靠右
            grdMain.ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.True;//标题行自动换行
            grdMain.SelectionMode = DataGridViewSelectionMode.CellSelect;                     //选行模式
            grdMain.ReadOnly = false;                                               //是否只读
            grdMain.EditMode = DataGridViewEditMode.EditOnEnter;                    //编辑模式
            grdMain.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;
            grdMain.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;  //标题行高 调整模式
            grdMain.EnableHeadersVisualStyles = false;                              //标题 显示样式
            grdMain.AllowUserToAddRows = false;             //是否允许自增--否
            grdMain.AllowUserToDeleteRows = false;          //是否允许删除--否 
            grdMain.AllowUserToResizeColumns = true;         //允许调整列宽--是
            grdMain.AllowUserToResizeRows = false;           //允许调整行高--否
            grdMain.AllowUserToOrderColumns = false;            //是否允许拖拽列
            grdMain.BackgroundColor = Color.White;              //网格背景色
            grdMain.GridColor = Color.LightGray;                //网格线颜色
            grdMain.DefaultCellStyle.SelectionBackColor = Color.AntiqueWhite;   //选中时背景颜色
            grdMain.ShowCellToolTips = false;                                   //鼠标停留 显示提示
            grdMain.ColumnHeadersDefaultCellStyle.BackColor = Color.LightSteelBlue;  //标题列 背景色
            ClsPub1.GetGridView(grdMain, Name, DBUtility.ClsPub.AppPath);//设置列宽
            ClsPub1.HideGridView(grdMain, Name, DBUtility.ClsPub.AppPath);//设置列宽
            grdMain.RowCount = 20;                          //总行数(更改行数时,会触发 编辑前事件)
        }
 
 
        //初始化网格2
        public static void initGridLast(string sAllowCol, string sTotalCol, ClsGridViewSum oSumGrid)
        {
            string[] sA;
            string[] sT;
            sA = sAllowCol.Split(Convert.ToChar(","));
            sT = sTotalCol.Split(Convert.ToChar(","));
            //
            oSumGrid.BuildAllowEditCols(sA);
            oSumGrid.BuildTotalCols(sT);
            oSumGrid.SetGridsum();
            oSumGrid.SetGridMain();
        }
 
        public static void initGridList(DataGridView grdMain, string Name)
        {
            grdMain.RowTemplate.Height = 18;
            grdMain.RowTemplate.MinimumHeight = 18;
            grdMain.ColumnHeadersHeight = 40;
            grdMain.RowHeadersVisible = false;
            grdMain.ColumnHeadersVisible = true;
            //grdMain.RowCount = 1;
            //格式化
            //表格设置
            grdMain.RowsDefaultCellStyle.SelectionForeColor = Color.White;
            grdMain.RowsDefaultCellStyle.SelectionBackColor = Color.DarkCyan;
            grdMain.DefaultCellStyle.SelectionBackColor = Color.DarkCyan;
            grdMain.DefaultCellStyle.SelectionForeColor = Color.White;
            //grdMain.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;//网格内容 对齐方式
            grdMain.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;  //标题列 内容对齐方式
            grdMain.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            grdMain.ReadOnly = true;
            grdMain.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; //允许用户调整列宽
            grdMain.EnableHeadersVisualStyles = false;     //网格标题 样式
            grdMain.AllowUserToAddRows = false;             //是否允许自增--否
            grdMain.AllowUserToDeleteRows = false;          //是否允许删除--否 
            grdMain.AllowUserToResizeColumns = true;         //允许调整列宽--是
            grdMain.AllowUserToResizeRows = false;           //允许调整行高--否
            grdMain.AllowUserToOrderColumns = true;         //允许 拖拽列
            grdMain.BackgroundColor = Color.White;          //网格背景色
            grdMain.GridColor = Color.Gainsboro;             //网格线颜色
            grdMain.ShowCellToolTips = true;
            grdMain.CellBorderStyle = DataGridViewCellBorderStyle.SingleVertical; //网格线样式:只有竖线
            grdMain.ColumnHeadersDefaultCellStyle.BackColor = Color.LightGray; //标题列 背景色
            grdMain.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;  //剪贴板模式:
            //grdMain.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.None;
            //
            ClsPub1.GetGridView(grdMain, Name, DBUtility.ClsPub.AppPath);//设置列宽
        }
 
        //显示列表
        /// <summary>
        /// 设置列宽,隐藏列(h开头、用户设置),冻结列,对齐方式
        /// </summary>
        /// <param name="grdMain"></param>
        /// <param name="Name"></param>
        /// <param name="s"></param>
        /// <param name="FrCol"></param>
        public static void DisplayGrid(DataGridView grdMain, string Name, string s, int FrCol) 
        {
            //加载列宽,隐藏列(H开头)
            for (int i = 0; i < grdMain.ColumnCount; i++)
            {
                grdMain.Columns[i].Width = 100;//默认列宽
                if (s == "否")
                {
                    grdMain.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;//是否允许 排序列
                }
                else
                {
                    grdMain.Columns[i].SortMode = DataGridViewColumnSortMode.Automatic;
                }
 
                if (grdMain.Columns[i].HeaderText.Substring(0, 1).ToLower() == "h")//隐藏H开头的列
                {
                    grdMain.Columns[i].Visible = false;
                }
                else
                {
                    grdMain.Columns[i].Visible = true;
                }
            }
            for (int i = 0; i < grdMain.ColumnCount; i++)//设置冻结列
            {
                grdMain.Columns[i].Frozen = false;
            }
            if (FrCol < grdMain.ColumnCount)
            {
                grdMain.Columns[FrCol].Frozen = true;//设置冻结列
            }
            //设置字体大小 及标题行高,内容行高
 
            //
            ClsPub1.GetGridView(grdMain, Name, DBUtility.ClsPub.AppPath);//设置列宽
            ClsPub1.HideGridView(grdMain, Name, DBUtility.ClsPub.AppPath);//读取隐藏列datagridview  并设置 对齐方式
        }
 
        //得到服务器日期
        public static string GetServerDate(Int64 iType)
        {
            SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
            oWeb.Url = WEBSURL;
            //ClsSqlHelper oCn = new ClsSqlHelper();
            DataSet Ds = new DataSet();
            try
            {
                Ds = oWeb.getDataSetBySQL("Select GetDate() as CurDate", "xt_xtgnb", ref DBUtility.ClsPub.sExeReturnInfo);
                //Ds = oCn.RunProcReturn("Select GetDate() as CurDate", "xt_xtgnb");
                switch (iType)
                {
                    case 0:
                        return Convert.ToDateTime(Ds.Tables[0].Rows[0]["CurDate"]).ToString("yyyy-MM-dd");
                    case 1:
                        return Convert.ToDateTime(Ds.Tables[0].Rows[0]["CurDate"]).ToString("HH:mm:ss");
                    case -1:
                        return Convert.ToDateTime(Ds.Tables[0].Rows[0]["CurDate"]).ToString("yyyy-MM-dd HH:mm:ss");
                    default:
                        return "1900-01-01";
                }
            }
            catch (Exception e)
            {
                return "1900-01-01";
            }
        }
 
 
    }
}