public PartialViewResult SaveMapElement(GameDesignMappingElements mapElement, Guid idAssociationElement, Guid idDesignMap) { try { var associatedElement = DbFactory.AssociationConfElementRepository.FirstById(idAssociationElement); var designMap = DbFactory.DesignMappingRepository.FirstById(idDesignMap); mapElement.AssociateElement = associatedElement; mapElement.DesignMapping = designMap; mapElement.GameGenreElement = associatedElement.GameGenreElement; mapElement.IsManual = true; mapElement = DbFactory.GameDesignMappingElementsRepository.Save(mapElement); designMap = DbFactory.DesignMappingRepository.FirstById(idDesignMap); return(PartialView("_TblMappingElements", new List <DesignMapping>() { designMap })); } catch (Exception ex) { return(PartialView("Error", new HandleErrorInfo(ex, "Project", "SaveMapElement"))); } }
public PartialViewResult AddMappingElement(Guid id, Guid idDesignMap) { try { var associatedElement = DbFactory.AssociationConfElementRepository.FirstById(id); var designMap = DbFactory.DesignMappingRepository.FirstById(idDesignMap); var mapElement = new GameDesignMappingElements() { AssociateElement = associatedElement, DesignMapping = designMap, GameGenreElement = associatedElement.GameGenreElement }; return(PartialView("_AddMappingElement", mapElement)); } catch (Exception ex) { return(PartialView("Error", new HandleErrorInfo(ex, "Project", "AddMappingElement"))); } }