Ejemplo n.º 1
0
 public void FromDto(PriceGroupDTO dto)
 {
     this.AdjustmentAmount = dto.AdjustmentAmount;
     this.Bvin = dto.Bvin;
     this.LastUpdated = dto.LastUpdated;
     this.Name = dto.Name;
     this.PricingType = (PricingTypes)((int)dto.PricingType);
     this.StoreId = dto.StoreId;         
 }
Ejemplo n.º 2
0
        public PriceGroupDTO ToDto()
        {
            PriceGroupDTO dto = new PriceGroupDTO();

            dto.AdjustmentAmount = this.AdjustmentAmount;
            dto.Bvin = this.Bvin;
            dto.LastUpdated = this.LastUpdated;
            dto.Name = this.Name;
            dto.PricingType = (PricingTypesDTO)((int)this.PricingType);
            dto.StoreId = this.StoreId;            

            return dto;
        }
Ejemplo n.º 3
0
        // Price Groups and Roles
        private void ImportPriceGroups()
        {
            Header("Importing Price Groups");

            data.bvc2004Entities oldDatabase = GetOldDatabase();
            foreach (data.bvc_PricingLevel oldGroup in oldDatabase.bvc_PricingLevel)
            {
                wl("Price Group: " + oldGroup.PricingLevel.ToString());

                PriceGroupDTO pg = new PriceGroupDTO();
                pg.AdjustmentAmount = (decimal)oldGroup.Amount;
                pg.Bvin = "BVC2004" + oldGroup.PricingLevel.ToString();
                pg.Name = "BVC2004" + oldGroup.PricingLevel.ToString();
                switch (oldGroup.PricingType)
                {

                    case 3:
                        pg.PricingType = PricingTypesDTO.AmountAboveCost;
                        break;
                    case 1:
                        pg.PricingType = PricingTypesDTO.AmountOffListPrice;
                        break;
                    case 5:
                        pg.PricingType = PricingTypesDTO.AmountOffSitePrice;
                        break;
                    case 2:
                        pg.PricingType = PricingTypesDTO.PercentageAboveCost;
                        break;
                    case 0:
                        pg.PricingType = PricingTypesDTO.PercentageOffListPrice;
                        break;
                    case 4:
                        pg.PricingType = PricingTypesDTO.PercentageOffSitePrice;
                        break;
                }

                Api bv6proxy = GetBV6Proxy();
                var res = bv6proxy.PriceGroupsCreate(pg);
                if (res != null)
                {
                    if (res.Errors.Count() > 0)
                    {
                        DumpErrors(res.Errors);
                        wl("FAILED");
                    }
                    else
                    {
                        if (res.Content == null)
                        {
                            wl("FAILED");
                        }
                        else
                        {
                            wl(res.Content.Name == string.Empty ? "FAILED" : "SUCCESS");
                        }
                    }
                }
            }

        }
Ejemplo n.º 4
0
 public ApiResponse<PriceGroupDTO> PriceGroupsUpdate(PriceGroupDTO item)
 {
     ApiResponse<PriceGroupDTO> result = new ApiResponse<PriceGroupDTO>();
     result = RestHelper.PostRequest<ApiResponse<PriceGroupDTO>>(this.fullApiUri + "pricegroups/" + Enc(item.Bvin) + "?key=" + Enc(key), MerchantTribe.Web.Json.ObjectToJson(item));
     return result;
 }