public CRSchemeLeadForm() { InitializeComponent(); XLAPI.Result result = XLAPI.GetDataFromAPI("http://localhost:49485/Scheme/GetList"); if (result.WasSuccessful) { SchemeDdl.DataSource = (JArray)result.Data; SchemeDdl.ValueMember = "Id"; SchemeDdl.DisplayMember = "Name"; SchemeDdl.SelectedIndex = 0; } else { MessageBox.Show(result.Message); } }
private void CRClaimsExperienceBtn_Click(object sender, RibbonControlEventArgs e) { CRSchemeLeadForm form = new CRSchemeLeadForm(); form.ShowDialog(); if (form.SchemeId != null) { //get the data from the API string url = "http://localhost:49485/ClaimsExperience/Get?schemeId=" + form.SchemeId; if (form.LeadId != null) { url += "&leadId=" + form.LeadId; } XLAPI.Result result = XLAPI.GetDataFromAPI(url); JObject package = (JObject)result.Data; XLSheet.HandleClaimsExperience(package); } }
private void SchemeDdl_SelectedIndexChanged(object sender, EventArgs e) { dynamic selectedScheme = new JObject(); int id = HandleSelectedValue(SchemeDdl.SelectedValue); if (id != 0) { XLAPI.Result result = XLAPI.GetDataFromAPI("http://localhost:49485/Firm/GetLeadForScheme?schemeId=" + id); if (result.WasSuccessful) { leadDdl.DataSource = (JArray)result.Data; leadDdl.ValueMember = "Id"; leadDdl.DisplayMember = "FirmName"; leadDdl.SelectedIndex = -1; } else { MessageBox.Show(result.Message); } } }