public string GetNavigateUrl(object obj)
        {
            SupplierInfoDto item = (SupplierInfoDto)obj;
            string          url  = string.Format("{0}?{1}={2}", SupplierPage.PageUrl, SupplierPage.QryInstanceId, item.SupplierId);

            return(GetUrl(url));
        }
Beispiel #2
0
        public async Task <SupplierInfoDto> Execute()
        {
            Supplier supplier = await unitOfWork.Suppliers.Get(Id);

            SupplierInfoDto result = mapper.Map <Supplier, SupplierInfoDto>(supplier);

            return(result);
        }
        /// <summary>
        /// Loads a <see cref="SupplierInfo"/> object from the given <see cref="SupplierInfoDto"/>.
        /// </summary>
        /// <param name="data">The SupplierInfoDto to use.</param>
        private void Child_Fetch(SupplierInfoDto data)
        {
            // Value properties
            LoadProperty(SupplierIdProperty, data.SupplierId);
            LoadProperty(NameProperty, data.Name);
            var args = new DataPortalHookArgs(data);

            OnFetchRead(args);
        }
        private SupplierInfoDto Fetch(SafeDataReader dr)
        {
            var supplierInfo = new SupplierInfoDto();

            // Value properties
            supplierInfo.SupplierId = dr.GetInt32("SupplierId");
            supplierInfo.Name       = dr.GetString("Name");

            return(supplierInfo);
        }
Beispiel #5
0
 private void RetrieveData()
 {
     using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
     {
         SupplierFacade facade = new SupplierFacade(uow);
         CurrentInstance = facade.RetrieveSupplierInfo(InstanceId, new SupplierInfoConverter(CurrentUserContext.CurrentLanguage.Id));
         // Get Supplier reviews
         ReviewFacade reviewFacade = new ReviewFacade(uow);
         CurrentInstance.Reviews = reviewFacade.RetrieveReviewsBySupplier(InstanceId, new ReviewInfoConverter());
         // Get Supplier products
         ProductFacade productFacade = new ProductFacade(uow);
         CurrentInstance.Products = productFacade.RetrieveProductsBySupplier(InstanceId, new ProductInfoConverter(CurrentUserContext.CurrentLanguage.Id));
     }
 }
        public string GetOpeningHour(object obj)
        {
            SupplierInfoDto item      = (SupplierInfoDto)obj;
            string          startTime = string.Empty;
            string          endTime   = string.Empty;

            if (item.DayStartTime.HasValue)
            {
                startTime = item.DayStartTime.Value.ToShortTimeString();
            }
            if (item.DayEndTime.HasValue)
            {
                endTime = item.DayEndTime.Value.ToShortTimeString();
            }
            return(string.Format("{0} - {1}", startTime, endTime));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public async Task <SupplierInfoDto> GetRestaurantInfo(int orderId)
        {
            var restaurant = (await _dbContext.RestaurantMenuItem_Order
                              .FirstOrDefaultAsync(x => x.OrderId == orderId))
                             ?.RestaurantMenuItem.RestaurantMenu.Restaurant;

            if (restaurant is null)
            {
                throw new AppException(AppMessage.CantFindRestaurant);
            }

            var restaurantInfo = new SupplierInfoDto
            {
                Logo    = FileService.GetImageUrl(restaurant.Logo),
                Banner  = FileService.GetImageUrl(restaurant.Banner),
                Name    = restaurant.Name,
                Address = restaurant.Name
            };

            return(restaurantInfo);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public async Task <SupplierInfoDto> GetStoreInfo(int orderId)
        {
            var store = (await _dbContext.StoreProduct_Order
                         .FirstOrDefaultAsync(x => x.OrderId == orderId))
                        ?.StoreProduct.Store;

            if (store is null)
            {
                throw new AppException(AppMessage.CantFindStore);
            }

            var storeInfo = new SupplierInfoDto
            {
                Logo    = FileService.GetImageUrl(store.Logo),
                Banner  = FileService.GetImageUrl(store.Banner),
                Name    = store.Name,
                Address = store.Name
            };

            return(storeInfo);
        }
        public string GetNumberOfRatingsDisplay(object obj)
        {
            SupplierInfoDto item = (SupplierInfoDto)obj;

            return(string.Format("Number of ratings: {0}", item.NumberOfRatings));
        }