コード例 #1
0
        internal List <BuyerInfo> SelectBuyerSUMItemAndAmountByOrderPartitionID()
        {
            List <BuyerInfo> list = new List <BuyerInfo>();

            using (SqlConnection connection = new SqlConnection(DBHelper.connectionString))
            {
                using (SqlCommand cmd = new SqlCommand(SelectBuyerSUMItemAndAmountByOrderPartitionIDCmd()))
                {
                    connection.Open();
                    cmd.Connection = connection;
                    cmd.Parameters.AddWithValue("@OrderPartitionID", this.OrderPartitionID);

                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            BuyerInfo buyerInfo = new BuyerInfo();
                            buyerInfo.OrderPartitionID = reader.GetString(0);
                            buyerInfo.Item             = reader.GetString(1);
                            buyerInfo.Amount           = reader.GetInt32(2);
                            list.Add(buyerInfo);
                        }
                    }
                }
            }
            return(list);
        }
コード例 #2
0
        internal List <BuyerInfo> GetBuyerInfoListByOrderPartitionIDandBuyerID()
        {
            List <BuyerInfo> buyerInfoList = new List <BuyerInfo>();

            using (SqlConnection connection = new SqlConnection(DBHelper.connectionString))
            {
                using (SqlCommand cmd = new SqlCommand(GetBuyerInfoListByOrderPartitionIDandBuyerIDCmd()))
                {
                    connection.Open();
                    cmd.Connection = connection;
                    cmd.Parameters.AddWithValue("@BuyerID", this.BuyerID);
                    cmd.Parameters.AddWithValue("@OrderPartitionID", this.OrderPartitionID);

                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            BuyerInfo buyerInfo = new BuyerInfo(BuyerID);
                            buyerInfo.OrderPartitionID = reader.GetString(0);
                            buyerInfo.Item             = reader.GetString(1);
                            buyerInfo.Price            = reader.GetDouble(2);
                            buyerInfo.Amount           = reader.GetInt32(3);
                            buyerInfo.Note             = reader.GetString(4);
                            buyerInfo.ID = reader.GetInt32(5);
                            buyerInfoList.Add(buyerInfo);
                        }
                    }
                }
            }
            return(buyerInfoList);
        }
コード例 #3
0
        internal List <string> SelectAllBuyerTotalPartitionID()
        {
            List <string> list = new List <string>();

            using (SqlConnection connection = new SqlConnection(DBHelper.connectionString))
            {
                using (SqlCommand cmd = new SqlCommand(SelectAllBuyerTotalPartitionIDCmd()))
                {
                    connection.Open();
                    cmd.Connection = connection;
                    cmd.Parameters.AddWithValue("@OrderPartitionID", this.OrderPartitionID);

                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            BuyerInfo buyerInfo = new BuyerInfo();
                            buyerInfo.BuyerID = reader.GetString(0);
                            list.Add(buyerInfo.BuyerID);
                        }
                    }
                }
            }
            return(list);
        }