/// <summary> /// 判断交易商品名称是否已经存在 /// </summary> /// <param name="CommodityName">商品名称</param> /// <returns></returns> public bool IsExistCommodityName(string CommodityName) { try { CM_CommodityDAL cMCommodityDAL = new CM_CommodityDAL(); string strWhere = string.Format("CommodityName='{0}'", CommodityName); DataSet _ds = cMCommodityDAL.GetList(strWhere); if (_ds != null) { if (_ds.Tables[0].Rows.Count == 0) { return(true); } return(false); } return(false); } catch (Exception ex) { string errCode = "GL-4308"; string errMsg = "判断交易商品名称是否已经存在失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); return(false); } }