Esempio n. 1
0
        public CustomerFrame()
        {
            InitializeComponent();
            initTable(cols);

            CustUtil.loadTxn(cols, t, customerCB.Text);
        }
Esempio n. 2
0
        private void custCB_SelectedValueChanged(object sender, EventArgs e)
        {
            this.Background       = Brushes.White;
            flag.Content          = "Flag As Bad";
            imgCapture.Source     = null;
            licenseCapture.Source = null;
            string       item = (string)customerCB.SelectedItem;
            DbDataReader rdr  = null;

            rdr = DB.getInstance().ExecuteQuery(
                "select id,phone,fname,lname,street1,street2,city,state,zip,dob,ssn,height,weight,status,picture,license from customers where id='" + item + "'");

            if (rdr.Read())
            {
                int i = 0;
                customerCB.Text = rdr.GetString(i++);
                phone.Text      = rdr.GetString(i++);
                firstName.Text  = rdr.GetString(i++);
                lastName.Text   = rdr.GetString(i++);
                street1.Text    = rdr.GetString(i++);
                street2.Text    = rdr.GetString(i++);
                city.Text       = rdr.GetString(i++);
                state.Text      = rdr.GetString(i++);
                //dob.Text = rdr.GetString(i++);
                //ssn.Text = rdr.GetString(i++);
                zip.Text    = rdr.GetString(i++);
                dob.Text    = rdr.GetDateTime(i++).ToString("MM/dd/yyyy");
                ssn.Text    = rdr.GetString(i++);
                height.Text = rdr.GetString(i++);
                weight.Text = rdr.GetString(i++);
                int stat = rdr.GetInt32(i++);
                if (stat < 1)
                {
                    this.Background = Brushes.Red;
                    flag.Content    = "Unflag";
                }
                if (!(rdr.IsDBNull(i)))
                {
                    imgCapture.Source = CustUtil.GetImage(rdr, i);
                }
                i++;
                if (!(rdr.IsDBNull(i)))
                {
                    licenseCapture.Source = CustUtil.GetImage(rdr, i);
                }
            }
            rdr.Close();
            CustUtil.loadTxn(cols, t, customerCB.Text);
            DB.getInstance().close();
        }
Esempio n. 3
0
 public static BitmapImage GetImage(DbDataReader _rdr, int i)
 {
     return(CustUtil.GetImage(_rdr, i));
 }