Exemplo n.º 1
0
            public static List <classes.Transaction> getClientTransactions(long clientId)
            {
                List <classes.Transaction> tranList = new List <classes.Transaction>();

                try
                {
                    SQLiteDataReader dr = executeReader("select tranId from _transaction where tranClientId=@clientId", new SQLiteParameter[] { new SQLiteParameter("@clientId", clientId) });
                    if (dr != null)
                    {
                        while (dr.Read())
                        {
                            long tranId = long.Parse(dr["tranId"].ToString());
                            classes.Transaction tran = getTransaction(tranId);
                            if (tran != null)
                            {
                                tranList.Add(tran);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Unable to get client transaction details. [" + ex.Message + "]");
                }
                return(tranList);
            }
Exemplo n.º 2
0
 public static classes.Transaction getTransaction(long tranId)
 {
     classes.Transaction tran = null;
     try
     {
         #region MyRegion
         SQLiteDataReader dr = executeReader("select * from _transaction where tranId=@id", new SQLiteParameter[] {
             new SQLiteParameter("@id", tranId)
         });
         if (dr != null && dr.Read())
         {
             tran = new classes.Transaction();
             tran.init(ref dr);
         }
         #endregion
     }
     catch (Exception ex)
     {
         throw new Exception("Unable to get transaction details. [" + ex.Message + "]");
     }
     return(tran);
 }