//int FirstTime = 0;
        //int LastTime = 0;


        private void BarcodeText_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                String s = "";
                try
                {
                    s = BarcodeText.Text.Substring(0, 12);
                    Data.Party p = new Data.Party();
                    p = App.HyperPawnDB.PartySearchById(s);

                    if (p != null)
                    {
                        PartySelected(p.PartyId);
                    }
                    if (p == null)
                    {
                        PartySelected(0);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Can't read barcode");
                }



                BarcodeText.Text = null;
            }
        }
        //int FirstTime = 0;
        //int LastTime = 0;
        private void BarcodeText_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                String s = "";
                try
                {
                    s = BarcodeText.Text.Substring(0, 12);
                    Data.Party p = new Data.Party();
                    p = App.HyperPawnDB.PartySearchById(s);

                    if (p != null)
                    {
                        PartySelected(p.PartyId);
                    }
                    if (p == null)
                    {
                        PartySelected(0);
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Can't read barcode");
                }

                BarcodeText.Text = null;
            }
        }
Exemple #3
0
        // The Traditional Event wrapper.
        //public event RoutedEventHandler PartySaved
        //{
        //    add
        //    {
        //        base.AddHandler(PartyEditor.PartySavedEvent, value);
        //    }
        //    remove
        //    {
        //        base.RemoveHandler(PartyEditor.PartySavedEvent, value);
        //    }
        //}



        public PartyEditor(int partyid, int employee)
        {
            saveindicatortimer.Interval = new TimeSpan(0, 0, 1);
            saveindicatortimer.Tick    += new EventHandler(saveindicatortimer_Tick);

            Employee = employee;
            InitializeComponent();

            CityComboBox.ItemsSource = App.TaxyCities;
            RaceComboBox.ItemsSource = App.TaxyRaces;
            HairComboBox.ItemsSource = App.TaxyHairColors;
            EyesComboBox.ItemsSource = App.TaxyEyeColors;

            if (partyid != 0)
            {
                try
                {
                    party = App.HyperPawnDB.PartyGetDetails(partyid);
                }
                catch
                {
                    MessageBox.Show("PartyGetDetails stored procedure failure");
                }
            }
            else
            {
                party = new Shell.Data.Party();
            }
            DataContext = party;
        }