王 垚
2022-04-06 9167264eeb081fdbb94d8a1d2f76f35a6ccdd5fe
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_ConkReasonBillController.cs
@@ -22,27 +22,38 @@
        #region æ•…障原因列表
        [Route("Gy_ConkReasonBill/Get_ConkReasonBillList")]
        [HttpGet]
        public object Get_ConkReasonBillList(string sWhere)
        public object Get_ConkReasonBillList(string sWhere,string user)
        {
            try
            {
                ds = Sc_GetConkReasonBill(sWhere);
                if (ds == null)
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_ConkReason", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "查询数据异常,请与管理员联系!";
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "返回记录成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                ds = Sc_GetConkReasonBill(sWhere);
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                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 = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {
@@ -59,11 +70,11 @@
            string sql1 = string.Format(@"select * from h_v_Gy_ConkReasonList");
            if (sWhere == null || sWhere.Equals(""))
            {
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + sWhere + " order by hitemid desc", "h_v_Gy_ConkReasonList");
                return new SQLHelper.ClsCN().RunProcReturn(sql1 + sWhere + " order by æ•…障原因代码 ", "h_v_Gy_ConkReasonList");
            }
            else
            {
                string sql = sql1 + sWhere + "order by hitemid desc";
                string sql = sql1 + sWhere + "order by æ•…障原因代码 ";
                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Gy_ConkReasonList");
            }
        }
@@ -72,8 +83,18 @@
        #region [故障原因删除功能]
        [Route("Gy_ConkReasonBill/set_DeleteBill")]
        [HttpGet]
        public object set_DeleteBill(string HItemID)
        public object set_DeleteBill(string HItemID,string user)
        {
            //删除权限
            if (!DBUtility.ClsPub.Security_Log("Gy_ConkReason_Delete", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无删除权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HItemID);
            if (lngBillKey == 0)
@@ -158,6 +179,15 @@
            ListModels oListModels = new ListModels();
            try
            {
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_ConkReason_Edit", 1, false, msg3))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Model.ClsGy_ConkReason_Model oBill = new Model.ClsGy_ConkReason_Model();
                List<Model.ClsGy_ConkReason_Model> lsmain = new List<Model.ClsGy_ConkReason_Model>();
                msg1 = msg1.Replace("\\", "");