protected async Task DataModelXmlChanged(string script) { DataModelManager.SetDataModelXml(script); if (Refresh.AutoRefresh && !string.IsNullOrEmpty(script)) { await RefreshDiagram(); } }
/// <summary> /// Get Responsible Id /// </summary> /// <returns></returns> public static string GetResponsibleId() { IDatabaseHandler iDataAccess = new DataAccess(Configurations.Config.ConnectionString); IDBManager iDbManager = new DbManager(iDataAccess); IManager iManager = new Manager(iDbManager); IDataModelManager iDataModelManager = new DataModelManager(); var responsilbe = GetResponsibleFullDetails(iManager, iDataModelManager); return(responsilbe.Rows[0]["Id"].ToString()); }
private async Task RefreshDiagram() { try { var dataTypes = DataModelManager.GetDataTypes(); MermaidScript = DataModelConverter.ConvertToDiagramCode(dataTypes); await JSRunTime.InvokeVoidAsync("mermaidLib.renderMermaidDiagram", "mermaid-canvas", MermaidScript); } catch (JSException) { Console.WriteLine("Could not render mermaid diagram"); } catch (DataModelConversionException) { Console.WriteLine("Error when converting the model"); } }