示例#1
0
        public static List<SalesRow> GetSaleRowsBySeller(int sellerId)
        {
            var dbConn = Functions.GetConnection();
            var saleRows = new List<SalesRow>();
            using (dbConn)
            {
                dbConn.Open();
                var cmd = dbConn.CreateCommand();
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = string.Format("SELECT * FROM SaleRows WHERE SellerId = {0}", sellerId);
                var rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    var sellerid = int.Parse(rdr["SellerId"].ToString());

                    var thisRow = new SalesRow(sellerid, Convert.ToDouble(rdr["Price"]));
                    saleRows.Add(thisRow);
                }
            }
            return saleRows;
        }
示例#2
0
 public void RemoveRow(SalesRow thisRow)
 {
     SalesRows.Remove(thisRow);
 }