WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs
@@ -11,7 +11,7 @@
using System.Windows.Forms;
using WebAPI.Models;
namespace WebAPI.Controllers.SBGL
namespace WebAPI.Controllers
{
    public class Sb_EquipStopBillController : ApiController
    {
@@ -21,6 +21,7 @@
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        public DAL.ClsSb_EquipStopBillMain OBill = new DAL.ClsSb_EquipStopBillMain();
        public DAL.ClsSb_EquipStopBillMain BillOld = new DAL.ClsSb_EquipStopBillMain();
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); //获取系统参数
        #region 设备停机单列表 查询       
@@ -33,7 +34,7 @@
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipStopBillMain_Check", 1, false, user))
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipStopBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
@@ -67,6 +68,59 @@
                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 设备停机单分页查询
        [Route("Sb_EquipStopBill/getSb_EquipStopBillListPage")]
        [HttpGet]
        public object Sb_EquipStopBillListPage(string sWhere, string user, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipStopBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipStopBillMainListPage " + page + "," + size + ",''", "h_p_Sb_EquipStopBillMainListPage");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipStopBillMainListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipStopBillMainListPage");
                }
                //添加列名
                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列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
@@ -240,6 +294,31 @@
                }
                if (bResult)
                {
                    //自动审核设置
                    if (refSav == "Add")
                    {
                        objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //返回主ID
                        //系统参数  自动审核
                        string sReturn = "";
                        if (oSystemParameter.ShowBill(ref sReturn) == true)
                        {
                            if (oSystemParameter.omodel.Sb_EquipStopBill_AutoCheck == "Y") //系统参数  自动审核
                            {
                                objJsonResult.Verify = "Y";
                            }
                            else
                            {
                                objJsonResult.Verify = "N";
                            }
                        }
                    }
                    else
                    if (refSav == "Update")
                    {
                        objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //返回主ID
                        objJsonResult.Verify = "N";
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
@@ -445,7 +524,7 @@
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.Message = "审核成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
@@ -454,7 +533,7 @@
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "执行失败!" + e.ToString();
                objJsonResult.Message = "审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }