本文整理汇总了C#中DataAccess.getProducts方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.getProducts方法的具体用法?C# DataAccess.getProducts怎么用?C# DataAccess.getProducts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccess
的用法示例。
在下文中一共展示了DataAccess.getProducts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(GetType(), "hwa", "getTweets();", true);
//create customer if customer does not exist in session
try
{
if (HttpContext.Current.Session["Customer"] == null)
{
Customer aCustomer;
aCustomer = CartFunctions.createCustomer();
Session["Customer"] = aCustomer;
}//end if
}//end try
catch (Exception)
{
}//end catch
try
{
//check to see if user is logged on, if so assigns user id to CUSTID in customer object
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
string custID;
Customer aCustomer = (Customer)Session["Customer"];
MembershipUser user = Membership.GetUser();
custID = user.ProviderUserKey.ToString();
aCustomer.CUSTID = custID;
}//end if
}//end try
catch (Exception)
{
}//end catch
try
{
//getWeather();
}//end try
catch (Exception)
{
}//end catch
try
{
//if its a new session get products list from database and add it so session variable
if (Session.IsNewSession)
{
ShopDataContext dc = new ShopDataContext();
da = new DataAccess();
List<Product> p = da.getProducts();
Session["Products"] = p;
}//endif
}//end try
catch (Exception)
{
}//end catch
getLatestProducts();
}