public void Change(ChanpinDetailsModel changeModel) { Chanpin chanpin = this._coreManager.ChanpinManager.GetChanpinById(changeModel.id); Chanpin chanpinClone = chanpin.Clone(); this.SetChanpinInfo(chanpinClone, changeModel); this._dataManager.ChanpinDataProvider.Update(chanpinClone); this.SetChanpinInfo(chanpin, changeModel); chanpin.Changed(); }
public ChanpinDetailsModel Create(ChanpinDetailsModel createModel) { Chanpin chanpin = new Chanpin(); this.SetChanpinInfo(chanpin, createModel); chanpin.Id = Guid.NewGuid().ToString(); this._dataManager.ChanpinDataProvider.Insert(chanpin); this._coreManager.ChanpinManager.Add(chanpin); return(new ChanpinDetailsModel(chanpin)); }
private void SetChanpinInfo(Chanpin chanpin, ChanpinDetailsModel detailsModel) { ClassPropertyHelper.ChangeProperty(chanpin, detailsModel); }