yusijie
2025-05-20 ab62403afd5b2d06e5bf900a76ba5ad2bc23bd76
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
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Http;
using WebAPI.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Diagnostics;
using System.Threading;
using System.Globalization;
 
namespace WebAPI.Controllers.SCGL.日计划管理
{
    public class JIT_DayPlanPlatFormBill_TKController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public WebServer webserver = new WebServer();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        Sc_WorkBillSortBillMain omdelMian = new Sc_WorkBillSortBillMain();
        public static string BillType = "4610";
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
 
        #region 生产日计划平台 保存
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBill_btnSave_TK")]
        [HttpPost]
        public object JIT_DayPlanPlatFormBill_btnSave_TK([FromBody] JObject sMainSub)
        {
            var _value = sMainSub["sMainSub"].ToString();
            string msg1 = _value.ToString();
            //保存主表
            objJsonResult = AddBillMain(msg1);
            if (objJsonResult.code == "0")
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = objJsonResult.Message;
                objJsonResult.data = null;
                return objJsonResult;
            }
            objJsonResult.code = "1";
            objJsonResult.count = 1;
            objJsonResult.Message = "单据保存成功!";
            objJsonResult.data = null;
            return objJsonResult;
        }
 
        public json AddBillMain(string msg1)
        {
            string[] sArray = msg1.Split(new string[] { "&和" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string user = sArray[1].ToString();
 
            try
            {
                Stopwatch sw = new Stopwatch();//计时器
                sw.Start();//开始计时
 
                if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillSortBill_Edit", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
 
                LogService.CustomWriteLog("1:" + msg2, DateTime.Now.ToString("yyyy-MM-dd"));
                //JSON序列化转换字典集合
                List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
                List<object> jb = JsonConvert.DeserializeObject<List<object>>(msg2);
                foreach (JObject item in jb)
                {
                    Dictionary<string, string> dic = new Dictionary<string, string>();
                    foreach (var itm in item.Properties())
                    {
                        dic.Add(itm.Name, itm.Value.ToString());
                    }
                    list.Add(dic);
                }
 
                LogService.CustomWriteLog("2:", DateTime.Now.ToString("yyyy-MM-dd"));
                int TrueCount = 0, SumCount = 0;
                LogService.CustomWriteLog("list.Count:" + list.Count, DateTime.Now.ToString("yyyy-MM-dd"));
 
                string sReturn = "";
                oSystemParameter.ShowBill(ref sReturn);
                LogService.Write($"========================000.本次长度:" + list.Count);
                for (int i = 0; i < list.Count; i++)
                {
                    TrueCount = 0;
                    SumCount = 0;
                    long HInterID = 0;
                    var HBillNo = "";
                    if (list[i]["单据号"].ToString() == "" && list[i]["hmainid"].ToString() == "")
                    {
                        LogService.CustomWriteLog("2.01:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
                        var HICMOBillNo = list[i]["生产订单号"].ToString();
                        var HOrderType = list[i]["订单类型"].ToString();
                        var HICMOEntrySEQ = list[i]["生产订单明细行号"].ToString();
                        var HWorkShopID = list[i]["HWorkShopID"].ToString();
                        var HSourceID = list[i]["HSourceID"].ToString();
                        var HYX = list[i]["优先级"].ToString();
                        var HProdORGID = list[i]["HProdORGID"].ToString();
                        var HMaterID = list[i]["HMaterID"].ToString();
                        var HMaterName = list[i]["物料名称"].ToString();
                        var HMaterModel = list[i]["规格型号"].ToString().Replace("'", "''");
                        var HUnitID = list[i]["HUnitID"].ToString();
                        var HSeOrderBillQty = list[i]["销售订单数量"].ToString();
                        //var HOrderNeedQty = list[i]["订单需求数量"].ToString();
                        var HSplitQty = list[i]["拆单数量"].ToString();
                        var HDayPlanSumQty = list[i]["日计划数量总量"].ToString();
                        var HPlanBeginDate = list[i]["计划开始日期"].ToString();
                        var HPlanEndDate = list[i]["计划结束日期"].ToString();
                        var HSeOrderBillNo = list[i]["销售订单号"].ToString();
                        var HICMOBillType = list[i]["生产订单单据类型"].ToString();
                        var HSourceStockInQty = list[i]["产线入库数量"].ToString();
                        var HLeftPlanQty = list[i]["未排数量"].ToString();
                        var HOrderLev = list[i]["订单等级"].ToString();
                        var HMainSourceInterID = list[i]["源单主内码"].ToString();
                        var HMainSourceEntryID = list[i]["源单子内码"].ToString();
                        var HPlanQty = list[i]["计划数量"].ToString();
                        var HEmpID = list[i]["HEmpID"].ToString();
                        var HWorkQty = list[i]["小时产能"].ToString();
                        var HSourceName = list[i]["生产资源"].ToString();
                        var HWorkQty_ProdLine = list[i]["产线总产能"].ToString();
 
                        LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
 
                      
                        ds = oCN.RunProcReturn($"select 1 from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" +
                            $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID} and ISNULL(HDeleteMan,'')=''", "Sc_WorkBillSortBillMain");
 
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"第{i + 1}行生产资源有重复,请修改!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
 
                        //新增单据号 id
                        HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);//获得一个新的单据号
                        HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);//获得一个新的id
 
                        string sql = $"insert into Sc_WorkBillSortBillMain(HInterID,HBillNo,HYear,HPeriod,HBillType," +
                            "HBillSubType,HDate,HBillStatus,HMaker,HMakeDate,HICMOBillNo,HOrderType," +
                            "HICMOEntrySEQ,HWorkShopID,HSourceID, HYX, HProdORGID," +
                            " HMaterID, HMaterName, HMaterModel, HUnitID, HSeOrderBillQty," +
                            " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," +
                            "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," +
                            "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" +
                            ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty,HSourceName,HWorkQty_ProdLine)values" +
                            $"({HInterID},'{HBillNo}',{DateTime.Now.Year},{DateTime.Now.Month},'{BillType}'," +
                            $"'{BillType}',GETDATE(),1,'{user}',getdate(),'{HICMOBillNo}','{HOrderType}'," +
                            $"{(HICMOEntrySEQ == "" ? 0.ToString() : HICMOEntrySEQ)},{(HWorkShopID == "" ? 0.ToString() : HWorkShopID)},{(HSourceID == "" ? 0.ToString() : HSourceID)}, {(HYX == "" ? 0.ToString() : HYX)}, {(HProdORGID == "" ? 0.ToString() : HProdORGID)}," +
                            $" {(HMaterID == "" ? 0.ToString() : HMaterID)}, '{HMaterName}', '{HMaterModel}', {(HUnitID == "" ? 0.ToString() : HUnitID)}, {(HSeOrderBillQty == "" ? 0.ToString() : HSeOrderBillQty)}," +
                            $" 0, {(HSplitQty == "" ? 0.ToString() : HSplitQty)}, {(HDayPlanSumQty == "" ? 0.ToString() : HDayPlanSumQty)},'{HPlanBeginDate}'," +
                            $"'{HSeOrderBillNo}','{HICMOBillType}',{(HSourceStockInQty == "" ? 0.ToString() : HSourceStockInQty)},{(HLeftPlanQty == "" ? 0.ToString() : HLeftPlanQty)},'{HOrderLev}',getdate()," +
                            $"{HMainSourceInterID},{HMainSourceEntryID},{HMainSourceInterID},{HMainSourceEntryID},{HPlanQty}," +
                            $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}','{HSourceName}','{HWorkQty_ProdLine}')";
 
                        //LogService.Write("sql:" + sql);
                        //主表
                        oCN.RunProc(sql);
                    }
                    else
                    {
                        LogService.CustomWriteLog("2.0:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
                        HBillNo = list[i]["单据号"].ToString();
                        HInterID = int.Parse(list[i]["hmainid"].ToString());
                        var HMainSourceInterID = list[i]["源单主内码"].ToString();
                        var HMainSourceEntryID = list[i]["源单子内码"].ToString();
                        var HICMOBillNo = list[i]["生产订单号"].ToString();
                        var HICMOEntrySEQ = list[i]["生产订单明细行号"].ToString();
                        var HSourceID = list[i]["HSourceID"].ToString();
                        var HYX = list[i]["优先级"].ToString();
                        var HWorkQty = list[i]["小时产能"].ToString();
                        var HProdTimes = list[i]["生产周期"].ToString();
                        var HReadyTimes = list[i]["开工余量"].ToString();
                        var HLastBeginDate = list[i]["最迟开工日期"].ToString();
                        var HLastEndDate = list[i]["最迟完工日期"].ToString();
                        var HOrderNeedQty = list[i]["订单需求数量"].ToString();
                        var HOrderCommitDate = list[i]["订单交货期"].ToString();
                        var HPlanEndDate = list[i]["计划结束日期"].ToString();
                        var HSplitQty = list[i]["拆单数量"].ToString();
                        var HSourceName = list[i]["生产资源"].ToString();
                        var HWorkQty_ProdLine = list[i]["产线总产能"].ToString();
 
                        var HOrderType = list[i]["订单类型"].ToString();
                        var HWorkShopID = list[i]["HWorkShopID"].ToString();
                        var HProdORGID = list[i]["HProdORGID"].ToString();
                        var HMaterID = list[i]["HMaterID"].ToString();
                        var HMaterName = list[i]["物料名称"].ToString();
                        var HMaterModel = list[i]["规格型号"].ToString().Replace("'", "''");
                        var HUnitID = list[i]["HUnitID"].ToString();
                        var HSeOrderBillQty = list[i]["销售订单数量"].ToString();
                        var HDayPlanSumQty = list[i]["日计划数量总量"].ToString();
                        var HPlanBeginDate = list[i]["计划开始日期"].ToString();
                        var HSeOrderBillNo = list[i]["销售订单号"].ToString();
                        var HICMOBillType = list[i]["生产订单单据类型"].ToString();
                        var HSourceStockInQty = list[i]["产线入库数量"].ToString();
                        var HLeftPlanQty = list[i]["未排数量"].ToString();
                        var HOrderLev = list[i]["订单等级"].ToString();
                        var HPlanQty = list[i]["计划数量"].ToString();
                        var HEmpID = list[i]["HEmpID"].ToString();
 
                        LogService.CustomWriteLog("2.1:" + i, DateTime.Now.ToString("yyyy-MM-dd"));                        
 
                        var str = 0;
                        if (!int.TryParse(HYX, out str))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"第{i + 1}行优先级:{HYX},请输入数字!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
 
                        ds = oCN.RunProcReturn($"select 1 from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" +
                             $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID} and ISNULL(HDeleteMan,'') = ''", "Sc_WorkBillSortBillMain");
 
                        if (ds.Tables[0].Rows.Count > 1)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"第{i + 1}行生产资源有重复,请修改!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        LogService.CustomWriteLog("2.2:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
 
                        oCN.RunProc($"update wsm1 set HSourceID={(HSourceID == "" ? 0.ToString() : HSourceID)},HYX={HYX}" +
                            $",HWorkQty={HWorkQty},HProdTimes={HProdTimes},HReadyTimes={HReadyTimes},HLastBeginDate='{HLastBeginDate}'" +
                            $",HLastEndDate='{HLastEndDate}',HOrderNeedQty={HOrderNeedQty},HOrderCommitDate='{HOrderCommitDate}',HPlanEndDate='{HPlanEndDate}',HSplitQty={HSplitQty},HSourceName='{HSourceName}',HWorkQty_ProdLine={HWorkQty_ProdLine}" +
                            $" from Sc_WorkBillSortBillMain wsm1 with(nolock) where HInterID={list[i]["hmainid"].ToString()} and HBillNo='{list[i]["单据号"].ToString()}'");
                    }
 
                    oCN.RunProc($"update wsm2 set HDayPlanSumQty={list[i]["日计划数量总量"].ToString()} from Sc_WorkBillSortBillMain wsm2 with(nolock) where HInterID={(HInterID == 0 ? int.Parse(list[i]["hmainid"].ToString()) : HInterID)} and HBillNo='{(HBillNo == "" ? list[i]["单据号"].ToString() : HBillNo)}'");
 
                    LogService.Write($"========================1.排产主表处理用时:" + sw.Elapsed);
 
                    int SumDay = 180; //动态六月之差 DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days;
 
                    LogService.CustomWriteLog("2.3:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
                    for (int j = 0; j < SumDay; j++)
                    {
                        //主表子表都有数据
                        if (list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString() != "" && Math.Round(double.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()), 1) > 0)
                        {
                            SumCount += 1;
                            ////保存子表
                            objJsonResult = AddBillSub(HInterID == 0 ? list[i]["hmainid"].ToString() : HInterID.ToString()
                                , HBillNo == "" ? list[i]["单据号"].ToString() : HBillNo
                                 , DateTime.Parse(DateTime.Now.AddDays(j).ToString("yyyy-MM-dd").ToString())
                                 , Math.Round(double.Parse(list[i][DateTime.Now.AddDays(j).ToString("yyyy-MM-dd")].ToString()), 1)
                                 , list[i]);
                            if (objJsonResult.count == 1)
                            {
                                TrueCount += 1;
                            }
                        }
                        //主表有数据 子表无数据
                        if (j == SumDay - 1 && SumCount == 0 && HInterID != 0 && HBillNo != "")
                        {
                            LogService.Write($"========================000.主表有数据 子表无数据:" + HBillNo + sw.Elapsed);
                            //LogService.CustomWriteLog("3:"+ HInterID+","+ HBillNo, DateTime.Now.ToString("yyyy-MM-dd"));
                            objJsonResult = AddBillSub(HInterID.ToString(), HBillNo, DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd").ToString()), 0, list[i]);
                        }
                    }
                    LogService.Write($"========================2.排产子表处理用时:" + sw.Elapsed);
 
                    LogService.CustomWriteLog("2.4:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
 
                    if (TrueCount != SumCount)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = objJsonResult.Message;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
 
 
                }
 
                LogService.CustomWriteLog("2.5:", DateTime.Now.ToString("yyyy-MM-dd"));
 
                //同步日计划工单
                oCN.RunProc("exec REALESE_SC_ICMOBILLSTATUS_TMP");
 
                LogService.CustomWriteLog("2.6:", DateTime.Now.ToString("yyyy-MM-dd"));
                sw.Stop();//结束计时
                LogService.Write($"========================3.排产订单总用时:" + sw.Elapsed);
 
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = null;
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
 
        public json AddBillSub(string HInterID, string HBillNo, DateTime date, double HQTY, Dictionary<string, string> dic)
        {
            Stopwatch ss = new Stopwatch();//计时器
            ss.Start();//开始计时
            string sReturn = "";
            oSystemParameter.ShowBill(ref sReturn);
 
            //获取表格数据
            ds = oCN.RunProcReturn($"select * from h_v_JIT_Sc_WorkBillSortBill_PC with(nolock) where 单据号='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBill_PC");
 
            LogService.Write($"========================2.1.子表数据查询用时:" + ss.Elapsed);
 
            int count = 0;
            if (ds.Tables[0].Rows.Count > 0)
            {
                LogService.Write($"========================2.2.子表更新前用时:" + ss.Elapsed);
                //判断子表是否有当日的日期以及日期所对应的数量
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (DateTime.Parse(ds.Tables[0].Rows[i]["日计划生产日期"].ToString()) == date)
                    {
                        oCN.RunProc($"update wss1 set HMasterDate='{date}',HQty={HQTY},HUseTimes={(dic["产线总产能"] == "0" ? 0 : HQTY / float.Parse(dic["产线总产能"].ToString()))}" +
                            $" from Sc_WorkBillSortBillSub wss1 with(nolock) where HInterID={HInterID} and HEntryID={ds.Tables[0].Rows[i]["hsubid"].ToString()}");
                        count += 1;
                    }
                }
                LogService.Write($"========================2.2.子表更新后用时:" + ss.Elapsed);
            }
 
            if (count != 1)
            {
                //插入子表
                oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," +
                    "HMasterDate,HQty,HUseTimes)" +
                            $"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," +
                            $" '{date}', {HQTY},{ ((dic["产线总产能"] == "0.0000" ? 0 : dic["产线总产能"] == "0" ? 0 : HQTY / float.Parse(dic["产线总产能"].ToString())).ToString() == "非数字" ? 0 : dic["产线总产能"] == "0.0000" ? 0 : dic["产线总产能"] == "0" ? 0 : HQTY / float.Parse(dic["产线总产能"].ToString())) })");
                LogService.Write($"========================2.2.子表插入前用时:" + ss.Elapsed);
            }
 
 
            //把排产订单完工日期反写到金蝶销售订单上
            string sql = "exec h_p_JIT_UpdateEndDateToERP " + HInterID + ",'" + HBillNo + "'";
            oCN.RunProc(sql);
 
            LogService.Write($"========================2.3.子表存储过程调用耗时:" + ss.Elapsed);
 
            ss.Stop();//结束计时
            LogService.Write($"========================2.4.子表保存总用时:" + ss.Elapsed);
 
            objJsonResult.code = "1";
            objJsonResult.count = 1;
            objJsonResult.Message = null;
            objJsonResult.data = null;
            return objJsonResult;
        }
        #endregion
 
 
        #region 获取车间排产锁定天数
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHinterIDList_TK")]
        [HttpGet]
        public object JIT_DayPlanPlatFormBillHinterIDList_TK(string sWhere, int num)
        {
            try
            {
                ds = oCN.RunProcReturn($"select isnull(DATEDIFF(DAY,GETDATE(),CONVERT(varchar(10),max(HMasterDate),20))+1,0) DayNum from Sc_WorkBillSortBillMain a with(nolock) left join Sc_WorkBillSortBillSub b with(nolock) on a.HInterID = b.HInterID where a.HWorkShopID = {sWhere} and HMasterDate>=CONVERT(varchar(10),GETDATE(),20) and HLockedSub=1", "Sc_WorkBillSortBillSub");
 
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
 
    }
}