public void Post(string id) { Card cards = JsonConvert.DeserializeObject <Card>(id); var board = _cache.Get <Board>("currentState"); BoardManager.SetCardToNewLane(board, cards.ID, cards.CardProgress); _cache.Set("currentState", board, TimeSpan.FromDays(1)); var serlizedList = JsonConvert.SerializeObject(board.AllCards); string allText = System.IO.File.ReadAllText("configuration.json"); EncriptionKey key = JsonConvert.DeserializeObject <EncriptionKey>(allText); var filekey = Encription.GetEncriptedFile(key); filekey.Description = serlizedList; Encription.EncriptedFile(filekey); Encription.SaveDataSet(filekey); }
public Board Get() { string allText = System.IO.File.ReadAllText("configuration.json"); EncriptionKey key = JsonConvert.DeserializeObject <EncriptionKey>(allText); var filekey = Encription.GetEncriptedFile(key); Encription.DeEncriptedFile(filekey); List <Card> cards = JsonConvert.DeserializeObject <List <Card> >(filekey.Description); if (cards == null) { cards = new List <Card>(); } Board board = BoardManager.SetUpBoard(cards); _cache.Set("currentState", board, TimeSpan.FromDays(1)); //return View(personlist); return(board); }
public void Put(string id) { // Card cards = value; Card cards = JsonConvert.DeserializeObject <Card>(id); cards.CardProgress = LaneType.Backlog; cards.Date = DateTime.Now.ToShortDateString(); var board = _cache.Get <Board>("currentState"); cards.ID = board.LastID + 1; board.LastID = cards.ID; BoardManager.AddCardToBoard(board, cards); _cache.Set("currentState", board, TimeSpan.FromDays(1)); var serlizedList = JsonConvert.SerializeObject(board.AllCards); string allText = System.IO.File.ReadAllText("configuration.json"); EncriptionKey key = JsonConvert.DeserializeObject <EncriptionKey>(allText); var filekey = Encription.GetEncriptedFile(key); filekey.Description = serlizedList; Encription.EncriptedFile(filekey); Encription.SaveDataSet(filekey); }