private void ProductGetList()
 {
     try
     {
         ProductORM prodORM = new ProductORM();
         if (string.IsNullOrEmpty(Request.QueryString["cID"]))
         {
             dtListProducts.DataSource = prodORM.List();
             dtListProducts.DataBind();
             dtListSinglePopup.DataSource = prodORM.List();
             dtListSinglePopup.DataBind();
         }
         else
         {
             dtListProducts.DataSource = prodORM.ProductInCategory(Convert.ToInt32(Request.QueryString["cID"]));
             dtListProducts.DataBind();
             dtListSinglePopup.DataSource = prodORM.ProductInCategory(Convert.ToInt32(Request.QueryString["cID"]));
             dtListSinglePopup.DataBind();
         }
     }
     catch
     {
         Response.Redirect("Products.aspx");
     }
 }
Exemplo n.º 2
0
 protected void rptProduct_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     try
     {
         bool result = false;
         if (e.CommandName == "btnDelete")
         {
             Button     btnDelete = e.Item.FindControl("btnDelete") as Button;
             ProductORM prodORM   = new ProductORM();
             result = prodORM.Delete(Convert.ToInt32(btnDelete.CommandArgument));
             if (result)
             {
                 rptProduct.DataSource = prodORM.List();
                 rptProduct.DataBind();
             }
         }
         else if (e.CommandName == "btnUpdate")
         {
             Session["ProductID"] = e.CommandArgument;
             Server.Transfer("NewProduct.aspx");
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 3
0
        private void ProductGetList()
        {
            ProductORM prodORM = new ProductORM();

            rptProduct.DataSource = prodORM.List();
            rptProduct.DataBind();
        }