Exemple #1
0
 public DishController(IDishService dishService, IUserService userService, IMapper mapper, IAccountService accountService)
 {
     _dishService    = dishService ?? throw new ArgumentNullException(nameof(dishService));
     _userService    = userService ?? throw new ArgumentNullException(nameof(userService));
     _mapper         = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _accountService = accountService ?? throw new ArgumentNullException(nameof(accountService));
 }
        public JsonResult ShareDish(int shopId, int recipesId)
        {
            IDishService    dish          = ServiceObjectContainer.Get <IDishService>();
            IRecipesService recipes       = ServiceObjectContainer.Get <IRecipesService>();
            IShopService    shop          = ServiceObjectContainer.Get <IShopService>();
            Shop            shopselect    = shop.GetShopInfoById(shopId).Data;
            Recipes         recipesselect = recipes.GetRecipesById(recipesId).Data;

            Dish dishmodel = new Dish();

            dishmodel.DishId      = Generation.GenerationId();
            dishmodel.Name        = "黑椒牛柳";
            dishmodel.Type        = Model.Enum.DishType.川菜.GetHashCode();
            dishmodel.MealTime    = Model.Enum.MealTime.午餐.GetHashCode();
            dishmodel.UpdateDate  = DateTime.Now;
            dishmodel.Image       = "";
            dishmodel.Description = "测试单品";
            dishmodel.ShopId      = shopselect.ShopId;
            dishmodel.ShopName    = shopselect.ShopName;

            DishShare share = new DishShare();

            share.DishInfo    = dishmodel;
            share.RecipesInfo = recipesselect;
            share.ShopInfo    = shopselect;

            return(Json(dish.ShareDishInfo(share)));
        }
 public DishController(ILoggerManager logger, IDishService dishService, IMapper mapper)
 {
     _logger = logger;
     //_repository = repository;
     this.mapper      = mapper;
     this.dishService = dishService;
 }
        public DishesUnitViewModel(IDishService _IDishService, IMessenger messenger)
            : base(messenger)
        {
            this._DishService = _IDishService;

            this.Init();
        }
Exemple #5
0
 public HealthyHelper(double imc, double dailyKCal, IAccountService accountService, IDishService dishService)
 {
     _imc            = imc;
     _dailyKCal      = dailyKCal;
     _accountService = accountService ?? throw new ArgumentNullException(nameof(accountService));
     _dishService    = dishService ?? throw new ArgumentNullException(nameof(dishService));
 }
 public ClearEstimateViewModel(IChooseDishesDataService dataService, IDishService DishService, IMessenger messenger)
     : base(messenger)
 {
     _DataService = dataService;
     _IDishService = DishService;
     Init();
 }
Exemple #7
0
        public JsonResult DishShare(Dish dish, int shopid, int recipeid)
        {
            IDishService    dishservice    = ServiceObjectContainer.Get <IDishService>();
            IRecipesService recipesservice = ServiceObjectContainer.Get <IRecipesService>();
            IShopService    shopservice    = ServiceObjectContainer.Get <IShopService>();
            Shop            shopselect     = shopservice.GetShopInfoById(shopid).Data;
            Recipes         recipesselect  = recipesservice.GetRecipesById(recipeid).Data;

            dish.DishId     = Generation.GenerationId();
            dish.UpdateDate = DateTime.Now;
            dish.ShopId     = shopselect.ShopId;
            dish.ShopName   = shopselect.ShopName;
            if (!string.IsNullOrEmpty(dish.Image))
            {
                int substringindex = dish.Image.LastIndexOf(',') + 1;
                dish.Image = dish.Image.Substring(substringindex, dish.Image.Length - substringindex);
            }



            DishShare share = new DishShare();

            share.DishInfo    = dish;
            share.RecipesInfo = recipesselect;
            share.ShopInfo    = shopselect;

            return(Json(dishservice.ShareDishInfo(share)));
        }
 public BasketService(IMapper mapper, UserManager <AppUser> userManager, DreamFoodDeliveryContext context, IDishService dishService)
 {
     _context     = context;
     _userManager = userManager;
     _mapper      = mapper;
     _dishService = dishService;
 }
