예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        protected override void OnLoad(EventArgs e)
        {
            var service = new mng.PartyManagement();

            service.GetPtfCountryListCompleted += new GetPtfCountryListCompletedEventHandler(OnGetPtfCountryListCompleted);
            service.GetPtfCountryListAsync();

            base.OnLoad(e);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
            }
        }
예제 #7
0
        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);
        }
예제 #8
0
        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);
        }
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }