Beispiel #1
0
        public static PaytmResn Getone(Int64 OID)
        {
            PaytmResn  Temp  = new PaytmResn();
            DBCon      con   = new DBCon();
            SqlCommand cmd   = new SqlCommand();
            string     query = "select * from PaytmTxn where OID=@OID";

            try
            {
                cmd = new SqlCommand(query, con.Con);
                cmd.Parameters.AddWithValue("@OID", OID);
                SqlDataReader sqlDataReader = cmd.ExecuteReader();
                while (sqlDataReader.Read())
                {
                    int       index     = -1;
                    PaytmResn hG_Ticket = new PaytmResn();
                    hG_Ticket.id         = sqlDataReader.GetInt32(++index);
                    hG_Ticket.OID        = sqlDataReader.GetInt64(++index);
                    hG_Ticket.OIDkey     = sqlDataReader.GetString(++index);
                    hG_Ticket.TxnId      = sqlDataReader.GetString(++index);
                    hG_Ticket.TxnSts     = sqlDataReader.GetInt32(++index);
                    hG_Ticket.TxtDate    = sqlDataReader.GetDateTime(++index);
                    hG_Ticket.CID        = sqlDataReader.GetInt64(++index);
                    hG_Ticket.PaytmResp  = sqlDataReader.GetString(++index);
                    hG_Ticket.PaidAmount = sqlDataReader.GetString(++index);
                    Temp = hG_Ticket;
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }
            finally
            {
                con.Con.Close(); con.Con.Dispose(); cmd.Dispose();
            }

            return(Temp);
        }
Beispiel #2
0
        public static List <PaytmResn> GetAll()
        {
            List <PaytmResn> listtemp = new List <PaytmResn>();
            DBCon            con      = new DBCon();
            SqlCommand       cmd      = new SqlCommand();
            string           query    = "select * from PaytmTxn";

            try
            {
                cmd = new SqlCommand(query, con.Con);
                SqlDataReader sqlDataReader = cmd.ExecuteReader();
                while (sqlDataReader.Read())
                {
                    int       index     = -1;
                    PaytmResn hG_Ticket = new PaytmResn();
                    hG_Ticket.id         = sqlDataReader.GetInt32(++index);
                    hG_Ticket.OID        = sqlDataReader.GetInt64(++index);
                    hG_Ticket.OIDkey     = sqlDataReader.GetString(++index);
                    hG_Ticket.TxnId      = sqlDataReader.GetString(++index);
                    hG_Ticket.TxnSts     = sqlDataReader.GetInt32(++index);
                    hG_Ticket.TxtDate    = sqlDataReader.GetDateTime(++index);
                    hG_Ticket.CID        = sqlDataReader.GetInt64(++index);
                    hG_Ticket.PaytmResp  = sqlDataReader.GetString(++index);
                    hG_Ticket.PaidAmount = sqlDataReader.GetString(++index);
                    listtemp.Add(hG_Ticket);
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }
            finally
            {
                con.Con.Close(); con.Con.Dispose(); cmd.Dispose();
            }

            return(listtemp);
        }