public PromotionsDish CreatePromotionsDish(PromotionsDishBean bean)
        {
            PromotionsDish beanBack = new PromotionsDish();

            beanBack.PromotionsDishId     = bean.PromotionsDishId;
            beanBack.TradeNo              = bean.TradeNo;
            beanBack.DishId               = bean.DishId;
            beanBack.MarketTypeId         = bean.MarketTypeId;
            beanBack.DishFormat           = bean.DishFormat;
            beanBack.Price                = bean.Price;
            beanBack.StartTime            = bean.StartTime;
            beanBack.EndTime              = bean.EndTime;
            beanBack.StartDate            = bean.StartDate;
            beanBack.EndDate              = bean.EndDate;
            beanBack.Week_1               = bean.Week_1;
            beanBack.Week_2               = bean.Week_2;
            beanBack.Week_3               = bean.Week_3;
            beanBack.Week_4               = bean.Week_4;
            beanBack.Week_5               = bean.Week_5;
            beanBack.Week_6               = bean.Week_6;
            beanBack.Week_0               = bean.Week_0;
            beanBack.Status               = bean.Status;
            beanBack.Usering              = bean.Usering;
            beanBack.CreateDatetime       = bean.CreateDatetime;
            beanBack.CreateBy             = bean.CreateBy;
            beanBack.Deleted              = bean.Deleted;
            beanBack.UpdateDatetime       = bean.UpdateDatetime;
            beanBack.UpdateBy             = bean.UpdateBy;
            beanBack.Dish                 = bean.Dish;
            beanBack.PromotionsDishDetail = bean.PromotionsDishDetail;
            return(beanBack);
        }
 //加载 菜品促销 信息明细
 public void JeiXiDetail(PromotionsDishBean bean) {
     DishLists.Clear();
     if (bean != null) {
         if (bean.PromotionsDishDetail != null && bean.PromotionsDishDetail.Count > 0) {
             foreach (var element in bean.PromotionsDishDetail) {
                 if (element.Deleted == 0) { 
                     PromotionsDishDetailBean  PDDB = new PromotionsDishDetailBean().CreatePromotionsDishDetailBean(element);
                     PDDB.DishName = _DataService.FindDishByDishId(element.DishId).DishName;
                     DishLists.Add(PDDB);
                 }
             }
         }
     }
 }
 /// <summary>
 /// 
 /// 加载数据
 /// </summary>
 public void Init()
 {
     List<PromotionsDish> list = _DataService.FindPromotionsDishByObject(SelectStartDate, SelectEndDate, SelectStatus);
     PromotionsDishLists.Clear();
     foreach (var element in list) {
         PromotionsDishBean PDB = new PromotionsDishBean().CreatePromotionsDishBean(element);
         PDB.MarketTypeName = GetMarketType(PDB.MarketTypeId)==null?"": GetMarketType(PDB.MarketTypeId).Name;
         PDB.Code = element.Dish.Code;
         PDB.DishName = element.Dish.DishName;
         PromotionsDishLists.Add(PDB);
     }
     if (PromotionsDishLists.Count > 0) {
         PromotionsDishSelected = PromotionsDishLists[0];
     }
     JeiXiDetail(PromotionsDishSelected);
 }
 //修改时候 数据组装
 public void CreateDatas(PromotionsDishBean bean) { 
     //改变赠菜明细 集合
     SelectDishLists.Clear();
     foreach (var element in bean.PromotionsDishDetail)
     {
         if (element.Deleted == 0) { 
             PromotionsDishDetailBean PDDB = (new PromotionsDishDetailBean()).CreatePromotionsDishDetailBean(element);
             PDDB.DishName = _DataService.FindDishByDishId(element.DishId).DishName;
             PDDB.IsModify = false;
             SelectDishLists.Add(PDDB);
         }
     }
     //注入市别
     SelectedMarketTypeItem = GetMarketType(bean.MarketTypeId);
 }
        public PromotionsDish CreatePromotionsDish(PromotionsDishBean bean)
        {
            PromotionsDish beanBack = new PromotionsDish();
            beanBack.PromotionsDishId = bean.PromotionsDishId;
            beanBack.TradeNo = bean.TradeNo;
            beanBack.DishId = bean.DishId;
            beanBack.MarketTypeId = bean.MarketTypeId;
            beanBack.DishFormat = bean.DishFormat;
            beanBack.Price = bean.Price;
            beanBack.StartTime = bean.StartTime;
            beanBack.EndTime = bean.EndTime;
            beanBack.StartDate = bean.StartDate;
            beanBack.EndDate = bean.EndDate;
            beanBack.Week_1 = bean.Week_1;
            beanBack.Week_2 = bean.Week_2;
            beanBack.Week_3 = bean.Week_3;
            beanBack.Week_4 = bean.Week_4;
            beanBack.Week_5 = bean.Week_5;
            beanBack.Week_6 = bean.Week_6;
            beanBack.Week_0 = bean.Week_0;
            beanBack.Status = bean.Status;
            beanBack.Usering = bean.Usering;
            beanBack.CreateDatetime = bean.CreateDatetime;
            beanBack.CreateBy = bean.CreateBy;
            beanBack.Deleted = bean.Deleted;
            beanBack.UpdateDatetime = bean.UpdateDatetime;
            beanBack.UpdateBy = bean.UpdateBy;
            beanBack.Dish = bean.Dish;
            beanBack.PromotionsDishDetail = bean.PromotionsDishDetail;
            return beanBack;

        }