﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MatreshkaExpress.Web.Models
{
    public class CartPositionsViewModel
    {
        public CartPositionsViewModel()
        {
            CartPositions = new List<CartPosition>();
        }

        public CartPosition cartPosition { get; set; }
        public List<CartPosition> CartPositions { get; }

        [HiddenInput(DisplayValue = false)]
        public Decimal TotalPrice { get; set; }
}

    public class CartPosition
    {
        [HiddenInput(DisplayValue = false)]
        public Guid ProductId { get; set; }

        [Required]
        [Range(0, int.MaxValue, ErrorMessage = "Введите неотрицательное число")]
        public int Count { get; set; }

        [HiddenInput(DisplayValue = false)]
        public string ProductName { get; set; }

        [HiddenInput(DisplayValue = false)]
        public decimal Price { get; set; }

        public Guid? MainImageId { get; set; }

    }

}