Пример #1
0
 private void CustomPropertyForm_Load(object sender, EventArgs e)
 {
     this.Icon   = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
     customProps = controller.GetCustProps(docTypeID);
     foreach (CustPropInfo c in customProps.properties)
     {
         uxCustomProperty_DataGrid.Rows.Add(c.name);
     }
 }
Пример #2
0
        public CustPropRoot GetCustProps(string docTypeID)
        {
            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);
            }
            CustPropRoot temp = rest.GetCustProps(docTypeID);

            return(temp);
        }
Пример #3
0
        public CustPropRoot GetCustProps(string docTypeID)
        {
            client  = new RestClient($"{conf.intServer.uri}/documentType/{docTypeID}");
            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);
            }
            CustPropRoot topLevel = JsonConvert.DeserializeObject <CustPropRoot>(response.Content);

            return(topLevel);
        }