yusijie
2024-03-12 abf59bc386d65013b4782eb0b3af463457dbe968
WebAPI/Controllers/WebAPIController.cs
@@ -143,6 +143,56 @@
            }
        }
        /// <summary>
        /// 自动获取基础资料 流水号 就是代码
        /// </summary>
        /// <param name="HBillType"></param>
        /// <returns></returns>
        [Route("Web/GetMAXNumber")]
        [HttpGet]
        public object GetMAXNumber(string HBillType,string HName,string TableName)
        {
            try
            {
                string HNumber = "";
                HNumber = DBUtility.ClsPub.CreateHNumber(HBillType,HName, TableName, ref DBUtility.ClsPub.sExeReturnInfo, true);
                //----------创建虚表------------------------
                DataTable dt_Main = new DataTable("Json");
                dt_Main.Columns.Add("HNumber", typeof(string));
                //---------创建新行------------------------
                DataRow dr_main = dt_Main.NewRow();//创建新行
                dt_Main.Rows.Add(dr_main);//将新行加入到表中
                dr_main["HNumber"] = DBUtility.ClsPub.isStrNull(HNumber);
                if (HNumber == null)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败";
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功";
                    objjson.data = dt_Main;
                    return objjson;
                }
            }
            catch (Exception e)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + e.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        //[Route("Web/Get_MaxBillNoAndID")]
        //[HttpGet]
@@ -8109,14 +8159,34 @@
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from Gy_ProjectMoney where HItemID=" + HItemID, "Gy_ProjectMoney");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已审核!不能进行删除!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已禁用!不能进行删除!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                    return objJsonResult;
                }
@@ -10065,7 +10135,7 @@
                        HView = "h_v_Sb_EquipMaintainBillList";
                        break;
                    case "WX":
                        HView = "h_v_Sb_EquipRepairCheckBillList";
                        HView = "h_v_Sb_EquipRepairWorkBillList";
                        break;
                    case "GZ":
                        HView = "h_v_Sb_EquipConkBookBillList";