Ejemplo n.º 1
0
 public ActionResult Create(Tasks task)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.AddToTasks(task);
             db.SaveChanges();
             return RedirectToAction("Index");
         }
     }
     catch(Exception ex)
     {
         ModelState.AddModelError(String.Empty, ex);
     }
     return View(task);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Tasks EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTasks(Tasks tasks)
 {
     base.AddObject("Tasks", tasks);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new Tasks object.
 /// </summary>
 /// <param name="taskId">Initial value of the TaskId property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="article">Initial value of the Article property.</param>
 public static Tasks CreateTasks(global::System.Int32 taskId, global::System.String name, global::System.String article)
 {
     Tasks tasks = new Tasks();
     tasks.TaskId = taskId;
     tasks.Name = name;
     tasks.Article = article;
     return tasks;
 }
Ejemplo n.º 4
0
 //
 // GET: /Admin/Create
 public ActionResult Create()
 {
     Tasks task = new Tasks();
     return View(task);
 }