Exemple #1
0
 public Pattern Get(Guid id)
 {
     return(_repository.Get(id));
 }
        public void Given_NumberId_Expected_NumberEntity(int id, Number expectedNumber)
        {
            var number = _patternRepository.Get(id);

            number.Should().BeEquivalentTo(expectedNumber);
        }
Exemple #3
0
        private ArrayList GetFormatedValues(FormCollection values)
        {
            ArrayList   lst       = new ArrayList();
            UserGarment ug        = new UserGarment();
            int         controlId = int.Parse(((NameValueCollection)(values)).AllKeys[0].Substring(
                                                  ((NameValueCollection)(values)).AllKeys[0].Length - 1, 1));

            foreach (string tag in values)
            {
                if (tag == "x" || tag == "y")
                {
                    continue;
                }

                if (int.Parse(tag.Substring(tag.Length - 1)) != controlId)
                {
                    lst.Add(ug);
                    ug = new UserGarment();
                    controlId++;
                }

                string propName  = tag.Substring(0, tag.Length - 1);
                string propValue = values[tag.ToString()];

                if (propValue == "")
                {
                    continue;
                }

                switch (propName)
                {
                case "Title":
                    Silouhette s = silouhetteRepository.Get(int.Parse(propValue));
                    ug.Title           = s.Category.Description + " " + s.Description;
                    ug.Tags.Silouhette = s;
                    break;

                case "Fabric":
                    ug.Tags.Fabric = fabricRepository.Get(int.Parse(propValue));
                    break;

                case "PrimaryColor":
                    ug.Tags.Colors.Add(colorRepository.Get(int.Parse(propValue)));
                    break;

                case "Pattern":
                    ug.Tags.Pattern = patternRepository.Get(int.Parse(propValue));
                    break;

                case "Season":
                    ug.Tags.Seasons.Add((Season)int.Parse(propValue));
                    break;

                case "EventType":
                    ug.Tags.EventTypes.Add(eventTypeRepository.Get(int.Parse(propValue)));
                    break;

                case "PrivacyStatus":
                    ug.Visibility = (Convert.ToBoolean(propValue)) ? GarmentVisibility.Private : GarmentVisibility.Public;
                    break;
                }
            }

            lst.Add(ug);
            return(lst);
        }
Exemple #4
0
        private ArrayList GetFormatedValues(FormCollection values)
        {
            ArrayList   lst = new ArrayList();
            UserGarment ug  = new UserGarment();

            if (values.Count == 0)
            {
                return(lst);
            }

            int controlId = int.Parse(((NameValueCollection)(values)).AllKeys[0].Substring(
                                          ((NameValueCollection)(values)).AllKeys[0].Length - 1, 1));

            string titleSilouhette = string.Empty;
            string titleCategory   = string.Empty;
            string titleColor      = string.Empty;
            string titlePattern    = string.Empty;
            string titleFabric     = string.Empty;

            foreach (string tag in values)
            {
                if (tag == "x" || tag == "y")
                {
                    continue;
                }

                if (int.Parse(tag.Substring(tag.Length - 1)) != controlId)
                {
                    ug.Title = string.Format("{0} {1} {2} {3} {4}", titleSilouhette, titleColor, titlePattern, titleCategory, titleFabric);
                    lst.Add(ug);
                    ug = new UserGarment();
                    titleSilouhette = string.Empty;
                    titleCategory   = string.Empty;
                    titleColor      = string.Empty;
                    titlePattern    = string.Empty;
                    titleFabric     = string.Empty;
                    controlId++;
                }

                string propName  = tag.Substring(0, tag.Length - 1);
                string propValue = values[tag.ToString()];

                if (propValue == "")
                {
                    continue;
                }

                switch (propName)
                {
                case "Title":
                    Silouhette s = silouhetteRepository.Get(int.Parse(propValue));
                    titleSilouhette    = s.Description;
                    titleCategory      = s.Category.Description;
                    ug.Tags.Silouhette = s;
                    break;

                case "Fabric":
                    Fabric f = fabricRepository.Get(int.Parse(propValue));
                    ug.Tags.Fabric = f;
                    titleFabric    = f.Description;
                    break;

                case "PrimaryColor":
                    FashionAde.Core.Clothing.Color col = colorRepository.Get(int.Parse(propValue));
                    ug.Tags.Colors.Add(col);
                    ug.Tags.DefaultColor = col;
                    titleColor           = col.Description;
                    break;

                case "Pattern":
                    Pattern p = patternRepository.Get(int.Parse(propValue));
                    ug.Tags.Pattern = p;
                    titlePattern    = p.Description;
                    break;

                case "Season":
                    ug.Tags.Seasons.Add((Season)int.Parse(propValue));
                    break;

                case "EventType":
                    ug.Tags.EventTypes.Add(eventTypeRepository.Get(int.Parse(propValue)));
                    break;

                case "PrivacyStatus":
                    ug.SetVisibility((Convert.ToBoolean(propValue)) ? GarmentVisibility.Private : GarmentVisibility.Public);
                    break;
                }
            }
            ug.Title = string.Format("{0} {1} {2} {3} {4}", titleSilouhette, titleColor, titlePattern, titleCategory, titleFabric);

            if (ug.Title != "    ")
            {
                lst.Add(ug);
            }
            return(lst);
        }