예제 #1
0
 public void Init(LoanListItem item)
 {
     loanNum  = item.loanNum;
     totalPay = item.totalPay;
     BName    = item.BName;
     CID      = item.CID;
 }
예제 #2
0
        private void BtnClickQue(object sender, RoutedEventArgs e)
        {
            data.Clear();
            data.Add(colHead);
            string          sqlStr = "call showLoan();";
            MySqlCommand    cmd    = new MySqlCommand(sqlStr, con);
            MySqlDataReader reader = null;

            try {
                reader = cmd.ExecuteReader();
                LoanListItem item = new LoanListItem();
                while (reader.Read())
                {
                    item.loanNum  = reader.GetString(0);
                    item.totalPay = reader.GetString(1);
                    item.BName    = reader.GetString(2);
                    item.CID      = reader.GetString(3);

                    data.Add(new LoanListItem(item));
                }
                TxtAlert.Text = "Query success!";
            }
            catch (MySqlException ex) {
                TxtAlert.Text  = "Fail to execute sql command!\nError message: ";
                TxtAlert.Text += ex.Message;
            }
            finally {
                reader.Close();
            }
        }
예제 #3
0
 public LoanListItem(LoanListItem item)
 {
     Init(item);
 }