Beispiel #1
0
        public EditTapViewModel(IEnumerable <KegModel> kegs, string kegId)
        {
            if (null == kegs)
            {
                throw new ArgumentNullException("kegs");
            }

            Kegs = kegs.Select(k => new SelectListItem()
            {
                Text = k.BeerName, Value = k.Id, Selected = (k.Id == kegId)
            }).ToList();
            Kegs.Insert(0, new SelectListItem()
            {
                Text = Resources.Admin_Tap_Edit_Dropdownlist, Value = ""
            });
        }
Beispiel #2
0
        public CreateTapViewModel(IEnumerable <KegModel> kegs)
        {
            if (null == kegs)
            {
                throw new ArgumentNullException("kegs");
            }

            Kegs = kegs.Select(k => new SelectListItem()
            {
                Text = k.BeerName, Value = k.Id
            }).ToList();
            Kegs.Insert(0, new SelectListItem()
            {
                Text = Resources.Admin_Tap_Create_Dropdownlist, Value = "", Selected = true
            });
        }