/// <summary> /// 根据ID获取一个商品 /// </summary> /// <param name="id"></param> /// <returns></returns> public Goods RetrieveGoods(int id) { using (IDbConnection conn = DAOFactory.Instance.OpenConnection()) { IGoodsDAO dao = DAOFactory.Instance.CreateGoodsDAO(); return(dao.SelectGoods(id, conn)); } }
/// <summary> /// 获取指定编码的商品 /// </summary> /// <param name="code"></param> /// <returns></returns> public Goods GetGoodsByCode(string code) { using (IDbConnection conn = DAOFactory.Instance.OpenConnection()) { IGoodsDAO dao = DAOFactory.Instance.CreateGoodsDAO(); return(dao.SelectGoods(code, conn)); } }