当前位置: 首页>>代码示例>>C#>>正文


C# Products.getAllProducts方法代码示例

本文整理汇总了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();
    }
开发者ID:efigarolam,项目名称:Snackthat,代码行数:10,代码来源:viewallproducts.aspx.cs

示例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...");
        }
    }
开发者ID:efigarolam,项目名称:Snackthat,代码行数:15,代码来源:viewallproducts.aspx.cs

示例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();
            }
        }
    }
开发者ID:efigarolam,项目名称:Snackthat,代码行数:66,代码来源:assignproducts.aspx.cs


注:本文中的Products.getAllProducts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。