public static List <WebDataset> getDataSets() { WS1.Service1Client client = new WS1.Service1Client(); try { var dSets = new List <WebDataset>(); var rawSets = client.GetDatasets(); foreach (var ds in rawSets.PythagorasValues) { dSets.Add(new WebDataset() { Id = ds.Id, ValueA = ds.ValueA.GetValueOrDefault(), ValueB = ds.ValueB.GetValueOrDefault(), ValueC = ds.ValueC.GetValueOrDefault() }); } return(dSets); } catch (Exception ex) { throw new Exception("WS1 stejler: " + ex.Message); } }
public static string sendDataSetToService(int?A, int?B, int?C) { WS1.Service1Client client = new WS1.Service1Client(); try { var succes = client.SetDataset(A, B, C); return(succes); } catch (Exception ex) { throw new Exception("WS1 stejler: " + ex.Message); } }
public static string getValuesFromWs1(int value) { WS1.Service1Client WS1 = new WS1.Service1Client(); try { var cinfo = WS1.GetCompanyByCvrNumber(value); return("Du er fra " + cinfo.Name); } catch (Exception ex) { return("WS1 stejler: " + ex.Message); } }
public static CalculatedDataset GetCalculetedDataset(int id) { WS1.Service1Client client = new WS1.Service1Client(); try { var dataset = client.CalculateDataSet(id); var calcSet = new CalculatedDataset() { Id = dataset.Id, ValueA = dataset.ValueA, ValueB = dataset.ValueB, ValueC = dataset.ValueC, Message = dataset.Message }; return(calcSet); } catch (Exception ex) { throw new Exception("WS1 stejler: " + ex.Message); } }