Exemplo n.º 1
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.º 2
0
        /*public CashCheck(string custId, Boolean customer)
         * {
         *  txnId = CheckUtil.GetID();
         *  this.cid = custId;
         *  InitializeComponent();
         *  customerID.Text = custId;
         * }
         *
         * public CashCheck(string txId)
         * {
         *  this.txnId = txId;
         *  InitializeComponent();
         *  loadTxn();
         * }*/


        private void Window_Initialized(object sender, EventArgs e)
        {
            CheckUtil.initScanner(this);
            txID.Text = txnId;
            string       str = "select distinct id from customers order by id";
            DbDataReader rdr = DB.getInstance().ExecuteQuery(str);

            while (rdr.Read())
            {
                customerID.Items.Add(rdr.GetString(0));
            }
            rdr.Close();
            DB.getInstance().close();
        }
Exemplo n.º 3
0
        private void loadTxn()
        {
            this.Background = Brushes.White;
            DbDataReader rdr = null;

            rdr = DB.getInstance().ExecuteQuery(
                "select customer,last_updated,teller,amount,routing,account,checkno,bank,custimg,checkimg,backimg from txn where txid='" + txnId + "'");
            if (rdr.Read())
            {
                int i = 0;
                customerID.Text = rdr.GetString(i++);
                date.Text       = rdr.GetDateTime(i++).ToString();
                teller.Text     = rdr.GetString(i++);
                amount.Text     = rdr.GetDouble(i++).ToString();
                routing.Text    = rdr.GetString(i++);
                acct.Text       = rdr.GetString(i++);
                check.Text      = rdr.GetString(i++);
                bank.Text       = rdr.GetString(i++);
                if (!(rdr.IsDBNull(i)))
                {
                    imgCapture.Source = CheckUtil.GetImage(rdr, i);
                }
                i++;
                if (!(rdr.IsDBNull(i)))
                {
                    checkCapture.Source = CheckUtil.GetImage(rdr, i);
                }
                i++;
                if (!(rdr.IsDBNull(i)))
                {
                    backCapture.Source = CheckUtil.GetImage(rdr, i);
                }
            }
            rdr.Close();

            rdr = DB.getInstance().ExecuteQuery(
                "select * from flagged where routing='" + routing.Text + "' and account='" + acct.Text + "'");
            if (rdr.Read())
            {
                this.Background = Brushes.Red;
                flag.Content    = "Unflag";
                rdr.Close();
            }

            DB.getInstance().close();
        }
Exemplo n.º 4
0
 public static CashCheck Get()
 {
     return(Get(CheckUtil.GetID(), 0));
 }
Exemplo n.º 5
0
 private void button1_Click_1(object sender, RoutedEventArgs e)
 {
     CheckUtil.scanCheck(this);
     amount.Focus();
 }
Exemplo n.º 6
0
        private void saveTxn_Click(object sender, RoutedEventArgs e)
        {
            string _id     = txID.Text;
            string _custid = customerID.Text;
            double _amt    = 0;

            Double.TryParse(amount.Text, out _amt);
            string _routing = routing.Text;
            string _bank    = bank.Text;
            string _account = acct.Text;
            string _check   = check.Text;

            if (string.IsNullOrEmpty(amount.Text) || string.IsNullOrEmpty(_routing) || string.IsNullOrEmpty(_account))
            {
                MessageBox.Show("Amount, Routing, and Account Number are Required");
                return;
            }

            Hashtable t = new Hashtable();

            t["customer"]     = "'" + _custid + "'";
            t["last_updated"] = "'" + DateTime.Now + "'";
            t["teller"]       = "'" + HomeWindow.user + "'";
            t["amount"]       = "" + _amt + "";
            t["routing"]      = "'" + _routing + "'";
            t["bank"]         = "'" + _bank + "'";
            t["account"]      = "'" + _account + "'";
            t["checkno"]      = "'" + _check + "'";

            ArrayList l = new ArrayList();

            l.Add("'" + _id + "'");
            l.Add("'" + _custid + "'");
            l.Add("'" + DateTime.Now + "'");
            l.Add("'" + HomeWindow.user + "'");
            l.Add("" + _amt + "");
            l.Add("'" + _routing + "'");
            l.Add("'" + _account + "'");
            l.Add("'" + _check + "'");
            l.Add("'" + _bank + "'");
            l.Add("null");
            l.Add("null");
            l.Add("null");

            if (_custid == null || _custid.Trim().Length == 0)
            {
                MessageBox.Show("Customer ID Name is Required");
                return;
            }
            string str = DB.getInstance().getUpdateString(t, "txn", " where txid='" + _id + "'");
            int    ret = DB.getInstance().ExecuteNonQuery(str);

            if (ret == 0)
            {
                str = DB.getInstance().getInsertString(l, "txn");
                ret = DB.getInstance().ExecuteNonQuery(str);
                if (ret == 0)
                {
                    MessageBox.Show("Please enter required fields () ");
                    return;
                }
            }
            int seq = 0;

            Int32.TryParse(_id.Substring(_id.Length - 4), out seq);
            CheckUtil.SetID(seq);
            w.txnID   = _id;
            w.isCheck = true;
            w.ShowDialog();
            JpegBitmapEncoder encoder = null;
            MemoryStream      bas     = null;
            string            qry     = string.Empty;

            if (checkCapture.Source != null)
            {
                encoder = Helper.GetImage((BitmapSource)checkCapture.Source);
                bas     = new MemoryStream();
                encoder.Save(bas);
                qry = "update txn set checkimg=@checkimg where txid='" + _id + "'";
                DB.getInstance().UpdateImage(qry, bas.GetBuffer(), "@checkimg");
                bas.Close();
            }

            if (backCapture.Source != null)
            {
                encoder = Helper.GetImage((BitmapSource)backCapture.Source);
                bas     = new MemoryStream();
                encoder.Save(bas);
                qry = "update txn set backimg=@backimg where txid='" + _id + "'";
                DB.getInstance().UpdateImage(qry, bas.GetBuffer(), "@backimg");
                bas.Close();
            }

            DB.getInstance().close();
            this.NavigationService.RemoveBackEntry();
            this.NavigationService.Navigate(new CustomerFrame(false));
        }
Exemplo n.º 7
0
 private void exit_Click(object sender, RoutedEventArgs e)
 {
     CheckUtil.exitScanner();
     Environment.Exit(0);
 }
Exemplo n.º 8
0
 private void WindowClosing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     CheckUtil.exitScanner();
     Environment.Exit(0);
 }