Esempio n. 1
0
 public ProductCatalogStructurePackage(BaseProductService baseProductService, ProductListService productListService,
                                       RelationshipTypeService relationshipTypeService, CategoryService categoryService,
                                       UnitOfMeasurementService unitOfMeasurementService, DataService dataService,
                                       FieldTemplateService fieldTemplateService,
                                       LanguageService languageService, VariantService variantService,
                                       InventoryService inventoryService,
                                       PriceListService priceListService,
                                       StructureInfoService structureInfoService,
                                       CurrencyService currencyService,
                                       FilterService filterService,
                                       InventoryItemService inventoryItemService,
                                       PriceListItemService priceListItemService,
                                       ProductListItemService productListItemService)
 {
     _baseProductService        = baseProductService;
     _categoryService           = categoryService;
     _dataService               = dataService;
     _fieldTemplateService      = fieldTemplateService;
     _languageService           = languageService;
     _variantService            = variantService;
     _inventoryService          = inventoryService;
     _priceListService          = priceListService;
     _structureInfoService      = structureInfoService;
     _currencyService           = currencyService;
     _filterService             = filterService;
     _productListService        = productListService;
     _relationshipTypeService   = relationshipTypeService;
     _unitOfMeasurementService  = unitOfMeasurementService;
     _bidirectionalRelationList = new List <ImportBidirectionalRelation>();
     _inventoryItemService      = inventoryItemService;
     _priceListItemService      = priceListItemService;
     _productListItemService    = productListItemService;
 }
Esempio n. 2
0
        public void PriceForValidItemsTests()
        {
            IPriceListService priceListService = new PriceListService();
            decimal           price_a          = priceListService.GetPriceBySkuID("A");

            Assert.True(price_a > 0);
        }
Esempio n. 3
0
 public AcceleratorPackage(
     AssortmentService assortmentService,
     FieldTemplateService fieldTemplateService,
     StructureInfoService structureInfoService,
     MarketService marketService,
     ChannelService channelService,
     CurrencyService currencyService,
     WebsiteService websiteService,
     InventoryService inventoryService,
     PriceListService priceListService,
     DomainNameService domainNameService,
     GroupService groupService,
     FolderService folderService,
     PersonService personService,
     LanguageService languageService,
     SlugifyService slugifyService)
 {
     _assortmentService    = assortmentService;
     _fieldTemplateService = fieldTemplateService;
     _structureInfoService = structureInfoService;
     _marketService        = marketService;
     _channelService       = channelService;
     _currencyService      = currencyService;
     _websiteService       = websiteService;
     _inventoryService     = inventoryService;
     _priceListService     = priceListService;
     _domainNameService    = domainNameService;
     _groupService         = groupService;
     _folderService        = folderService;
     _personService        = personService;
     _languageService      = languageService;
     _slugifyService       = slugifyService;
 }
 //For store employee to view catalogue details and update & delete catalogue
 public ActionResult Details(long itemId, string sessionId)
 {
     ViewData["catalogue"] = CatalogueService.GetCatalogueById(itemId);
     ViewData["pricelist"] = PriceListService.GetPriceListByItemId(itemId);
     ViewData["sessionId"] = sessionId;
     return(View());
 }
Esempio n. 5
0
        public void CheckPriceListsAllItems()
        {
            IPriceListService priceListService = new PriceListService();
            var dict = priceListService.GetAllPrices();

            Assert.True(dict.ContainsKey("A"));
        }
Esempio n. 6
0
        public void GetPriceListTest()
        {
            var request  = new FortnoxApiRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret);
            var response = PriceListService.GetPriceListAsync(request, "A").GetAwaiter().GetResult();

            Assert.IsTrue(response.Code == "A");
        }
Esempio n. 7
0
        public async Task GetPriceListsTest()
        {
            var request  = new PriceListListRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret);
            var response = await PriceListService.GetPriceListsAsync(request);

            Assert.IsTrue(response.Data.Count() > 0);
        }
