public string mySetData(string token, string strxml, bool inittb = false) { string ro = ""; using (myTaskBuilderServices.TbServicesSoapClient tbs = new myTaskBuilderServices.TbServicesSoapClient()) { tbs.Endpoint.Address = new System.ServiceModel.EndpointAddress(EndPointString); if (inittb) { var initres = this.CreateTBInstance(tbs, token, DateTime.Now); if (!this.tbCreated) { return("creazione tbloader fallita"); } } if (tbs.SetData(token, strxml, DateTime.Today, 1, true, out ro)) { okSetData = true; return(ro); } else { okSetData = false; } } return(ro); }
public esitoInitTbLoader CreateTBInstance(myTaskBuilderServices.TbServicesSoapClient tbs, string token, DateTime data) { int res = 0; var etb = new esitoInitTbLoader(); try { string easyLookToken; res = tbs.CreateTB(token, data, false, out easyLookToken); tbCreated = res > 0; } catch (Exception exc) { etb.msg = exc.ToString(); } switch (res) { case 0: etb.msg = (Strings.Error_3); break; case -1: etb.msg = (Strings.Error_1); break; case -2: etb.msg = (Strings.Error_2); break; case -3: etb.msg = (Strings.Error_3); break; case -4: etb.msg = (Strings.Error_4); break; case -5: etb.msg = (Strings.Error_5); break; default: etb.msg = (string.Format(Strings.NoError, res)); break; } return(etb); }