void IEditableObject.EndEdit() { if (this.ID == Guid.Empty) { this.ID = Guid.NewGuid(); this.CreateDate = DateTime.Now; var target = new GoodsModule.Goods(this.ID, this.Code, this.Quantity, this.LeftDay, this.StorageId, this.Name, this.Desc, this.Price, this.CreateDate); GoodsModule.AddGoods(new GoodsModule.Goods[] { target }, ConfigManager.GoodsFileName); } }
public GoodsModel(GoodsModule.Goods goods) { this.ID = goods.ID; this.Code = goods.Code; this.Name = goods.Name; this.Quantity = goods.Quantity; this.LeftDay = goods.LeftDay; this.StorageId = goods.StorageId; this.Desc = goods.Desc; this.Price = goods.Price; this.CreateDate = goods.CreateDate; }