Exemplo n.º 1
0
 partial void UpdateTask(Task instance);
Exemplo n.º 2
0
 partial void DeleteTask(Task instance);
Exemplo n.º 3
0
 partial void InsertTask(Task instance);
Exemplo n.º 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Task EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTask(Task task)
 {
     base.AddObject("Task", task);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a new Task object.
 /// </summary>
 /// <param name="idTask">Initial value of the idTask property.</param>
 public static Task CreateTask(global::System.Int32 idTask)
 {
     Task task = new Task();
     task.idTask = idTask;
     return task;
 }
Exemplo n.º 6
0
        public ActionResult Edit(Task task)
        {
            var taskToEdit = db.Tasks.Where(p => p.idTask == task.idTask).First();
            taskToEdit.taskHeader = task.taskHeader;
            taskToEdit.description = task.description;
            db.SubmitChanges();

            return RedirectToAction("Index");
        }
Exemplo n.º 7
0
        public ActionResult CreateAjax(Task task, string datePicker)
        {
            string emailFrom = ((FormsIdentity)System.Web.HttpContext.Current.User.Identity).Name.ToString();
            User signedUser = db.Users.Where(user => user.email.Trim() == emailFrom).Single();

            var activeProject = Session["project"] as Project;

            if (!ModelState.IsValid)
            {
                //return View(task);
            }
            // primary key constraint error!

            task.taskDeadline = DateTime.Parse(datePicker);
            db.Tasks.InsertOnSubmit(task);

            db.SubmitChanges();

            sifTaskUserProject newTaskEntry = new sifTaskUserProject();
            newTaskEntry.idProject = activeProject.idProject;
            newTaskEntry.idUser = signedUser.idUser;
            newTaskEntry.idTask = task.idTask;
            db.sifTaskUserProjects.InsertOnSubmit(newTaskEntry);

            db.SubmitChanges();

            return RedirectToAction("Index");
        }