Exemple #9
0
 public ManageController(
     IDishTypeService dishTypeService,
     IIngredientService ingredientService,
     IDishService dishService,
     IDrinkTypeService drinkTypeService,
     IPackagingService packagingService,
     IAllergenService allergenService,
     IWebHostEnvironment webHostEnvironment,
     IDrinkService drinkService,
     IUserService userService,
     IOrderService orderService,
     ITableService tableService,
     IPromoCodeService promoCodeService)
 {
     this.dishTypeService    = dishTypeService;
     this.ingredientService  = ingredientService;
     this.dishService        = dishService;
     this.drinkTypeService   = drinkTypeService;
     this.packagingService   = packagingService;
     this.allergenService    = allergenService;
     this.webHostEnvironment = webHostEnvironment;
     this.drinkService       = drinkService;
     this.userService        = userService;
     this.orderService       = orderService;
     this.tableService       = tableService;
     this.promoCodeService   = promoCodeService;
 }
Exemple #10
0
 public ClearEstimateViewModel(IChooseDishesDataService dataService, IDishService DishService, IMessenger messenger)
     : base(messenger)
 {
     _DataService  = dataService;
     _IDishService = DishService;
     Init();
 }
Exemple #11
0
 public HomeController(IDishService dishService, IIngredientService ingredientService, IOrdersService orders, IDeliveryService delivery)
 {
     ordersService          = orders;
     deliveryService        = delivery;
     this.dishService       = dishService;
     this.ingredientService = ingredientService;
 }
 public DishOrderViewModel(IDishService dishService)
 {
     _dishService = dishService;
     loadDishs();
     SelectCommand = new DelegateCommand(new Action(SelectItem));
     UserCiresDevice.UserChooseChanged = new Action(SelectItem);
 }
 public DishController(
     IRedisDatabase redisDatabase,
     IDishService dishService)
 {
     _redisDatabase = redisDatabase;
     _dishService   = dishService;
 }
        public MainWindowViewModel(IDishService dishService, IIngredientService ingredientService)
        {
            _dishService       = dishService;
            _ingredientService = ingredientService;

            DishModels = new BindingList <DishModel>(_dishService.GetAvailableDishes().ToList());
        }
Exemple #15
0
        public DishTests()
        {
            AutoMapperConfiguration.Configure();
            UnityConfig.RegisterComponents();

            var mockDishRepository = new Mock <IDishRepository>();

            mockDishRepository.Setup(x => x.CreateQuery()).Returns(DishData.CreateQuery);
            mockDishRepository.Setup(x => x.Get(1)).Returns(DishData.Get);
            mockDishRepository.Setup(x => x.Update(DishData.Get())).Callback(() => edited = true);

            var mockDishTagRepository = new Mock <IDishTagRepository>();

            var mockTagRepository = new Mock <ITagRepository>();

            mockTagRepository.Setup(m => m.CreateQuery()).Returns(TagData.CreateQuery);

            var mockTagService = new Mock <ITagService>();

            var mockUserRepository = new Mock <IUserRepository>();

            mockUserRepository.Setup(m => m.Get(1)).Returns(new User {
                UserName = "******"
            });

            dishService    = new DishService(mockDishRepository.Object, mockDishTagRepository.Object, mockTagRepository.Object, mockTagService.Object);
            dishController = new DishController(dishService);
        }
Exemple #16
0
 public FormPutInKitchen(IKitchenService serviceS, IDishService serviceC, IMainService serviceM)
 {
     InitializeComponent();
     this.serviceS = serviceS;
     this.serviceC = serviceC;
     this.serviceM = serviceM;
 }
Exemple #17
0
 public CartService(IUnitOfWork unitOfWork, IOrderService orderService, ITransactionService transactionService, IDishService dishService)
 {
     _unitOfWork         = unitOfWork;
     _orderService       = orderService;
     _transactionService = transactionService;
     _dishService        = dishService;
 }
Exemple #18
0
 public DishesController(IDishService dishService, IRestaurantService restaurantService, IIngredientService ingredientService, IRequestLogService requestLogService)
 {
     _dishService       = dishService;
     _restaurantService = restaurantService;
     _ingredientService = ingredientService;
     _requestLogService = requestLogService;
 }
