public Dictionary <int, CurrentUser> RetrieveUsers() { var proxy = new PartyManagementSoapClient(); var data = proxy.RetrieveTableData(new PAuthenticationHeader(), "us_id, us_first_name, us_last_name, us_iso_id", "Users", ""); return(data.ToDict(4, (o, i) => { return Convert.ToInt32(o[i]); }, (o, i) => { return new CurrentUser(Convert.ToInt32(o[i]), o[i + 1] + " " + o[i + 2], Convert.ToInt32(o[i + 3])); })); }
public Retailer[] RetrieveRetailerList(PAuthenticationHeader header, int countryId, int headOfficeId) { var client = new PartyManagementSoapClient(); var results = client.RetrieveRetailerList(header, countryId, headOfficeId); return(results); }
public FormLogin() { InitializeComponent(); m_Version = Assembly.GetEntryAssembly().GetName().Version; lblVersion.Text = "Version: ".concat(m_Version.ToString()); #if DEBUG //lblVersion.Text = lblVersion.Text.concat(" <DEBUG>"); #endif var header = new PartyManagementRef.AuthenticationHeader(); var service = new PartyManagementSoapClient(); var countries = new Func <PartyManagementSoapClient, CountryDetail[]>((s) => s.GetPtfCountryList(header)).ReTry(service); if (countries == null) { throw new ApplicationException("Can not connect to the server."); } foreach (var country in countries.OrderBy(c => c.Nationality)) { cbCountryID.Items.Add(country); } int countryId = Config.CountryID; cbCountryID.SetSelected <CountryDetail>((c) => c.Number == countryId); }
public static Func <List <CountryDetail> > CreateCountryDropDownLoadFunction() { var funct = new Func <List <CountryDetail> >(() => { var client = new PartyManagementSoapClient(); var results = client.GetPtfCountryList(new AuthenticationHeader()); var results2 = results.ToList(); results2.Sort((c1, c2) => string.Compare(c1.Country, c2.Country)); return(results2); }); return(funct); }