WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs
@@ -20,11 +20,13 @@
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;//单据状态(新增,修改,浏览,更新单价,变更)
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        public DataSet ds1 = new DataSet();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        public DAL.ClsSc_WorkBeginDotCheckBillMain OBill = new DAL.ClsSc_WorkBeginDotCheckBillMain();   //启动点检单
        public DAL.ClsSc_WorkBeginDotCheckBillMain BillOld = new DAL.ClsSc_WorkBeginDotCheckBillMain();//启动点检单
        public DAL.ClsGy_WorkBeginDotCheckListBillMain OBill1 = new DAL.ClsGy_WorkBeginDotCheckListBillMain();  //设备启动点检清单
        public DAL.ClsGy_WorkBeginDotCheckListBillMain BillOld1 = new DAL.ClsGy_WorkBeginDotCheckListBillMain(); //设备启动点检清单
        #region 启动点检列表 查询       
@@ -1253,7 +1255,7 @@
                if (Type == 1)
                {
                    //判断单据是否已经审核
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
@@ -1292,8 +1294,8 @@
                        }
                        //审核前控制=========================================      
                        string sql1 = "exec h_p_Gy_WorkBeginDotCheckListBill_BeforeCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeCheckCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeCheckCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -1303,11 +1305,11 @@
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.Message = "审核失败!原因:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;
@@ -1328,7 +1330,6 @@
                else
                {
                    //判断单据是否已经反审核
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
@@ -1359,8 +1360,8 @@
                        }
                        //反审核前控制=========================================        
                        string sql1 = "exec h_p_Gy_WorkBeginDotCheckListBill_BeforeUnCheckCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeUnCheckCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeUnCheckCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -1369,11 +1370,11 @@
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.Message = "反审核失败!原因:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -1564,6 +1565,7 @@
        {
            try
            {
                //判断是否有作废权限
                if (!DBUtility.ClsPub.Security_Log("Gy_WorkBeginDotCheckListBillMain_Drop", 1, false, user))
                {
@@ -1591,7 +1593,7 @@
                if (Type == 1)
                {
                    //判断单据是否已经作废
                    DataSet ds;
                    string sql = "select * from " + BillOld1.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld1.MvarItemKey);
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
@@ -1622,8 +1624,8 @@
                        }
                        //作废前控制=========================================      
                        string sql1 = "exec h_p_Gy_WorkBeginDotCheckListBill_BeforeDropCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeDropCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeDropCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -1633,7 +1635,7 @@
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -1657,7 +1659,6 @@
                else
                {
                    //判断单据是否已经反作废
                    DataSet ds;
                    string sql = "select * from " + BillOld1.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld1.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
@@ -1680,8 +1681,8 @@
                        }
                        //反作废前控制=========================================      
                        string sql1 = "exec h_p_Gy_WorkBeginDotCheckListBill_BeforeUnDropCtrl " + HInterID + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeUnDropCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        ds1 = oCN.RunProcReturn(sql1, "h_p_Gy_WorkBeginDotCheckListBill_BeforeUnDropCtrl");
                        if (ds1 == null || ds1.Tables.Count == 0 || ds1.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
@@ -1691,11 +1692,11 @@
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        if (ds1.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "作废失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.Message = "作废失败!原因:" + ds1.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            oCN.RollBack();
                            return objJsonResult;