WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
@@ -75,6 +75,70 @@
        }
        #endregion
        #region 设备保养规程单列表PDA
        [Route("Sb_EquipMaintainRuleBill/GetEquipMaintainRuleListPDA")]
        [HttpGet]
        public object GetEquipMaintainRuleListPDA(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipMaintainRuleBillList", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sb_GetMaintainRuleListByEquip " + sWhere, "h_v_Sb_GetMaintainRuleListByEquip");
                }
                else
                {
                    string sql1 = "select * from h_v_Sb_GetMaintainRuleListByEquip where 1 = 1";
                    string sql = sql1 + sWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_Sb_GetMaintainRuleListByEquip");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 设备保养规程记录删除功能
        [Route("Sb_EquipMaintainRuleBill/DeleteEquipMaintainRuleBillList")]
        [HttpGet]
@@ -99,9 +163,10 @@
                return objJsonResult;
            }
            DLL.ClsSb_EquipMaintainRuleBill oBill = new DLL.ClsSb_EquipMaintainRuleBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            ds = oCN.RunProcReturn("select * from Sb_EquipMaintainRuleBillMain where HInterID=" + HInterID, "Sb_EquipMaintainRuleBillMain");
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (oBill.omodel.HBillStatus > 1)
                if (DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -109,7 +174,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (oBill.omodel.HChecker != ""&& oBill.omodel.HChecker != null)
                if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;