Пример #1
0
 public DishBean CreateDishBean2DishWay(Dish dish,DishUnit unit)
 {
     this.AidNumber = dish.AidNumber;
     this.Code = dish.Code;
     this.CreateBy = dish.CreateBy;
     this.CreateDatetime = dish.CreateDatetime;
     this.Deleted = dish.Deleted;
     this.Detail = dish.Detail;
     this.DischesType = dish.DischesType;
     this.DiscountConfirm = dish.DiscountConfirm;
     this.DishFinanceId = dish.DishFinanceId;
     this.DishFormat = dish.DishFormat;
     this.DishId = dish.DishId;
     this.DishName = dish.DishName;
     this.DishTypeId = dish.DishTypeId;
     this.DishUnitId = dish.DishUnitId;
     this.EnglishName = dish.EnglishName;
     this.FoodFight = dish.FoodFight;
     this.Img = dish.Img;
     this.IsStop = dish.IsStop;
     this.KitchenType = dish.KitchenType;
     this.LineConfirm = dish.LineConfirm;
     this.LowConsumerConfirm = dish.LowConsumerConfirm;
     this.PackagesConfirm = dish.PackagesConfirm;
     this.PingYing = dish.PingYing;
     this.PosConfirm = dish.PosConfirm;
     this.PriceTimeConfirm = dish.PriceTimeConfirm;
     this.PublisherType = dish.PublisherType;
     this.SanpConfirm = dish.SanpConfirm;
     this.Status = dish.Status;
     this.ServerfreeConsumer = dish.ServerfreeConsumer;
     this.UpdateBy = dish.UpdateBy;
     this.UpdateDatetime = dish.UpdateDatetime;
     this.WeightConfirm = dish.WeightConfirm;
     this.DishUnitName = unit.Name;
     return this;
 }
Пример #2
0
        public DishUnit CreateDishUnit(DishesUnitModel bean)
        {
            DishUnit beanBack = new DishUnit();
            beanBack.DishUnitId = bean.DishUnitId;
            beanBack.Name = bean.Name;
            beanBack.SaleType = bean.SaleType;
            beanBack.OrderNum = bean.OrderNum;
            beanBack.CreateDatetime = bean.CreateDatetime;
            beanBack.CreateBy = bean.CreateBy;
            beanBack.Deleted = bean.Deleted;
            beanBack.Status = bean.Status;
            beanBack.UpdateDatetime = bean.UpdateDatetime;
            beanBack.UpdateBy = bean.UpdateBy;
            return beanBack;

        }
Пример #3
0
        public DishesUnitModel CreateDishUnitBean(DishUnit bean)
        {
            this.DishUnitId = bean.DishUnitId;
            this.Name = bean.Name;
            this.SaleType = bean.SaleType;
            this.OrderNum = bean.OrderNum;
            this.CreateDatetime = bean.CreateDatetime;
            this.CreateBy = bean.CreateBy;
            this.Deleted = bean.Deleted;
            this.Status = bean.Status;
            this.UpdateDatetime = bean.UpdateDatetime;
            this.UpdateBy = bean.UpdateBy;
            return this;

        }
Пример #4
0
 public int AddDishesUnit(DishUnit dishesUnit) {
     using (ChooseDishesEntities entities = new ChooseDishesEntities()){
         entities.DishUnit.Add(dishesUnit);
         entities.SaveChanges();
         return dishesUnit.DishUnitId;
     }
 }
Пример #5
0
 public int[] BatchAddDishesUnit(DishUnit[] dishesUnits) {
     using (ChooseDishesEntities entities = new ChooseDishesEntities())
     {
         foreach (var unit in dishesUnits) {
             unit.CreateDatetime = DateTime.Now;
             unit.CreateBy = 10000;
         }
         entities.DishUnit.AddRange(dishesUnits);
         entities.SaveChanges();
         return new int[]{};
     }
   
 }
Пример #6
0
 public bool BatchAddDishesUnit(DishUnit[] dishesUnits) {
     if (dishesUnits == null || dishesUnits.Length <= 0) {
         return false;
     }
     using (ChooseDishesEntities entities = new ChooseDishesEntities())
     {
         foreach (var element in dishesUnits)
         {
             if (element.Name == null || "".Equals(element)) {
                 return false;
             }
             entities.DishUnit.AddRange(dishesUnits);
             entities.SaveChanges();
         }
         return true;
     }
   
 }