Exemple #19
0
 public CartController(IDishService dishService, UserManager <AppUser> userManager, IOrderService orderService, IUserService userService)
 {
     _dishService  = dishService;
     _userManager  = userManager;
     _orderService = orderService;
     _userService  = userService;
 }
 public OrderController(IOrderService orderService, IDishService dishService, ICategoryService categoryService, IOrderStatusService orderStatusService)
 {
     _orderService = orderService;
     _dishService = dishService;
     _categoryService = categoryService;
     _orderStatusService = orderStatusService;
 }
 public DishController(IDishService dishservice, IUserService userservice, IDishTypeService dishtypeservice, IImageService imageservice)
 {
     DishSvc = dishservice;
     UserSvc = userservice;
     DishTypeSvc = dishtypeservice;
     ImageSvc = imageservice;
 }
Exemple #22
0
 public BargainDishViewModel(IChooseDishesDataService dataService, IDishService DishService, IMessenger messenger)
     : base(messenger)
 {
     _DataService  = dataService;
     _IDishService = DishService;
     //Init();
 }
Exemple #23
0
 public DishesController(IDishService service, IDishCategoryService categoryService, IDeliveryAreaService areaService, IScheduleService scheduleService)
 {
     _service         = service;
     _categoryService = categoryService;
     _areaService     = areaService;
     _scheduleService = scheduleService;
 }
Exemple #24
0
 public ProgramDayService(FitnessAppContext context, IMapper mapper, IRepository <ProgramDay> repository, IDishService dishService, IProgramTypeService programTypeService)
 {
     _context            = context;
     _mapper             = mapper;
     _repository         = repository;
     _dishService        = dishService;
     _programTypeService = programTypeService;
 }
Exemple #25
0
 public UserService(AppDbContext dbContext,
                    IMapper mapper,
                    IDishService dishService)
 {
     _dbContext   = dbContext;
     _mapper      = mapper;
     _dishService = dishService;
 }
 public DishTypeViewModel(IDishService dishService, IMessenger messenger)
     : base(messenger)
 {
     _DishService = dishService;
     this.Init();//构造目录树
     //初始化时查询所有子类
     this.DisheTypeItem = new ObservableCollection <DishType>(_DishService.LoadSubType());
 }
 public RestaurantService(IRestaurantRepository restaurantRepository,
                          IUserService userService, IDishService dishService, IMapper mapper)
 {
     _restaurantRepository = restaurantRepository;
     _userService          = userService;
     _dishService          = dishService;
     _mapper = mapper;
 }
 public AccountController(IUserService userservice, IDishService dishservice, IGeoCoder geocodeservice, IImageService imageservice, IReservationService reservationservice)
 {
     UserSvc = userservice;
     DishSvc = dishservice;
     GeocodeSvc = geocodeservice;
     ImageSvc = imageservice;
     ReservationSvc = reservationservice;
 }
Exemple #29
0
 public EatService(IUnitOfWork uow, IScheduleService scheduleService, IUserService userService, IAccountService accountService, IDishService dishService)
 {
     _uow             = uow ?? throw new ArgumentNullException(nameof(uow));
     _userService     = userService ?? throw new ArgumentNullException(nameof(userService));
     _scheduleService = scheduleService ?? throw new ArgumentNullException(nameof(scheduleService));
     _accountService  = accountService ?? throw new ArgumentNullException(nameof(accountService));
     _dishService     = dishService ?? throw new ArgumentNullException(nameof(dishService));
 }
Exemple #30
0
 public HomeController(IDishService productService, IRestaurantService shopService,
                       ICategoryService categoryService, IShoppingBasketService shoppingBasketService)
 {
     _dishService           = productService;
     _restaurantService     = shopService;
     _categoryService       = categoryService;
     _shoppingBasketService = shoppingBasketService;
 }
Exemple #31
0
 public AddDishViewModel(INavigationService navigationService,
                         IUserDialogs userDialogs,
                         IDishService dishService) : base(navigationService)
 {
     _navigationService = navigationService;
     _userDialog        = userDialogs;
     _dishService       = dishService;
 }
 public DishController(IDishService dishService,
                       ICategoryService categoryService,
                       IRestaurantService restaurantService)
 {
     _dishService       = dishService;
     _categoryService   = categoryService;
     _restaurantService = restaurantService;
 }
 public BuyDishGivingViewModel(IChooseDishesDataService dataService, IDishService DishService, IMessenger messenger)
     : base(messenger)
 {
     _DataService = dataService;
     _IDishService = DishService;
     //Init();
     
 }
