public GeneralResponse EditGraphicalProperties(Guid LevelID, int X, int Y, int Width, int Height, bool EnableDragging) { GeneralResponse response = new GeneralResponse(); Level level = _levelRepository.FindBy(LevelID); if (level != null) { try { GraphicalProperties graphicalProperties = new GraphicalProperties(); graphicalProperties.X = X; graphicalProperties.Y = Y; graphicalProperties.Width = Width; graphicalProperties.Height = Height; graphicalProperties.EnableDragging = EnableDragging; level.GraphicalObjectProperties = graphicalProperties; _levelRepository.Save(level); _uow.Commit(); ////response.success = true; } catch (Exception ex) { response.ErrorMessages.Add(ex.Message); } } else { response.ErrorMessages.Add("هیچ موردی جهت ویرایش وجود ندارد."); } return(response); }
public static GraphicalPropertiesView ConvertToGraphicalPropertiesView(this GraphicalProperties graphicalProperties) { return(Mapper.Map <GraphicalProperties, GraphicalPropertiesView>(graphicalProperties)); }