Exemple #1
0
        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();
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 private void SetChanpinInfo(Chanpin chanpin, ChanpinDetailsModel detailsModel)
 {
     ClassPropertyHelper.ChangeProperty(chanpin, detailsModel);
 }