public BargainDish CreateBargainDish(BargainDishBean bean) { BargainDish beanBack = new BargainDish(); beanBack.Id = bean.Id; beanBack.DishId = bean.DishId; beanBack.StartTime = bean.StartTime; beanBack.EndTime = bean.EndTime; beanBack.StartDate = bean.StartDate; beanBack.EndDate = bean.EndDate; beanBack.Week1 = bean.Week1; beanBack.Week2 = bean.Week2; beanBack.Week3 = bean.Week3; beanBack.Week4 = bean.Week4; beanBack.Week5 = bean.Week5; beanBack.Week6 = bean.Week6; beanBack.Week0 = bean.Week0; beanBack.MarketTypeId = bean.MarketTypeId; beanBack.Enable = bean.Enable; beanBack.CreateBy = bean.CreateBy; beanBack.CreateTime = DateTime.Now; beanBack.Update_by = bean.UpdateBy; beanBack.UpdateTime = bean.UpdateDatetime; beanBack.Deleted = bean.Deleted; return(beanBack); }
public List <BargainDish> CreateBargainDishList(DishBeanUtil[] _BargainDiahSelectList) { if (_BargainDiahSelectList != null && _BargainDiahSelectList.Length > 0) { List <BargainDish> list = new List <BargainDish>(); foreach (var element in _BargainDiahSelectList) { BargainDish bargainDishBean = CreateBargainDish(this); bargainDishBean.DishId = element.DishId; bargainDishBean.Enable = 1; bargainDishBean.MarketTypeId = 0; bargainDishBean.CreateBy = SubjectUtils.GetAuthenticationId(); BargainDishPrice bargainDishPrice = new BargainDishPrice(); bargainDishPrice.Price1 = element.Price1; bargainDishPrice.Price2 = element.Price2; bargainDishPrice.Price3 = element.Price3; bargainDishPrice.MemberPrice3 = element.MemberPrice3; bargainDishPrice.MemberPrice2 = element.MemberPrice2; bargainDishPrice.MemberPrice1 = element.MemberPrice1; bargainDishPrice.DishSpecification = element.DishFormat; bargainDishPrice.CreateBy = bargainDishBean.CreateBy; bargainDishPrice.CreateTime = DateTime.Now; bargainDishBean.BargainDishPrice.Add(bargainDishPrice); list.Add(bargainDishBean); } return(list); } return(null); }
public BargainDishBean CreateBargainDishBean(BargainDish bean) { this.Id = bean.Id; this.DishId = bean.DishId; this.StartTime = bean.StartTime; this.EndTime = bean.EndTime; this.StartDate = bean.StartDate; this.EndDate = bean.EndDate; this.Week1 = bean.Week1; this.Week2 = bean.Week2; this.Week3 = bean.Week3; this.Week4 = bean.Week4; this.Week5 = bean.Week5; this.Week6 = bean.Week6; this.Week0 = bean.Week0; this.MarketTypeId = bean.MarketTypeId; this.Enable = bean.Enable; this.CreateBy = bean.CreateBy; this.CreateDatetime = bean.CreateTime; this.UpdateBy = bean.Update_by; this.UpdateDatetime = bean.UpdateTime; this.Deleted = bean.Deleted; this.BargainDishPrice = bean.BargainDishPrice; InjectDish(bean.Dish); InjectBargainDishPrice(); return(this); }