public void Delete(TODOViewModel input) { List<string> temp = (List<string>)HttpContext.Current.Session["TODOList"]; temp.Remove(input.Task); HttpContext.Current.Session["TODOList"] = temp; HttpContext.Current.Response.Redirect("../../"); }
public void Add(TODOViewModel model) { List<string> temp = (List<string>)HttpContext.Current.Session["TODOList"]; string newTodo = model.Task; if (temp != null) { if (temp.Contains(newTodo)) newTodo = model.Task; else temp.Add(model.Task); HttpContext.Current.Session.Add("TODOList", temp); } HttpContext.Current.Response.Redirect("../../"); }
public TODOViewModel Get(TODOViewModel input) { return input; }