public JsonResult json_saveUserSequence() { var pars = Request.Params; int task_id = Convert.ToInt32(pars["task_id"]); string[] person_ids = pars["taskUsersSequence"].Split(','); using (Themes.Models.prjEntities ctx = new Themes.Models.prjEntities()) { foreach (var item in person_ids) { Themes.Models.task_person tp = new Themes.Models.task_person() { task_id = task_id, person_id = Convert.ToInt32(item), user_task_status_id = 1 /*Not Started*/ }; ctx.task_person.AddObject(tp); ctx.SaveChanges(); } } return(Json(new { result = "done" }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Deprecated Method for adding a new object to the task_person EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotask_person(task_person task_person) { base.AddObject("task_person", task_person); }
/// <summary> /// Create a new task_person object. /// </summary> /// <param name="task_person_id">Initial value of the task_person_id property.</param> public static task_person Createtask_person(global::System.Int32 task_person_id) { task_person task_person = new task_person(); task_person.task_person_id = task_person_id; return task_person; }