本文整理汇总了C#中Products.getAllProducts方法的典型用法代码示例。如果您正苦于以下问题:C# Products.getAllProducts方法的具体用法?C# Products.getAllProducts怎么用?C# Products.getAllProducts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products
的用法示例。
在下文中一共展示了Products.getAllProducts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: loadGridView
/// <summary>
/// Method which loads the gridview with all the Products.
/// </summary>
protected void loadGridView()
{
Products product = new Products();
GridView1.DataSource = product.getAllProducts();
GridView1.DataBind();
}
示例2: loadGridView
protected void loadGridView()
{
Products product = new Products();
DataTable dt = product.getAllProducts();
if (dt != null && dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
else
{
this.setNotification("error", "No hay productos asignados", "No se te han asignado productos...");
}
}
示例3: Page_Load
/// <summary>
/// Load the page and make some validations
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Products products = new Products();
Users users = new Users();
DataTable data, data2;
data = users.getAllSellers();
if (data != null && data.Rows.Count > 0)
{
showNotification[0] = false;
}
else
{
showNotification[0] = true;
}
data2 = products.getAllProducts();
if (data2 != null && data2.Rows.Count > 0)
{
showNotification[1] = false;
}
else
{
showNotification[1] = true;
}
if (showNotification[0] && showNotification[1])
{
this.hideForm = true;
this.setNotification("error", "¡Ooooops!", "No hay ni vendedores ni productos");
}
else if (showNotification[0] && !showNotification[1])
{
this.hideForm = true;
this.setNotification("error", "¡Ooooops!", "No hay vendedores");
}
else if (!showNotification[0] && showNotification[1])
{
this.hideForm = true;
this.setNotification("error", "¡Ooooops!", "No hay productos");
}
else if (!showNotification[0] && !showNotification[1])
{
this.hideForm = false;
this.setNotification("nothing");
DropDownList1.DataSource = data;
DropDownList1.DataTextField = "Nombre";
DropDownList1.DataValueField = "ID";
DropDownList1.DataBind();
DropDownList1.Items.Insert(0, "Selecciona una vendedor");
GridView1.DataSource = data2;
GridView1.DataBind();
}
}
}