duhe
2023-11-16 1f04dee5f7849d8c0506c9ace925bec768539ea3
WebAPI/Controllers/XSGL/Xs_SeOrderBillController.cs
@@ -1992,5 +1992,59 @@
            }
        }
        #endregion
        #region 销售订单 检查单据是否存在
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <returns></returns>
        [Route("Xs_SeOrderBill/CheckSeOrderBill_IsExist")]
        [HttpGet]
        public object CheckSeOrderBill_IsExist(int HInterID)
        {
            try
            {
                //HInterID数据判断
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsXs_SeOrderBill oBill = new DAL.ClsXs_SeOrderBill();                              //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "单据存在";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "程序错误!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}