Exemple #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);
 }
 public ActionResult Delete(Guid id, Task task)
 {
     try
     {
         Task.Delete(id);
     }
     catch
     {
     }
     return RedirectToAction("Index");
 }
 public ActionResult Edit(Guid id, Task task)
 {
     try
     {
         Task.Save(task);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Exemple #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());
 }