예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HairStyleViewModel"/> class.
        /// </summary>
        /// <param name="hairStyle">
        /// The hair style.
        /// </param>
        public HairStyleViewModel(HairStyle hairStyle, IEnumerable<string> images)
        {
            _hairStyle = hairStyle;

            AllImages = images.Select(image => new SelectListItem
                {
                    Text = Path.GetFileName(image),
                    Value = Path.GetFileName(image)
                }).ToArray();
        }
예제 #2
0
        public HairStyle ToHairStyle()
        {
            var hairStyle = new HairStyle();

            hairStyle.id = Id;

            hairStyle.name = Name;

            return hairStyle;
        }
예제 #3
0
        public ActionResult Create()
        {
            var hairStyle = new HairStyle();

            var allImages = _imageRepository.GetAllImages(Server);

            return View(new HairStyleViewModel(hairStyle, allImages)
                {
                    BigImages = new List<string>(),
                    SmallImage = allImages.First()
                });
        }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HairStyleViewModel"/> class.
 /// </summary>
 /// <param name="hairStyle">
 /// The hair style.
 /// </param>
 public HairStyleViewModel(HairStyle hairStyle)
     : this(hairStyle, new string[0])
 {
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HairStyleViewModel"/> class.
 /// </summary>
 public HairStyleViewModel()
 {
     _hairStyle = new HairStyle();
 }
예제 #6
0
        public HairStyleProxy(HairStyle hairStyle)
        {
            Id = hairStyle.id;

            Name = hairStyle.name;
        }
 /// <summary>
 /// Create a new HairStyle object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="name">Initial value of the name property.</param>
 public static HairStyle CreateHairStyle(global::System.Int32 id, global::System.String name)
 {
     HairStyle hairStyle = new HairStyle();
     hairStyle.id = id;
     hairStyle.name = name;
     return hairStyle;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the HairStyles EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToHairStyles(HairStyle hairStyle)
 {
     base.AddObject("HairStyles", hairStyle);
 }