protected void b2_Click(object sender, EventArgs e)
        {
            int rate = 0;

            if (stars1.Checked)
            {
                rate = 1;
            }
            if (stars2.Checked)
            {
                rate = 2;
            }
            if (stars3.Checked)
            {
                rate = 3;
            }
            if (stars4.Checked)
            {
                rate = 4;
            }
            if (stars5.Checked)
            {
                rate = 5;
            }
            if (Session["user"] != null)
            {
                DataAccess.ProductDAO productDAO = new DataAccess.ProductDAO();
                productDAO.UpgradeRate(id, rate, Session["user"].ToString());

                DataAccess.cartDao cart = new DataAccess.cartDao();
                cart.ChangingRate(Session["user"].ToString(), id, rate);
                Response.Redirect("Product_desc.aspx?id=" + id);
            }
            else
            {
                Response.Redirect("login.aspx");
            }
        }
示例#2
0
        protected void b1_Click(object sender, EventArgs e)
        {
            a = course.Business_Layer.Randomizer.GetRandomPassword(15);
            b = "images/default.png";
            string pdf = "";

            if (f1.FileName != "")
            {
                f1.SaveAs(Request.PhysicalApplicationPath + "./images/" + a + f1.FileName.ToString());
                b = "images/" + a + f1.FileName.ToString();
            }
            if (f2.FileName != "")
            {
                f2.SaveAs(Request.PhysicalApplicationPath + "./user/pdfs/" + a + f1.FileName.ToString() + ".pdf");
                pdf = "pdfs/" + a + f1.FileName.ToString() + ".pdf";
            }

            string category = "Foreign literature";

            if (Radio2.Checked)
            {
                category = "native literature";
            }
            Business_Layer.product product = new Business_Layer.product(t1.Text, t4.Text, t3.Text, (t5.Text), b.ToString(), t2.Text, t6.Text, category, pdf.ToString(), 1, Session["admin"].ToString());
            if (product.error == "")
            {
                DataAccess.ProductDAO productDAO = new DataAccess.ProductDAO();
                productDAO.InsertProduct(product);
                Response.Redirect("add_product.aspx");
            }

            else
            {
                Error.Text = product.error;
            }
        }
示例#3
0
 protected void b1_Click(object sender, EventArgs e)
 {
     DataAccess.ProductDAO productDAO = new DataAccess.ProductDAO();
     productDAO.DeleteProduct(id);
     Response.Redirect("products.aspx");
 }
示例#4
0
 public productBU()
 {
     productDAO = new DataAccess.ProductDAO();
 }