public void Add(ObjProjectType obj) { var projectType = Map(obj); _projectTypeRepository.Insert(projectType); _projectTypeRepository.SaveChanges(); }
private ProjectType Map(ObjProjectType obj) { return(new ProjectType() { Id = obj.Id, Name = obj.Name, Description = obj.Description, Posititon = obj.Position, }); }
public void Edit(ObjProjectType obj) { var projecttType = _projectTypeRepository.Get(obj.Id); projecttType.Name = obj.Name; projecttType.Description = obj.Description; projecttType.Posititon = obj.Position; _projectTypeRepository.Update(projecttType); _projectTypeRepository.SaveChanges(); }
public IActionResult EditProject(ObjProjectType obj) { if (obj.Id == -1) { obj.Id = 0; _projectService.Add(obj); } else { _projectService.Edit(obj); } return(RedirectToAction("ProjectTypes")); }