Esempio n. 8
0
 public PriceListService2Client()
 {
     stub                 = new PriceListService();
     stub.Credentials     = new System.Net.NetworkCredential(WEBSERVICE_LOGIN, WEBSERVICE_PASSWORD);
     stub.PreAuthenticate = true;
     stub.Url             = WEBSERVICE_URL;
 }
 public ActionResult StockCard(long itemId, string sessionId)
 {
     ViewData["catalogue"]  = CatalogueService.GetCatalogueById(itemId);
     ViewData["priceList"]  = PriceListService.GetPriceListByItemId(itemId);
     ViewData["stockCards"] = StockCardService.GetStockCardById(itemId);
     ViewData["sessionId"]  = sessionId;
     return(View());
 }
 public ODataProductsController(DataService dataService, VariantService variantService,
                                PriceListItemService priceListItemService,
                                PriceListService priceListService)
 {
     this.dataService          = dataService;
     this.variantService       = variantService;
     this.priceListItemService = priceListItemService;
     this.priceListService     = priceListService;
 }
        public JsonNetResult Index()
        {
            var priceListService = new PriceListService();
            var priceLists       = priceListService.GetPriceLists();

            return(new JsonNetResult
            {
                Data = priceLists
            });
        }
        public JsonNetResult GetPriceList([RoutePart] int priceListId)
        {
            var prod      = new PriceListService();
            var priceList = prod.GetPriceList(priceListId);

            return(new JsonNetResult
            {
                Data = priceList
            });
        }
        public JsonNetResult CreatePriceList(PriceListViewModel priceList)
        {
            var prod         = new PriceListService();
            var newPriceList = prod.CreatePriceList(priceList);

            return(new JsonNetResult
            {
                Data = newPriceList
            });
        }
        public JsonNetResult EditPriceList(PriceListViewModel priceList)
        {
            var prod          = new PriceListService();
            var priceListEdit = prod.EditPriceList(priceList);

            return(new JsonNetResult
            {
                Data = priceListEdit
            });
        }
        public JsonNetResult GetProducts([RoutePart] int priceListId)
        {
            var priceListService = new PriceListService();
            var products         = priceListService.GetProducts(priceListId);

            return(new JsonNetResult
            {
                Data = products
            });
        }
Esempio n. 16
0
        private void GetPriceList()
        {
            var service = new PriceListService();

            AuthorisedService(service);
            int pagesize = Convert.ToInt16(txtPageSize.Text);
            int pageSkip = Convert.ToInt16(txtPage.Text) * pagesize;

            dgvReturn.DataSource = service.GetPriceList(txtID.Text, txtId2.Text);
        }
        public JsonNetResult PriceListExists(string priceListCode)
        {
            var prod            = new PriceListService();
            var priceListExists = prod.PriceListAlreadyExists(priceListCode);

            return(new JsonNetResult
            {
                Data = priceListExists
            });
        }
        public JsonNetResult DeletePricelist(int priceListId)
        {
            var priceList = new PriceListService();

            priceList.DeletePriceList(priceListId);

            return(new JsonNetResult
            {
                Data = new { priceListId = priceListId }
            });
        }
