public DiscountData(DeserializeBranchItem branchItem) : this()
        {
            _documentId = branchItem.Id;
            _partnerId = branchItem.PartnerId;

            foreach (var item in branchItem.Name)
                SetName(item.Lan, item.LocText);

            foreach (var item in branchItem.Description)
                SetDescription(item.Lan, item.LocText);
            
            if (branchItem.Discounts.Count > 0 && branchItem.Discounts[0].Name.Count > 0)
                _discountPercent = branchItem.Discounts[0].Name[0].LocText;
           
            foreach (var item in branchItem.Categories)
            {
                var categorie = new CategorieData();
                int typeCode = 0;
                int.TryParse (item.Type, out typeCode);
                categorie.TypeCode = typeCode;
                foreach (var itemName in item.Name)
                    categorie.SetName(itemName.Lan, itemName.LocText);
                _categorieList.Add(categorie);
            }

            _urlAddress = branchItem.Url;

            _icon = branchItem.Icon;
        }
Example #2
0
        public MapPinData(DeserializeBranchItem deserializeBranch) : this()
        {
            NumberFormatInfo format = new NumberFormatInfo();

            format.NumberGroupSeparator   = ",";
            format.NumberDecimalSeparator = ".";

            foreach (var item in deserializeBranch.Categories)
            {
                var categorie = new CategorieData();
                int typeCode  = 0;
                int.TryParse(item.Type, out typeCode);
                categorie.TypeCode = typeCode;
                foreach (var itemName in item.Name)
                {
                    categorie.SetName(itemName.Lan, itemName.LocText);
                }
                _categorieList.Add(categorie);
            }

            if (_categorieList.Count > 0)
            {
                _primaryCategory = _categorieList[0];
            }
            else
            {
                _primaryCategory = new CategorieData {
                    TypeCode = -1
                }
            };

            try
            {
                _discount = deserializeBranch.Discounts[0].Name[0].LocText;
            }
            catch
            {
                _discount = "0";
            }

            _latitude  = Double.Parse(deserializeBranch.Location.Coordinates.Latitude, format);
            _longitude = Double.Parse(deserializeBranch.Location.Coordinates.Longitude, format);
            _id        = deserializeBranch.Id;
            _partnerId = deserializeBranch.PartnerId;

            foreach (var item in deserializeBranch.Name)
            {
                SetName(item.Lan, item.LocText);
            }
        }
        public MapPinData(DeserializeBranchItem deserializeBranch) : this()
        {
            NumberFormatInfo format = new NumberFormatInfo();
            format.NumberGroupSeparator = ",";
            format.NumberDecimalSeparator = ".";

            foreach (var item in deserializeBranch.Categories)
            {
                var categorie = new CategorieData();
                int typeCode = 0;
                int.TryParse(item.Type, out typeCode);
                categorie.TypeCode = typeCode;
                foreach (var itemName in item.Name)
                    categorie.SetName(itemName.Lan, itemName.LocText);
                _categorieList.Add(categorie);
            }

            if (_categorieList.Count > 0)
                _primaryCategory = _categorieList[0];
            else
                _primaryCategory = new CategorieData { TypeCode = -1 };

            try
            {
                _discount = deserializeBranch.Discounts[0].Name[0].LocText;
            }
            catch
            {
                _discount = "0";
            }

            _latitude = Double.Parse(deserializeBranch.Location.Coordinates.Latitude, format);
            _longitude = Double.Parse(deserializeBranch.Location.Coordinates.Longitude, format);
            _id = deserializeBranch.Id;
            _partnerId = deserializeBranch.PartnerId;

            foreach (var item in deserializeBranch.Name)
                SetName(item.Lan, item.LocText);
        }
Example #4
0
        public DiscountData(DeserializeBranchItem branchItem) : this()
        {
            _documentId = branchItem.Id;
            _partnerId  = branchItem.PartnerId;

            foreach (var item in branchItem.Name)
            {
                SetName(item.Lan, item.LocText);
            }

            foreach (var item in branchItem.Description)
            {
                SetDescription(item.Lan, item.LocText);
            }

            if (branchItem.Discounts.Count > 0 && branchItem.Discounts[0].Name.Count > 0)
            {
                _discountPercent = branchItem.Discounts[0].Name[0].LocText;
            }

            foreach (var item in branchItem.Categories)
            {
                var categorie = new CategorieData();
                int typeCode  = 0;
                int.TryParse(item.Type, out typeCode);
                categorie.TypeCode = typeCode;
                foreach (var itemName in item.Name)
                {
                    categorie.SetName(itemName.Lan, itemName.LocText);
                }
                _categorieList.Add(categorie);
            }

            _urlAddress = branchItem.Url;

            _icon = branchItem.Icon;
        }