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 BargainDishPrice CreateBargainDishPrice(BargainDishPriceBean bean)
        {
            BargainDishPrice beanBack = new BargainDishPrice();
            beanBack.Id = bean.Id;
            beanBack.BargainDishId = bean.BargainDishId;
            beanBack.DishSpecification = bean.DishSpecification;
            beanBack.Price1 = bean.Price1;
            beanBack.Price2 = bean.Price2;
            beanBack.Price3 = bean.Price3;
            beanBack.MemberPrice3 = bean.MemberPrice3;
            beanBack.MemberPrice2 = bean.MemberPrice2;
            beanBack.MemberPrice1 = bean.MemberPrice1;
            beanBack.CreateBy = bean.CreateBy;
            beanBack.CreateTime = bean.CreateTime;
            beanBack.Deleted = bean.Deleted;
            beanBack.UpdateTime = bean.UpdateTime;
            beanBack.Update_by = bean.Update_by;
            return beanBack;

        }
        public BargainDishPrice CreateBargainDishPrice(BargainDishBean bean)
        {
            BargainDishPrice beanBack = new BargainDishPrice();
            beanBack.Id = bean.BargainDishPrice == null ? 0 : bean.BargainDishPrice.Count == 0 ? 0 : bean.BargainDishPrice.First().Id;
            beanBack.BargainDishId = bean.Id;
            beanBack.Price1 = bean.Price1;
            beanBack.Price2 = bean.Price2;
            beanBack.Price3 = bean.Price3;
            beanBack.MemberPrice3 = bean.MemberPrice3;
            beanBack.MemberPrice2 = bean.MemberPrice2;
            beanBack.MemberPrice1 = bean.MemberPrice1;
            beanBack.DishSpecification = bean.DishFormat;
            beanBack.CreateBy = bean.CreateBy;
            beanBack.CreateTime = DateTime.Now;
            beanBack.Update_by = bean.UpdateBy;
            beanBack.UpdateTime = bean.UpdateDatetime;
            beanBack.Deleted = bean.Deleted;
            return beanBack;

        }
        public BargainDishPriceBean CreateBargainDishPriceBean(BargainDishPrice bean)
        {
            this.Id = bean.Id;
            this.BargainDishId = bean.BargainDishId;
            this.DishSpecification = bean.DishSpecification;
            this.Price1 = bean.Price1;
            this.Price2 = bean.Price2;
            this.Price3 = bean.Price3;
            this.MemberPrice3 = bean.MemberPrice3;
            this.MemberPrice2 = bean.MemberPrice2;
            this.MemberPrice1 = bean.MemberPrice1;
            this.CreateBy = bean.CreateBy;
            this.CreateTime = bean.CreateTime;
            this.Deleted = bean.Deleted;
            this.UpdateTime = bean.UpdateTime;
            this.Update_by = bean.Update_by;
            return this;

        }