/// <summary> /// update /// </summary> /// <param name="presaleProduct"></param> /// <returns></returns> public ServiceResult UpdatePresaleProduct(PresaleProductEdit presaleProduct) { if (presaleProduct == null || presaleProduct.Id <= 0) { return(ServiceResult.FailedWithMessage("预售商品数据异常!")); } //update var repository = Repository <IPresaleProductRepository>(); var data = repository.GetSingle(presaleProduct.Id); data.VirtualPrice = presaleProduct.VirtualPrice; data.Sort = presaleProduct.Sort; repository.UpdateSingle(data); return(ServiceResult.Success); }
public ApiResult Update([FromBody] PresaleProductEdit presaleProduct) { var result = Resolve <IPresaleProductService>().UpdatePresaleProduct(presaleProduct); return(ToResult(result)); }
public ApiResult Add([FromBody] PresaleProductEdit presaleProduct) { return(AddMany(new List <PresaleProductEdit> { presaleProduct })); }