Exemplo n.º 1
0
 public void Save()
 {
     Task task = new Task();
     Guid id = Guid.NewGuid();
     task.TaskId = id;
     task.Category = this.Category;
     task.Description = this.Description;
     task.TaskTitle = this.TaskTitle;
     Task.Save(task);
 }
Exemplo n.º 2
0
 public ActionResult Delete(Guid id, Task task)
 {
     try
     {
         Task.Delete(id);
     }
     catch
     {
     }
     return RedirectToAction("Index");
 }
Exemplo n.º 3
0
 public ActionResult Edit(Guid id, Task task)
 {
     try
     {
         Task.Save(task);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Exemplo n.º 4
0
 public static void Save(Task task)
 {
     StringBuilder content = new StringBuilder();
     content.AppendLine(task.TaskId.ToString());
     content.AppendLine("---");
     content.AppendLine(task.TaskTitle);
     content.AppendLine("---");
     content.AppendLine(task.Category);
     content.AppendLine("---");
     content.AppendLine(task.Description);
     System.IO.File.WriteAllText(GetFileName(task.TaskId), content.ToString());
 }