public override List <CartLink> GetCartLinkList()
        {
            List <CartLink> list = new List <CartLink>();

            using (SqlConnection connection = this.GetSqlConnection())
            {
                string     cmdText = "select * from SuCommerce_vw_CartLinks";
                SqlCommand command = new SqlCommand(cmdText, connection)
                {
                    CommandType = CommandType.Text
                };
                connection.Open();
                using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    CartLink link = null;
                    while (reader.Read())
                    {
                        link = new CartLink();
                        CommerceDataProvider.PopulateCartLinkList(reader, link);
                        list.Add(link);
                    }
                    reader.Close();
                    connection.Close();
                }
            }
            return(list);
        }
Esempio n. 2
0
 public static void PopulateCartLinkList(IDataReader dr, CartLink _cartLink)
 {
     _cartLink.CartLinkID             = (int)dr["cartlinkid"];
     _cartLink.ProductID              = (int)dr["productid"];
     _cartLink.PackageTypeID          = (int)dr["packagetypeid"];
     _cartLink.LicenseTypeID          = (int)dr["licensetypeid"];
     _cartLink.Price                  = (decimal)dr["price"];
     _cartLink.PackageTypeCode        = dr["packagetypecode"] as string;
     _cartLink.LicenseTypeDescription = dr["licensetypedescription"] as string;
     _cartLink.IsDisplayed            = (bool)dr["isdisplayed"];
     _cartLink.PackageTypeDescription = dr["packagetypedescription"] as string;
     _cartLink.Title                  = dr["title"] as string;
     _cartLink.ProductTypeID          = (int)dr["producttypeid"];
     _cartLink.ProductTypeCode        = dr["producttypecode"] as string;
     _cartLink.Version                = (decimal)dr["version"];
     _cartLink.IsActive               = (bool)dr["isactive"];
 }