// POST api/assignment public ProjectAssignment Post(AssignmentModel model) { using (BasicDao context = new BasicDao()) { ProjectAssignment newAssignment = new ProjectAssignment(); newAssignment.PersonId = model.PersonId; newAssignment.ProjectId = model.ProjectId; context.Insert(newAssignment); return newAssignment; } }
internal void CreateProject(ProjectModel projectModel) { using (BasicDao context = new BasicDao()) { Project newProject = new Project(); newProject.Name = projectModel.Name; newProject.Code = projectModel.Code; newProject.Budget = projectModel.Budget; newProject.Remarks = projectModel.Remarks; context.Insert(newProject); } }
internal void CreatePerson(PersonModel personModel) { using (BasicDao context = new BasicDao()) { Person newPerson = new Person(); newPerson.Username = personModel.Username; newPerson.Password = personModel.Password; newPerson.FirstName = personModel.FirstName; newPerson.LastName = personModel.LastName; context.Insert(newPerson); } }