public ActionResult Create(Assignment Assignment) { if (ModelState.IsValid) { db.Assignments.AddObject(Assignment); db.SaveChanges(); return RedirectToAction("Index"); } return View(Assignment); }
public ActionResult Edit(Assignment Assignment) { if (ModelState.IsValid) { db.Assignments.Attach(Assignment); db.ObjectStateManager.ChangeObjectState(Assignment, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(Assignment); }
/// <summary> /// Create a new Assignment object. /// </summary> /// <param name="assignmentID">Initial value of the AssignmentID property.</param> /// <param name="assignment1">Initial value of the Assignment1 property.</param> /// <param name="employeeID">Initial value of the EmployeeID property.</param> /// <param name="projectID">Initial value of the ProjectID property.</param> /// <param name="startDate">Initial value of the StartDate property.</param> /// <param name="active">Initial value of the Active property.</param> /// <param name="billableExp">Initial value of the BillableExp property.</param> /// <param name="createdBy">Initial value of the CreatedBy property.</param> public static Assignment CreateAssignment(global::System.Int32 assignmentID, global::System.String assignment1, global::System.Int32 employeeID, global::System.Int32 projectID, global::System.DateTime startDate, global::System.Boolean active, global::System.Boolean billableExp, global::System.String createdBy) { Assignment assignment = new Assignment(); assignment.AssignmentID = assignmentID; assignment.Assignment1 = assignment1; assignment.EmployeeID = employeeID; assignment.ProjectID = projectID; assignment.StartDate = startDate; assignment.Active = active; assignment.BillableExp = billableExp; assignment.CreatedBy = createdBy; return assignment; }
/// <summary> /// Deprecated Method for adding a new object to the Assignments EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToAssignments(Assignment assignment) { base.AddObject("Assignments", assignment); }