private void detach_sifTaskUserProjects(sifTaskUserProject entity) { this.SendPropertyChanging(); entity.User = null; }
partial void DeletesifTaskUserProject(sifTaskUserProject instance);
partial void UpdatesifTaskUserProject(sifTaskUserProject instance);
partial void InsertsifTaskUserProject(sifTaskUserProject instance);
private void attach_sifTaskUserProjects(sifTaskUserProject entity) { this.SendPropertyChanging(); entity.Task = this; }
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"); }