Exemple #34
0
        public MenuController(IDishService service)
        {
            _service = service;

            _mapper = new Mapper(
                new MapperConfiguration(ctg
                                        => ctg.AddProfile <MenuProfile>()));
        }
        public DishControllerTest()
        {
            SetAutoMapper();

            _service    = new DishServiceTest(_mapper);
            _controller = new DishController(_service);
            _validator  = new DishValidator();
        }
        public DishTypeViewModel(IDishService dishService, IMessenger messenger)
            : base(messenger)
        {
            _DishService = dishService;
            this.Init();//构造目录树
            //初始化时查询所有子类
            this.DisheTypeItem = new ObservableCollection<DishType>(_DishService.LoadSubType());

        }
 public DishesViewModel(IChooseDishesDataService dataService , IDishService DishService ,IMessenger messenger)
     : base(messenger)
 {
     _DataService = dataService;
     _IDishService = DishService;
     IsNotEdit = true;
     //Init();
     //LoadDishBase(0);
     
 }
Exemple #38
0
 public DishController(IDishService dishService, IRestaurantService restaurantService)
 {
     this.dishService = dishService;
     this.restaurantService = restaurantService;
 }
 public ReservationController(IReservationService reservationservice, IUserService userservice, IDishService dishservice)
 {
     ReservationSvc = reservationservice;
     UserSvc = userservice;
     DishSvc = dishservice;
 }
        public DishesUnitViewModel(IDishService _IDishService, IMessenger messenger)
            : base(messenger)
        {
            this._DishService = _IDishService;

            this.Init();
        }
 public SearchController(IDishService dishservice, ISearchService searchservice)
 {
     DishSvc = dishservice;
     SearchSvc = searchservice;
 }
 public DishesWayRefViewModel(IDischesWayRefService dataService,IDishesWayDataService dishesWaySercice,IChooseDishesDataService chooseDishesService,IDishService dishService, IMessenger messenger)
     : base(messenger)
 {
     _DataService = dataService;
     _DishesWaySercice = dishesWaySercice;
     _ChooseDishesService=chooseDishesService;
     _DishService = dishService;
     //MessageBox.Show("在初始化做法");
     InitTreeByDishData();
 }
 public UserController(IUserService userservice, IDishService dishservice)
 {
     UserSvc = userservice;
     DishSvc = dishservice;
 }
Exemple #44
0
 public DishController(ICategoryService categoryService, IDishService dishService, IMarkupService markupService)
 {
     _dishService = dishService;
     _categoryService = categoryService;
     _markupService = markupService;
 }
        //结账操作

        public ChooseDishesViewModel(IChooseDishesDataService dataService, IDishService dishService, IMessenger messenger)
            : base(messenger)
        {
            _DataService = dataService;
            _DishService = dishService;
            Init();
            //List<DishType> types = _DishService.LoadFatherType();    //大类
            //List<DishType> subs = _DishService.LoadSubTypeAndDishs();   //小类

            //for (int i = 0; i < 10; i++) {
            //    Dishes.Add(new DishModel("S00" + i, "菜品" + i, 10.09));
            //}
        }
 public StatisticController(IOrderService orderService, IDishService dishService, ICategoryService categoryService)
 {
     _categoryService = categoryService;
     _orderService = orderService;
     _dishService = dishService;
 }
 public HomeController(IDishTypeService dishtypeservice, IUserService userservice, IDishService dishservice)
 {
     DishTypeSvc = dishtypeservice;
     UserSvc = userservice;
     DishSvc = dishservice;
 }
 public DisplayService()
 {
     this.dishService = new DishService();
 }
 public DisplayService(IDishService dishService)
 {
     this.dishService = dishService;
 }
 public FatherDishTypeViewModel(IDishService dishService, IMessenger messenger)
     : base(messenger)
 {
     _DishService = dishService;
     this.Init();//
 }
Exemple #51
0
 public MainController(IDishService dishService, ICategoryService categoryService)
 {
     _dishService = dishService;
     _categoryService = categoryService;
 }