Exemplo n.º 1
0
        private void custView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            DataRow r = t.Rows[custView.SelectedIndex];

            this.NavigationService.RemoveBackEntry();
            this.NavigationService.Navigate(CashCheck.Get("" + r[1] + "", 1));
        }
Exemplo n.º 2
0
        public static CashCheck Get(string custId, Boolean customer)
        {
            CashCheck cc = Get(CheckUtil.GetID(), 0);

            cc.cid             = custId;
            cc.customerID.Text = custId;
            return(cc);
        }
Exemplo n.º 3
0
 public static void _scanCheck(CashCheck cc)
 {
     try
     {
         scanner.axRanger1.StartFeeding(0, 0);
     }
     catch (Exception e)
     {
         System.Windows.MessageBox.Show(e.StackTrace);
         System.Windows.MessageBox.Show(e.Message);
     }
 }
Exemplo n.º 4
0
 public static CashCheck Get(string txId, int load)
 {
     if (cc == null)
     {
         cc = new CashCheck();
         cc.InitializeComponent();
     }
     cc.Background = Brushes.White;
     cc.Clear();
     cc.txnId     = txId;
     cc.txID.Text = txId;
     if (load > 0)
     {
         cc.loadTxn();
     }
     return(cc);
 }
Exemplo n.º 5
0
 public static void initScanner(CashCheck cc)
 {
     if (scanner == null)
     {
         scanner = new CheckHelper(cc);
         try
         {
             //scanner.axRanger1.
             scanner.axRanger1.StartUp();
         }
         catch (Exception e)
         {
             System.Windows.MessageBox.Show(e.StackTrace);
             System.Windows.MessageBox.Show(e.Message);
         }
     }
 }
Exemplo n.º 6
0
 public static void scanCheck(CashCheck cc)
 {
     _scanCheck(cc);
 }
Exemplo n.º 7
0
 public void ExecutedF9Command(object sender, ExecutedRoutedEventArgs e)
 {
     navigate(CashCheck.Get());
 }
Exemplo n.º 8
0
 private void DashboardClick(object sender, RoutedEventArgs e)
 {
     navigate(CashCheck.Get());
 }
Exemplo n.º 9
0
 private void button2_Click(object sender, RoutedEventArgs e)
 {
     //MessageBoxResult res = MessageBox.Show("Do you want to cash the check?", "Cash Check?", MessageBoxButton.YesNo);
     this.NavigationService.RemoveBackEntry();
     this.NavigationService.Navigate(CashCheck.Get(customerCB.Text, true));
 }
Exemplo n.º 10
0
        private void savecustomer_Click(object sender, RoutedEventArgs e)
        {
            string _id      = customerCB.Text;
            string _fn      = firstName.Text;
            string _ln      = lastName.Text;
            string _street1 = street1.Text;
            string _street2 = street2.Text;
            string _city    = city.Text;
            string _state   = state.Text;
            string _zip     = zip.Text;
            string _phone   = phone.Text;
            Object _dob     = null;

            if (!(String.IsNullOrEmpty(dob.Text)))
            {
                try{
                    _dob = DateTime.Parse(dob.Text).ToString();
                } catch (Exception ee)    {
                }
            }
            string _ssn    = ssn.Text;
            string _height = height.Text;
            string _weight = weight.Text;

            Hashtable t = new Hashtable();

            t["city"]    = "'" + _city + "'";
            t["state"]   = "'" + _state + "'";
            t["zip"]     = "'" + _zip + "'";
            t["phone"]   = "'" + _phone + "'";
            t["street1"] = "'" + _street1 + "'";
            t["street2"] = "'" + _street2 + "'";

            t["fname"]  = "'" + _fn + "'";
            t["lname"]  = "'" + _ln + "'";
            t["id"]     = "'" + _id + "'";
            t["ssn"]    = "'" + _ssn + "'";
            t["dob"]    = "'" + _dob + "'";
            t["height"] = "'" + _height + "'";
            t["weight"] = "'" + _weight + "'";
            t["status"] = "1";

            ArrayList l = new ArrayList();

            l.Add("'" + _city + "'");
            l.Add("'" + _state + "'");

            l.Add("'" + _phone + "'");
            l.Add("'" + _street1 + "'");
            l.Add("'" + _street2 + "'");

            l.Add("'" + _fn + "'");
            l.Add("'" + _ln + "'");
            l.Add("'" + _zip + "'");
            l.Add("'" + _id + "'");
            l.Add("'" + _ssn + "'");
            l.Add("'" + _dob + "'");
            l.Add("'" + _height + "'");
            l.Add("'" + _weight + "'");
            l.Add("null");
            l.Add("null");
            l.Add(1);

            if (_id == null || _id.Trim().Length != 11)
            {
                MessageBox.Show("Customer ID must be 11 characters");
                return;
            }
            string str = DB.getInstance().getUpdateString(t, table, " where id='" + _id + "'");
            int    ret = DB.getInstance().ExecuteNonQuery(str);

            if (ret == 0)
            {
                str = DB.getInstance().getInsertString(l, table);
                ret = DB.getInstance().ExecuteNonQuery(str);
                if (ret == 0)
                {
                    MessageBox.Show("Please enter required fields (first name, last name, company, street1, city, state) ");
                    return;
                }
            }
            w.custID  = customerCB.Text;
            w.isCheck = false;
            //w.webcam.Start();
            w.ShowDialog();



            mn.ShowDialog();
            mn.Close();
            if (!(string.IsNullOrEmpty(mn._tempImageName)))
            {
                BitmapImage img1 = new BitmapImage();
                img1.BeginInit();
                img1.UriSource = new Uri(mn._tempImageName);
                img1.EndInit();
                JpegBitmapEncoder encoder = Helper.GetImage(img1);
                MemoryStream      bas     = new MemoryStream();
                encoder.Save(bas);
                string qry = "update customers set license=@license where id='" + _id + "'";
                DB.getInstance().UpdateImage(qry, bas.GetBuffer(), "@license");
                bas.Close();
            }

            MessageBoxResult res = MessageBox.Show("Do you want to cash the check?", "Cash Check?", MessageBoxButton.YesNo);

            this.NavigationService.RemoveBackEntry();
            if (res == MessageBoxResult.Yes)
            {
                this.NavigationService.Navigate(CashCheck.Get(_id, true));
            }
            else
            {
                this.NavigationService.Navigate(new CustomerFrame(false));
            }
        }