コード例 #1
0
    public static BplTransactionUserToEstab getbpTransactionUserToEstabyID(string bplUserToEstabTrasactionID)
    {
        BplTransactionUserToEstab m = new BplTransactionUserToEstab();

        try
        {
            SqlCommand command = new SqlCommand("Select * from BplTransactionUserToEstab where bplUserToEstabTrasactionID=@bplUserToEstabTrasactionID");
            command.Connection = connection;
            connection.Open();
            SqlDataReader reader = command.ExecuteReader();
            while (reader.Read())
            {
                m.bplUserToEstabTrasactionID = reader["bplUserToEstabTrasactionID"].ToString();
                BPMatchUserToEstab es = BPMatchUserToEstabDB.getBloodRequestsMatchbyID(reader["bpMatchUsrEstID"].ToString());
                m.bpMatchUsrEstID = es;
                m.unit            = Convert.ToInt32(reader["unitsPossible"]);
                m.status          = reader["status"].ToString();
            }
            reader.Close();
        }
        finally
        {
            connection.Close();
        }
        return(m);
    }
コード例 #2
0
    public static List <BplTransactionUserToEstab> getAllbpTransactionUserToEstabyTime(DateTime from, DateTime to)
    {
        List <BplTransactionUserToEstab> matches = new List <BplTransactionUserToEstab>();

        try
        {
            SqlCommand command = new SqlCommand("Select * from BplTransactionUserToEstab WHERE requestDate BETWEEN @fromdate AND @todate");
            command.Connection = connection;
            connection.Open();
            SqlDataReader reader = command.ExecuteReader();
            while (reader.Read())
            {
                BplTransactionUserToEstab m = new BplTransactionUserToEstab();
                m.bplUserToEstabTrasactionID = reader["bplUserToEstabTrasactionID"].ToString();
                BPMatchUserToEstab es = BPMatchUserToEstabDB.getBloodRequestsMatchbyID(reader["bpMatchUsrEstID"].ToString());
                m.bpMatchUsrEstID = es;
                m.unit            = Convert.ToInt32(reader["unitsPossible"]);
                m.status          = reader["status"].ToString();
                matches.Add(m);
            }
            reader.Close();
        }
        finally
        {
            connection.Close();
        }
        return(matches);
    }