/// <summary> /// 获取指定编号的物品的 /// </summary> /// <param name="GoodsNum">物品编号</param> /// <returns></returns> public int GoodsCountByNum(string GoodsNum) { string sqltext = "select sum(amount) from Amount where goodsNum='" + GoodsNum + "'"; object obj = DBTools.exescalarSQL(sqltext, new List <SqlParameter>()); if (obj == null || obj.ToString() == "") { return(0); } else { return(int.Parse(obj.ToString())); } }