public FormLogin() { InitializeComponent(); m_Version = StateSaver.Default.Get <AssemblyName>(Strings.VERSION).Version; lblVersion.Text = "Version: ".concat(m_Version.ToString()); #if DEBUG //lblVersion.Text = lblVersion.Text.concat(" <DEBUG>"); #endif var service = new mng.PartyManagement(); var countries = new Func <mng.PartyManagement, CountryDetail[]>((s) => s.GetPtfCountryList()).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 = Convert.ToInt32(ConfigurationManager.AppSettings["CountryId"]); cbCountryID.SetSelected <CountryDetail>((c) => c.Number == countryId); }
protected override void OnLoad(EventArgs e) { var service = new mng.PartyManagement(); var countries = new Func <mng.PartyManagement, CountryDetail[]>((s) => s.GetPtfCountryList()).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); } txtBarcode.Text = StateSaver.Default.Get <string>("AddVoucherItemForm.txtBarcode", null); txtSiteCode2.Text = StateSaver.Default.Get <string>("AddVoucherItemForm.txtSiteCode2", null); int countryId = StateSaver.Default.Get <int>("AddVoucherItemForm.cbCountryId", MainForm.CurrentCountryId); cbCountryId.SetSelected <CountryDetail>((c) => c.Number == countryId); txtRetailerId.Text = StateSaver.Default.Get <string>("AddVoucherItemForm.txtRetailerId", null); txtVoucherId.Text = StateSaver.Default.Get <string>("AddVoucherItemForm.txtVoucherId", null); txtSiteCode.Text = StateSaver.Default.Get <string>("AddVoucherItemForm.txtSiteCode", null); base.OnLoad(e); }
private void cbCountryID_SelectedIndexChanged(object sender, EventArgs e) { int countryId = cbCountryID.SelectedItem.cast <CountryDetail>().Number; var service = new mng.PartyManagement(); service.RetrieveHeadOfficeListCompleted += new RetrieveHeadOfficeListCompletedEventHandler(OnRetrieveHeadOfficeListCompleted); service.RetrieveHeadOfficeListAsync(countryId); }
protected override void OnLoad(EventArgs e) { var service = new mng.PartyManagement(); service.GetPtfCountryListCompleted += new GetPtfCountryListCompletedEventHandler(OnGetPtfCountryListCompleted); service.GetPtfCountryListAsync(); base.OnLoad(e); }
private void cbRetailer_SelectedIndexChanged(object sender, EventArgs e) { int countryId = cbCountryID.SelectedItem.cast <CountryDetail>().Number; int retailerId = cbRetailer.SelectedItem.cast <Retailer>().Id; var service = new mng.PartyManagement(); service.GetPrinterInfoCompleted += new GetPrinterInfoCompletedEventHandler(OnGetPrinterInfoCompleted); service.GetPrinterInfoAsync(countryId, retailerId); }
private void cbFormat_SelectedIndexChanged(object sender, EventArgs e) { if (this.ShowQuestion("Save?", MessageBoxButtons.YesNo) == DialogResult.Yes) { int countryId = cbCountryID.SelectedItem.cast <CountryDetail>().Number; int retailerId = cbRetailer.SelectedItem.cast <Retailer>().Id; //TODO: int printerId = cbFormat.SelectedItem.cast <PrinterDetails>().IsoID; var service = new mng.PartyManagement(); service.SetPrinterInfoCompleted += new SetPrinterInfoCompletedEventHandler(OnSetPrinterInfoCompleted); service.SetPrinterInfoAsync(countryId, retailerId, printerId); } }
private void ReloadLayouts() { cbCountryID.SelectedValueChanged -= new EventHandler(cbCountryID_SelectedValueChanged); cbCountryID.Items.Clear(); var service = new mng.PartyManagement(); var countries = service.GetPtfCountryList().OrderBy(c => c.Nationality); foreach (var country in countries) { cbCountryID.Items.Add(country); } cbCountryID.SelectedValueChanged += new EventHandler(cbCountryID_SelectedValueChanged); }
private void InitializeSearch() { var service = new mng.PartyManagement(); var countries = new Func <mng.PartyManagement, CountryDetail[]>((s) => s.GetPtfCountryList()).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); } cbCountryId.SetSelected <CountryDetail>((c) => c.Number == CountryId); }
protected override void OnLoad(EventArgs e) { var service = new mng.PartyManagement(); var countries = new Func <mng.PartyManagement, CountryDetail[]>((s) => s.GetPtfCountryList()).ReTry(service); if (countries == null) { throw new ApplicationException("Can not connect to the server."); } foreach (var country in countries.OrderBy(c => c.Nationality)) { cbCountry.Items.Add(country); cbCountry2.Items.Add(country); } int countryId = MainForm.CurrentCountryId; cbCountry.SetSelected <CountryDetail>((c) => c.Number == countryId); cbCountry2.SetSelected <CountryDetail>((c) => c.Number == countryId); base.OnLoad(e); }
protected override void OnLoad(EventArgs e) { var service = new mng.PartyManagement(); var countries = new Func <mng.PartyManagement, CountryDetail[]>((s) => s.GetPtfCountryList()).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 = Convert.ToInt32(ConfigurationManager.AppSettings["CountryId"]); cbCountryID.SetSelected <CountryDetail>((c) => c.Number == countryId); timer1.Start(); base.OnLoad(e); }