public TalentTrackLevel(string Type, int Level, string DataActions, string DataGifts) { this.Type = Type; this.Level = Level; foreach (var Str in DataActions.Split('|')) { if (Actions == null) { Actions = new List <string>(); } Actions.Add(Str); } foreach (var Str in DataGifts.Split('|')) { if (Gifts == null) { Gifts = new List <string>(); } Gifts.Add(Str); } _subLevels = new Dictionary <int, TalentTrackSubLevel>(); Init(); }
//Function 2)AddItem public void addItem(Item item) { Gifts.Add(new WishlistItem(item.ItemId, this.WishlistId, item, this)); //item.List = this.WishlistId; Items.Add(item); //Gifts.Add(item); }
public GiftDbContext(DbContextOptions <GiftDbContext> options) : base(options) { Database.EnsureCreated(); if (Gifts.CountAsync().Result == 0) { var item = new Gift() { Title = "LG fjernsyn", Description = "55 tommer" }; Gifts.Add(item); SaveChanges(); item = new Gift() { Title = "Samsung Galaxy", Description = "Smartphone" }; Gifts.Add(item); SaveChanges(); } }
public void ParseGifts() { if (Strgifts == "") { return; } foreach (var datas in Strgifts.Split('+')) { var giftDatas = datas.Split('~'); var gift = new GiftModel(); gift.ID = int.Parse(giftDatas[0]); gift.Title = giftDatas[1]; gift.Message = giftDatas[2]; gift.ItemID = int.Parse(giftDatas[3]); gift.Image = giftDatas[4]; Gifts.Add(gift); } }
public void AddGift() { Gifts.Add(new GiftModel()); }