1
duhe
2025-03-03 773e65fc78cd6300aaa706efdcb5756db9ad59a4
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormBillController.cs
@@ -9,7 +9,7 @@
using Newtonsoft.Json.Linq;
using System.Diagnostics;
using System.Threading;
using System.Globalization;
namespace WebAPI.Controllers.SCGL.日计划管理
{
    public class JIT_DayPlanPlatFormBillController : ApiController
@@ -98,6 +98,40 @@
                return objJsonResult;
            }
        }
        /// <summary>
        /// æ ¹æ®ç‚¹å‡»è¡Œæ ‡é¢˜æ—¶é—´æŸ¥è¯¢ç¼ºæ–™åˆ†æž
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHDateTimeList")]
        [HttpGet]
        public object JIT_DayPlanPlatFormBillHDateTimeList(string sWhere)
        {
            try
            {
                MaterialShorAnalysis Report = JsonConvert.DeserializeObject<MaterialShorAnalysis>(sWhere);
                ds = oCN.RunProcReturn($"exec h_p_JIT_MaterialShorAnalysisReportList {Report.HORGID},'{Report.HBEGINDATE}','{Report.HENDDATE}' ", "h_p_JIT_PODemandPlanBill_ReportList");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                //objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 ä¿å­˜
@@ -135,6 +169,9 @@
            try
            {
                Stopwatch sw = new Stopwatch();//计时器
                sw.Start();//开始计时
                if (!DBUtility.ClsPub.Security_Log("Sc_WorkBillSortBill_Edit", 1, false, user))
                {
                    objJsonResult.code = "0";
@@ -161,8 +198,11 @@
                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);
                for (int i = 0; i < list.Count; i++)
                {
                {
                    TrueCount = 0;
                    SumCount = 0;
                    long HInterID = 0;
@@ -195,20 +235,25 @@
                        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();
                        LogService.CustomWriteLog("2.05:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
                        if (HSourceID == ""|| HSourceID == "0")
                        if (oSystemParameter.omodel.WMS_CampanyName != "添康科技") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"第{i + 1}行生产资源不能为空!";
                            objJsonResult.data = null;
                            return objJsonResult;
                            if (HSourceID == "" || HSourceID == "0")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = $"第{i + 1}行生产资源不能为空!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                        ds = oCN.RunProcReturn($"select * from Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" +
                        ds = oCN.RunProcReturn($"select HInterID,HICMOBillNo from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" +
                            $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain");
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
@@ -229,7 +274,7 @@
                            " HOrderNeedQty, HSplitQty, HDayPlanSumQty,HPlanBeginDate," +
                            "HSeOrderBillNo,HICMOBillType,HSourceStockInQty,HLeftPlanQty,HOrderLev,HPreparatDate," +
                            "HMainSourceInterID,HMainSourceEntryID,HICMOInterID_Sec,HICMOEntryID_Sec,HPlanQty" +
                            ",HICMOInterID,HICMOEntryID,HPlanEndDate)values" +
                            ",HICMOInterID,HICMOEntryID,HPlanEndDate,HEmpID,HWorkQty)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)}," +
@@ -237,7 +282,7 @@
                            $" 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}')";
                            $"{HMainSourceInterID},{HMainSourceEntryID},'{HPlanEndDate}','{HEmpID}','{HWorkQty}')";
                        //LogService.Write("sql:" + sql);
                        //主表
@@ -265,15 +310,19 @@
                        var HSplitQty = list[i]["拆单数量"].ToString();
                        LogService.CustomWriteLog("2.1:"+i, DateTime.Now.ToString("yyyy-MM-dd"));
                        if (HSourceID == "" || HSourceID == "0")
                        if (oSystemParameter.omodel.WMS_CampanyName != "添康科技") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"第{i + 1}行生产资源不能为空!";
                            objJsonResult.data = null;
                            return objJsonResult;
                            if (HSourceID == "" || HSourceID == "0")
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = $"第{i + 1}行生产资源不能为空!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                        var str = 0;
                        if (!int.TryParse(HYX, out str))
                        {
@@ -284,7 +333,7 @@
                            return objJsonResult;
                        }
                        ds = oCN.RunProcReturn($"select * from  Sc_WorkBillSortBillMain where HMainSourceInterID={HMainSourceInterID}" +
                        ds = oCN.RunProcReturn($"select HInterID,HICMOBillNo from Sc_WorkBillSortBillMain with(nolock) where HMainSourceInterID={HMainSourceInterID}" +
                              $" and HMainSourceEntryID={HMainSourceEntryID} and HICMOBillNo='{HICMOBillNo}' and HICMOEntrySEQ={HICMOEntrySEQ} and HSourceID={HSourceID}", "Sc_WorkBillSortBillMain");
                        if (ds.Tables[0].Rows.Count > 1)
@@ -308,7 +357,25 @@
                    oCN.RunProc($"update Sc_WorkBillSortBillMain set HDayPlanSumQty={list[i]["日计划数量总量"].ToString()} where HInterID={(HInterID==0?int.Parse(list[i]["hmainid"].ToString()):HInterID)} and HBillNo='{(HBillNo==""?list[i]["单据号"].ToString(): HBillNo)}'");
                    int SumDay = 31; //动态两月之差 DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days;
                    int SumDay = 0; //动态两月之差 DateTime.Now.AddMonths(1).AddDays(-1).Subtract(DateTime.Now).Days;
                    // ç»Ÿè®¡æ€»å¤©æ•°
                    HashSet<DateTime> uniqueDates = new HashSet<DateTime>();
                    foreach (var key in list[i].Keys)
                    {
                        if (DateTime.TryParseExact(key, "yyyy-M-d", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime date))
                        {
                            uniqueDates.Add(date);
                        }
                    }
                    SumDay = uniqueDates.Count;
                    if (oSystemParameter.omodel.WMS_CampanyName == "添康科技") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                    {
                        SumDay = 180;
                    }
                    LogService.CustomWriteLog("2.3:" + i, DateTime.Now.ToString("yyyy-MM-dd"));
                    for (int j = 0; j < SumDay; j++)
@@ -329,7 +396,7 @@
                            }
                        }
                        //主表有数据 å­è¡¨æ— æ•°æ®
                        if (j == 30 && SumCount == 0 && HInterID != 0 && HBillNo != "")
                        if (j == SumDay-1 && SumCount == 0 && HInterID != 0 && HBillNo != "")
                        {
                            //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]);
@@ -346,6 +413,8 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                LogService.CustomWriteLog("2.5:", DateTime.Now.ToString("yyyy-MM-dd"));
@@ -354,6 +423,8 @@
                oCN.RunProc("exec REALESE_SC_ICMOBILLSTATUS_TMP");
                LogService.CustomWriteLog("2.6:", DateTime.Now.ToString("yyyy-MM-dd"));
                sw.Stop();//结束计时
                LogService.Write($"========================1.排产订单总用时:" + sw.Elapsed);
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -374,7 +445,7 @@
        public json AddBillSub(string HInterID, string HBillNo, DateTime date, double HQTY, Dictionary<string, string> dic)
        {         
            //获取表格数据
            ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkBillSortBillList where å•据号='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList");
            ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkBillSortBill_PC where å•据号='{HBillNo}'", "h_v_JIT_Sc_WorkBillSortBill_PC");
            int count = 0;
            if (ds.Tables[0].Rows.Count > 0)
            {
@@ -396,7 +467,16 @@
                oCN.RunProc("insert into Sc_WorkBillSortBillSub(HInterID,HSEQ," +
                    "HMasterDate,HQty,HUseTimes)" +
                            $"values({HInterID}, {(ds.Tables[0].Rows.Count + 1)}," +
                            $" '{date}', {HQTY},{(dic["小时产能"] == "0" ? 0 : HQTY / float.Parse(dic["小时产能"].ToString()))})");
                            $" '{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())) })");
            }
            string sReturn = "";
            oSystemParameter.ShowBill(ref sReturn);
            if (oSystemParameter.omodel.WMS_CampanyName == "添康科技") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
            {
                //把排产订单完工日期反写到金蝶销售订单上
                string sql = "exec h_p_JIT_UpdateEndDateToERP " + HInterID + ",'" + HBillNo + "'";
                oCN.RunProc(sql);
            }
            objJsonResult.code = "1";
@@ -757,6 +837,19 @@
                //LogService.Write("齐套分析sql:" + sql);
                List<PRD_PPBOM> BomList = new List<PRD_PPBOM>();
                DataTable resulTable = ds.Tables[0];
                if (ds.Tables[0].Rows.Count < 1 || ds == null)
                {
                    //释放齐套操作 é¿å…å¤šäººåŒæ—¶è¿›è¡Œé½å¥—分析
                    oCN.RunProc($"update T_PRD_QTFX set FSTATUS = 0 where FPRDORGID ={omdelMian.HProdORGID} and FSTATUS = 1 ");
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "没有需要进行齐套分析的数据";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (resulTable.Rows[0][0].ToString().Contains("失败"))
                {
                    //释放齐套操作 é¿å…å¤šäººåŒæ—¶è¿›è¡Œé½å¥—分析
@@ -798,9 +891,10 @@
                sw.Start();//开始计时
                //获取当前即时库存 åº“存数量+库存组织+物料+货主+仓库   
                //原查询即时库存方式:select * from h_v_jit_InventoryList
                ds = oCN.RunProcReturn(@" 
select * from h_v_jit_InventoryList
", "h_v_jit_InventoryList");
exec h_p_jit_Inventory_UsableList
", "h_p_jit_Inventory_UsableList");
                ListInventory = ds.ToModelList<PRD_Inventory>();
                //车间 ä»“库对照列表 
                ds = oCN.RunProcReturn(@" 
@@ -1556,11 +1650,20 @@
                    {
                        sqlName = "AIS20210820164804";
                    }
                    else if (oSystemParameter.omodel.WMS_CampanyName == "添康科技")
                    {
                        sqlName = "AIS20240809105013";
                    }
                    else if (oSystemParameter.omodel.WMS_CampanyName == "宝工")
                    {
                        sqlName = "AIS20250102123554";
                    }
                    else
                    {
                        sqlName = "AIS20210811135644";
                    }
                }
                if (HTLType == "缺料")
                {
@@ -2553,6 +2656,58 @@
        }
        #endregion
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 é”å®šå·¥å•
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHLockedOrder")]
        [HttpGet]
        public object JIT_DayPlanPlatFormBillHLockedOrder(string HInterIDs)
        {
            try
            {
                oCN.RunProc($"update Sc_WorkBillSortBillMain set HLockOrder = 1 where HInterID in ({HInterIDs})");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 è§£é”å·¥å•
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHUnlockOrder")]
        [HttpGet]
        public object JIT_DayPlanPlatFormBillHUnlockOrder(string HInterIDs)
        {
            try
            {
                oCN.RunProc($"update Sc_WorkBillSortBillMain set HLockOrder = 0 where HInterID in ({HInterIDs})");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 ç”Ÿäº§è®¢å•查询
        [Route("JIT_DayPlanPlatFormBill/JIT_ICMOBillList")]
        [HttpGet]
@@ -2785,5 +2940,198 @@
            }
        }
        #endregion
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 æ ¹æ®è½¦é—´æ·»åŠ æœªæŽ’äº§ç”Ÿäº§è®¢å•
        [Route("JIT_DayPlanPlatFormBill/JIT_ICMOBillListByDept")]
        [HttpGet]
        public object JIT_ICMOBillListByDept(string HDeptID)
        {
            try
            {
                //获取显示系统参数
                string sReturn = "";
                oSystemParameter.ShowBill(ref sReturn);
                //查询选择车间中未排产过的生产订单信息(添康科技--生产订单状态为下达)
                ds = oCN.RunProcReturn($"exec h_p_JIT_ICMOBillListByDept '{HDeptID}'", "h_p_JIT_ICMOBillListByDept");
                if (ds.Tables[0].Rows.Count > 0 && ds != null)
                {
                    if (oSystemParameter.omodel.WMS_CampanyName == "添康科技") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                    {
                        //数据表格添加动态日期
                        for (int j = 1; j <= 180; j++)
                        {
                            ds.Tables[0].Columns.Add(DateTime.Now.AddDays(j - 1).ToString("yyyy-MM-dd"), typeof(Int32));
                        }
                    }
                    else
                    {
                        //数据表格添加动态日期
                        for (int j = 1; j <= 31; j++)
                        {
                            ds.Tables[0].Columns.Add(DateTime.Now.AddDays(j - 1).ToString("yyyy-MM-dd"), typeof(Int32));
                        }
                    }
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查无数据,当前所选车间下暂无未排产且订单状态为下达的生产订单信息!";
                    objJsonResult.data = "";
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 èŽ·å–å®Œå·¥æ—¥æœŸ
        [Route("JIT_DayPlanPlatFormBill/GetICMOCompletionDate")]
        [HttpGet]
        public object GetICMOCompletionDate(string HDeptID)
        {
            try
            {
                //更新日计划工单的完工日期
                oCN.RunProc($"exec h_p_JIT_GetICMOCompletionDate '{HDeptID}'");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "获取完工日期成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç”Ÿäº§æ—¥è®¡åˆ’平台 èŽ·å–æœ€æ—©å¼€å·¥æ—¥æœŸ
        [Route("JIT_DayPlanPlatFormBill/GetICMOEarlyDate")]
        [HttpGet]
        public object GetICMOEarlyDate(string HDeptID)
        {
            try
            {
                //更新生产订单的最早开工日期
                oCN.RunProc($"exec h_p_JIT_GetICMOEarlyDate '{HDeptID}'");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "获取最早开工日期成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region é€šè¿‡ç‰©æ–™åŒ¹é…äº§å“å™¨å…·æ¸…单
        [Route("JIT_DayPlanPlatFormBill/GetMouldByMater")]
        [HttpGet]
        public object GetMouldByMater(string HMaterID,string HSourceID)
        {
            try
            {
                ds = oCN.RunProcReturn("exec h_p_Gy_MaterialMouldByMater " + HMaterID + "," + HSourceID, "h_p_Gy_MaterialMouldByMater");
                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
        #region é€šè¿‡èµ„源匹配资源器具清单
        [Route("JIT_DayPlanPlatFormBill/GetMouldBySource")]
        [HttpGet]
        public object GetMouldBySource(string HSourceID, string HMouldID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_Gy_SourceMouldBillMainList where HSourceID = " + HSourceID + " and HMouldID = " + HMouldID, "h_v_Gy_SourceMouldBillMainList");
                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
        #region æŽ’产后将器具占用时间写入数据库
        [Route("JIT_DayPlanPlatFormBill/AddMouldOccupancyTime")]
        [HttpGet]
        public object AddMouldOccupancyTime(string HMouldID, string HSourceID, string HICMOInterID, string HICMOEntryID, string HMouldPCTime)
        {
            try
            {
                ds = oCN.RunProcReturn("exec h_p_JIT_AddMouldOccupancyTime " + HMouldID + "," + HSourceID + "," + HICMOInterID + "," + HICMOEntryID + ",'" + HMouldPCTime + "'", "h_p_JIT_AddMouldOccupancyTime");
                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
    }
}