Esempio n. 19
0
        public void UpdatePriceListTest()
        {
            var description = $"{DateTime.Now}";
            var request     = new FortnoxApiRequest(this.connectionSettings.AccessToken, this.connectionSettings.ClientSecret);
            var priceList   = new PriceList {
                Code = "AB", Description = description
            };

            var updatedPriceList = PriceListService.UpdatePriceListAsync(request, priceList).GetAwaiter().GetResult();

            Assert.AreEqual(description, updatedPriceList.Description);
        }
        public JsonResult GetPaymentMethodsByPriceList(Guid priceListId)
        {
            var httpClient = GetHttpClient();

            var priceList = PriceListService.QueryPriceList(httpClient, priceListId);

            if (priceList == null)
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
            var paymentMehods = PaymentMethodService.QueryPaymentMethodsByCategory(httpClient, priceList.PaymentMethods);

            return(Json(paymentMehods, JsonRequestBehavior.AllowGet));
        }
        public ActionResult UpdateNext(long itemId, string sessionId)
        {
            ViewData["itemId"]    = itemId;
            ViewData["pricelist"] = PriceListService.GetPriceListByItemId(itemId);

            if (PriceListService.GetPriceListByItemId(itemId) == null)
            {
                return(RedirectToAction("CreateNext", new { itemId, sessionid = sessionId }));
            }
            else
            {
                List <string> supplierNames = SupplierService.GetAllSupplierNames();
                ViewData["supplierNames"] = supplierNames;
                ViewData["sessionId"]     = sessionId;
                return(View());
            }
        }
        public JsonResult GetPortalUser(string username, string password)
        {
            var httpClient = GetHttpClient();

            var portalUser = PortalUserService.QueryPortalUserByUsernameByPassword(httpClient, username, password);

            if (portalUser == null)
            {
                return(Json("error", JsonRequestBehavior.AllowGet));
            }

            if (portalUser.PortalUserRole == 0)
            {
                return(Json("error:Portaluserrole attribute of portal user object is null!", JsonRequestBehavior.AllowGet));
            }

            List <PriceList> portalUserPriceLists;

            switch (portalUser.PortalUserRole)
            {
            case (int)PortalUserrole.Consumer:
                portalUserPriceLists = PriceListService.QueryPriceListByPortalUserRole(httpClient, portalUser.PortalUserRole);
                portalUser.PriceLists.AddRange(portalUserPriceLists);
                break;

            case (int)PortalUserrole.Vendor:
                if (portalUser.CustomerId == Guid.Empty)
                {
                    return(Json("error:CustomerId attribute of portal user object is null!", JsonRequestBehavior.AllowGet));
                }
                portalUserPriceLists = PriceListService.QueryPriceListByCustomer(GetHttpClient(), portalUser.CustomerId);
                if (portalUserPriceLists == null || portalUserPriceLists.Count == 0)
                {
                    portalUserPriceLists = PriceListService.QueryPriceListByPortalUserRole(httpClient, (int)PortalUserrole.Consumer);
                }
                portalUser.PriceLists.AddRange(portalUserPriceLists);
                break;
            }

            var currentUser = new CurrentUser()
            {
                PortalUser = portalUser
            };

            return(Json(currentUser, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Delete(bool confirm, long itemId, string sessionId)
        {
            if (confirm)
            {
                if (PriceListService.GetPriceListByItemId(itemId) != null)
                {
                    PriceListService.DeletePriceList(itemId);
                }

                CatalogueService.DeleteCatalogue(itemId);

                List <Inventory> catalogues = CatalogueService.GetAllCatalogue();
                ViewData["catalogues"] = catalogues;
                return(RedirectToAction("All", new { sessionid = sessionId }));
            }
            return(null);
        }
 public ProductIndexDocumentBuilder(
     IndexDocumentBuilderDependencies dependencies,
     BaseProductService baseProductService,
     DisplayTemplateService displayTemplateService,
     FieldTemplateService fieldTemplateService,
     VariantService variantService,
     TemplateSettingService templateSettingService,
     ProductIndexingContext productIndexingContext,
     CategoryService categoryService,
     MostSoldDataHolder mostSoldDataHolder,
     CampaignDataHolder campaignDataHolder,
     CountryService countryService,
     PriceListService priceListService,
     PriceListItemService priceListItemService,
     ProductListService productListService,
     ProductListItemService productListItemService,
     FilterService filterService,
     FieldDefinitionService fieldDefinitionService,
     SearchPermissionService searchPermissionService,
     ContentBuilderService contentBuilderService,
     ChannelService channelService,
     LanguageService languageService)
     : base(dependencies)
 {
     _baseProductService      = baseProductService;
     _displayTemplateService  = displayTemplateService;
     _fieldTemplateService    = fieldTemplateService;
     _variantService          = variantService;
     _templateSettingService  = templateSettingService;
     _productIndexingContext  = productIndexingContext;
     _categoryService         = categoryService;
     _mostSoldDataHolder      = mostSoldDataHolder;
     _campaignDataHolder      = campaignDataHolder;
     _countryService          = countryService;
     _priceListService        = priceListService;
     _priceListItemService    = priceListItemService;
     _productListService      = productListService;
     _productListItemService  = productListItemService;
     _filterService           = filterService;
     _fieldDefinitionService  = fieldDefinitionService;
     _searchPermissionService = searchPermissionService;
     _contentBuilderService   = contentBuilderService;
     _channelService          = channelService;
     _languageService         = languageService;
 }
        public ActionResult CreatePriceList(long ItemId, PriceList priceList, string sessionId)
        {
            if (priceList.Supplier1Name == priceList.Supplier2Name || priceList.Supplier2Name == priceList.Supplier3Name || priceList.Supplier3Name == priceList.Supplier1Name)
            {
                TempData["errorMsg"] = "<script>alert('Please select three different suppliers.');</script>";
                return(RedirectToAction("CreateNext", new { itemId = ItemId, sessionid = sessionId }));
            }
            else
            {
                priceList.Item        = new Inventory();
                priceList.Item.ItemId = ItemId;
                PriceListService.CreatePriceListDetaills(priceList);

                List <Inventory> catalogues = CatalogueService.GetAllCatalogue();
                ViewData["catalogues"] = catalogues;
                return(RedirectToAction("All", new { sessionid = sessionId }));
            }
        }
Esempio n. 26
0
        public ActionResult CreateContact(Customer customer, PortalUser portalUser)
        {
            var httpClient      = GetHttpClient();
            var retailPriceList = PriceListService.QueryDefaultPriceList(httpClient);

            if (retailPriceList != null)
            {
                customer.PriceListId = retailPriceList.Id;
            }

            var customerId = CustomerService.CreateContact(httpClient, customer);

            portalUser.CustomerId = customerId;
            portalUser.Name       = customer.Firstname + " " + customer.Lastname;

            var portalUserId = PortalUserService.CreatePortalUser(httpClient, portalUser, (int)CustomerType.Contact);

            return(Json(portalUserId, JsonRequestBehavior.AllowGet));
        }
Esempio n. 27
0
 public StructureInfoService(
     FieldDefinitionService fieldDefinitionService,
     GroupService groupService,
     WebsiteService websiteService,
     ChannelService channelService,
     InventoryService inventoryService,
     PriceListService priceListService,
     FieldTypeMetadataService fieldTypeMetadataService,
     ApplicationJsonConverter applicationJsonConverter)
 {
     _fieldDefinitionService   = fieldDefinitionService;
     _groupService             = groupService;
     _websiteService           = websiteService;
     _channelService           = channelService;
     _inventoryService         = inventoryService;
     _priceListService         = priceListService;
     _fieldTypeMetadataService = fieldTypeMetadataService;
     _jsonSerializer           = JsonSerializer.Create(applicationJsonConverter.GetSerializerSettings());
 }
Esempio n. 28
0
 public DeploymentController(
     DeploymentViewModelBuilder deploymentViewModelBuilder,
     FolderService folderService,
     ChannelService channelService,
     AssortmentService assortmentService,
     IPackageService packageService,
     IPackage package,
     WebsiteService websiteService,
     StructureInfoService structureInfoService,
     SettingService settingService,
     DomainNameService domainNameService,
     SlugifyService slugifyService,
     ILogger <DeploymentController> logger,
     InventoryService inventoryService,
     PriceListService priceListService,
     CategoryService categoryService,
     BaseProductService baseProductService,
     VariantService variantService,
     MarketService marketService)
 {
     _deploymentViewModelBuilder = deploymentViewModelBuilder;
     _folderService        = folderService;
     _channelService       = channelService;
     _assortmentService    = assortmentService;
     _packageService       = packageService;
     _package              = package;
     _websiteService       = websiteService;
     _structureInfoService = structureInfoService;
     _settingService       = settingService;
     _domainNameService    = domainNameService;
     _slugifyService       = slugifyService;
     _logger             = logger;
     _inventoryService   = inventoryService;
     _priceListService   = priceListService;
     _categoryService    = categoryService;
     _baseProductService = baseProductService;
     _variantService     = variantService;
     _marketService      = marketService;
 }
        public ActionResult AdjDetails(long adjId, string sessionId)
        {
            List <AdjVoucher> adjVouchers = new List <AdjVoucher>();

            adjVouchers = AdjVoucherService.GetAdjByAdjId(adjId);
            foreach (AdjVoucher adj in adjVouchers)
            {
                Inventory c = CatalogueService.GetCatalogueById(adj.ItemId);
                adj.ItemCode    = c.ItemCode;
                adj.Description = c.Description;
                PriceList p = PriceListService.GetPriceListByItemId(adj.ItemId);
                if (p != null)
                {
                    adj.UnitPrice = p.Supplier1UnitPrice;
                }
                else
                {
                    adj.UnitPrice = 1;
                }
                double total = adj.AdjQty * adj.UnitPrice;
                adj.TotalPrice = Math.Abs(total);
            }
            string adjIdstring  = adjId.ToString("000/000/00");
            string authorisedBy = "Nil";

            if (adjVouchers[0].AuthorisedBy != 0)
            {
                authorisedBy = EmployeeService.GetEmployeeById(adjVouchers[0].AuthorisedBy).EmpName;
            }

            ViewData["adjIdstring"]  = adjIdstring;
            ViewData["adjVouchers"]  = adjVouchers;
            ViewData["authorisedBy"] = authorisedBy;
            ViewData["sessionId"]    = sessionId;
            return(View());
        }
Esempio n. 30
0
        //public JsonResult GetPriceListItemsByPriceListsByInspection(PortalUser portalUser, Guid inspectionId)
        //{

        //    var currentUserPriceLists = portalUser.PriceLists;
        //    return Json(null, JsonRequestBehavior.AllowGet);

        //}

        //public JsonResult GetPriceListItemsByPriceLists(List<PriceList> priceLists)
        //{

        //    var priceListItems = PriceListService.QueryPriceListItemsByPriceLists(GetHttpClient(), priceLists);
        //    return Json(priceListItems, JsonRequestBehavior.AllowGet);

        //}

        public JsonResult GetPriceListItemsByPortalUserRole(int portalUserRole)
        {
            var priceListItems = PriceListService.QueryPriceListByPortalUserRole(GetHttpClient(), portalUserRole);

            return(Json(priceListItems, JsonRequestBehavior.AllowGet));
        }