public DocTypeRoot GetDocTypes() { RestCall rest = new RestCall(conf); conf.intServer.sessionHash = rest.GetConnection(); if (conf.intServer.sessionHash.Length != 41) { MessageBox.Show($"Failed to get connection.\r\n{conf.intServer.sessionHash}"); return(null); } DocTypeRoot docTypes = rest.GetDocType(); return(docTypes); }
public DocTypeRoot GetDocType() { client = new RestClient($"{conf.intServer.uri}/documentType"); request = new RestRequest(Method.GET); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Accept", "application/json"); SetCommonHeaders(); response = client.Execute(request); if (response.StatusCode != System.Net.HttpStatusCode.OK) { return(null); } DocTypeRoot topLevel = JsonConvert.DeserializeObject <DocTypeRoot>(response.Content); return(topLevel); }
private void MainForm_Load(object sender, EventArgs e) { control.Initialize(); uxFolder_TextBox.Text = control.conf.folderPath; this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); DrawerRoot drawers = control.GetDrawers(); foreach (DrawerInfo d in drawers.drawers) { uxDrawer_ComboBox.Items.Add(d.name); } docTypeRoot = control.GetDocTypes(); foreach (DocTypeInfo d in docTypeRoot.documentTypes) { uxDocType_ComboBox.Items.Add(d.name); } }