public bool Insert(ProductTry productTry) { productTry.Id = DBHelper <ProductTry> .GetMaxId(tableName, "id"); List <SimpleParameter> list = new List <SimpleParameter>(); list = DBHelper <ProductTry> .GetSim(productTry); return(DBHelper <object> .Insert(tableName, list) > 0); }
/// <summary> /// 根据用户id,商品id,和尺寸id来判断是否存在此数据 /// </summary> /// <param name="memberId"></param> /// <param name="productId"></param> /// <param name="sizeId"></param> /// <returns></returns> public bool GetTryByMemberIdAndProductId(int memberId, int productId) { List <SimpleParameter> list = new List <SimpleParameter>(); SimpleParameter s = new SimpleParameter { Name = "memberId", Value = memberId }; SimpleParameter s1 = new SimpleParameter { Name = "productId", Value = productId }; list.Add(s); list.Add(s1); ProductTry p = DBHelper <ProductTry> .SelectSingle(tableName, Fields, list); if (p != null) { return(true); } else { return(false); } }