Пример #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));
 }
Пример #2
0
        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)));
        }
Пример #3
0
 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();
        }
Пример #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();
 }
Пример #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;
 }
Пример #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;
 }
Пример #10
0
 public ClearEstimateViewModel(IChooseDishesDataService dataService, IDishService DishService, IMessenger messenger)
     : base(messenger)
 {
     _DataService  = dataService;
     _IDishService = DishService;
     Init();
 }
Пример #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);
 }
Пример #13
0
 public DishController(
     IRedisDatabase redisDatabase,
     IDishService dishService)
 {
     _redisDatabase = redisDatabase;
     _dishService   = dishService;
 }
Пример #14
0
        public MainWindowViewModel(IDishService dishService, IIngredientService ingredientService)
        {
            _dishService       = dishService;
            _ingredientService = ingredientService;

            DishModels = new BindingList <DishModel>(_dishService.GetAvailableDishes().ToList());
        }
Пример #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);
        }
Пример #16
0
 public FormPutInKitchen(IKitchenService serviceS, IDishService serviceC, IMainService serviceM)
 {
     InitializeComponent();
     this.serviceS = serviceS;
     this.serviceC = serviceC;
     this.serviceM = serviceM;
 }
Пример #17
0
 public CartService(IUnitOfWork unitOfWork, IOrderService orderService, ITransactionService transactionService, IDishService dishService)
 {
     _unitOfWork         = unitOfWork;
     _orderService       = orderService;
     _transactionService = transactionService;
     _dishService        = dishService;
 }
Пример #18
0
 public DishesController(IDishService dishService, IRestaurantService restaurantService, IIngredientService ingredientService, IRequestLogService requestLogService)
 {
     _dishService       = dishService;
     _restaurantService = restaurantService;
     _ingredientService = ingredientService;
     _requestLogService = requestLogService;
 }
Пример #19
0
 public CartController(IDishService dishService, UserManager <AppUser> userManager, IOrderService orderService, IUserService userService)
 {
     _dishService  = dishService;
     _userManager  = userManager;
     _orderService = orderService;
     _userService  = userService;
 }
Пример #20
0
 public OrderController(IOrderService orderService, IDishService dishService, ICategoryService categoryService, IOrderStatusService orderStatusService)
 {
     _orderService = orderService;
     _dishService = dishService;
     _categoryService = categoryService;
     _orderStatusService = orderStatusService;
 }
Пример #21
0
 public DishController(IDishService dishservice, IUserService userservice, IDishTypeService dishtypeservice, IImageService imageservice)
 {
     DishSvc = dishservice;
     UserSvc = userservice;
     DishTypeSvc = dishtypeservice;
     ImageSvc = imageservice;
 }
Пример #22
0
 public BargainDishViewModel(IChooseDishesDataService dataService, IDishService DishService, IMessenger messenger)
     : base(messenger)
 {
     _DataService  = dataService;
     _IDishService = DishService;
     //Init();
 }
Пример #23
0
 public DishesController(IDishService service, IDishCategoryService categoryService, IDeliveryAreaService areaService, IScheduleService scheduleService)
 {
     _service         = service;
     _categoryService = categoryService;
     _areaService     = areaService;
     _scheduleService = scheduleService;
 }
Пример #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;
 }
Пример #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());
 }
Пример #27
0
 public RestaurantService(IRestaurantRepository restaurantRepository,
                          IUserService userService, IDishService dishService, IMapper mapper)
 {
     _restaurantRepository = restaurantRepository;
     _userService          = userService;
     _dishService          = dishService;
     _mapper = mapper;
 }
Пример #28
0
 public AccountController(IUserService userservice, IDishService dishservice, IGeoCoder geocodeservice, IImageService imageservice, IReservationService reservationservice)
 {
     UserSvc = userservice;
     DishSvc = dishservice;
     GeocodeSvc = geocodeservice;
     ImageSvc = imageservice;
     ReservationSvc = reservationservice;
 }
Пример #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));
 }
Пример #30
0
 public HomeController(IDishService productService, IRestaurantService shopService,
                       ICategoryService categoryService, IShoppingBasketService shoppingBasketService)
 {
     _dishService           = productService;
     _restaurantService     = shopService;
     _categoryService       = categoryService;
     _shoppingBasketService = shoppingBasketService;
 }
Пример #31
0
 public AddDishViewModel(INavigationService navigationService,
                         IUserDialogs userDialogs,
                         IDishService dishService) : base(navigationService)
 {
     _navigationService = navigationService;
     _userDialog        = userDialogs;
     _dishService       = dishService;
 }
Пример #32
0
 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();
     
 }
Пример #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());

        }
Пример #37
0
 public DishesViewModel(IChooseDishesDataService dataService , IDishService DishService ,IMessenger messenger)
     : base(messenger)
 {
     _DataService = dataService;
     _IDishService = DishService;
     IsNotEdit = true;
     //Init();
     //LoadDishBase(0);
     
 }
Пример #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();
        }
Пример #41
0
 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();
 }
Пример #43
0
 public UserController(IUserService userservice, IDishService dishservice)
 {
     UserSvc = userservice;
     DishSvc = dishservice;
 }
Пример #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));
            //}
        }
Пример #46
0
 public StatisticController(IOrderService orderService, IDishService dishService, ICategoryService categoryService)
 {
     _categoryService = categoryService;
     _orderService = orderService;
     _dishService = dishService;
 }
Пример #47
0
 public HomeController(IDishTypeService dishtypeservice, IUserService userservice, IDishService dishservice)
 {
     DishTypeSvc = dishtypeservice;
     UserSvc = userservice;
     DishSvc = dishservice;
 }
Пример #48
0
 public DisplayService()
 {
     this.dishService = new DishService();
 }
Пример #49
0
 public DisplayService(IDishService dishService)
 {
     this.dishService = dishService;
 }
 public FatherDishTypeViewModel(IDishService dishService, IMessenger messenger)
     : base(messenger)
 {
     _DishService = dishService;
     this.Init();//
 }
Пример #51
0
 public MainController(IDishService dishService, ICategoryService categoryService)
 {
     _dishService = dishService;
     _categoryService = categoryService;
 }