protected void btnsignup_Click(object sender, EventArgs e)
    {
        try
        {
            DataFuction    objdf = new DataFuction();
            SqlParameter[] param = new SqlParameter[3];

            param[0]       = new  SqlParameter("@signnumber", SqlDbType.BigInt);
            param[0].Value = Convert.ToInt64(txtsignnumber.Text);

            param[1]       = new SqlParameter("@signemail", SqlDbType.VarChar);
            param[1].Value = txtsignemail.Text;

            param[2]       = new SqlParameter("@signpassword", SqlDbType.VarChar);
            param[2].Value = txtsignpassword.Text;

            int result = objdf.ExecuteQuery("usp_insert_signup", param);

            if (result > 0)
            {
                Response.Write("<script>alert('Sign Up Successful')</script>");
            }

            txtsignnumber.Text   = string.Empty;
            txtsignemail.Text    = string.Empty;
            txtsignpassword.Text = string.Empty;
        }
        catch (Exception ex)
        {
            Response.Write("<script>alert('Error Occured Please Contact to Admin')</script>");
        }
    }
Ejemplo n.º 2
0
    public static int countcart(int user)
    {
        DataFuction objdf = new DataFuction();
        DataTable   dt    = new DataTable();

        dt = objdf.FillDT("select * from ORDER_MASTER where User_Id ='" + user + "'");
        int countcartvalue = dt.Rows.Count;

        return(countcartvalue);
    }
Ejemplo n.º 3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataFuction objdf = new DataFuction();

        lblcartcount.Text   = "0";
        btnshopping.Visible = true;

        //SqlParameter[] param = new SqlParameter[1];
        //param[0] = new SqlParameter("@orderid", SqlDbType.Int);
        //param[0].Value = Convert.ToInt32(lblorderid.Text);

        //objdf.ExecuteQuery("usp_order_remove", param);
        //MakePayment master = (MakePayment)Page.Master;
        //Label lbl = (Label)master.FindControl("lblcartcount");
        //lbl.Text = (Count.countcart(Convert.ToInt32(Session["login"])).ToString());

        Response.Write("<script>alert('Your Order Booked')</script>");
    }
    public void FillProductDetail()
    {
        try{
            DataFuction objdf = new DataFuction();
            DataSet     ds    = new DataSet();

            ds = objdf.FillDsS("select * from PRODUCT_MASTER where Product_Id ='" + productid + "'");

            imgproductimg.ImageUrl  = ds.Tables[0].Rows[0]["Product_Image"].ToString();
            lblproductname.Text     = ds.Tables[0].Rows[0]["Product_Name"].ToString();
            lblProductnamee.Text    = ds.Tables[0].Rows[0]["Product_Name"].ToString();
            lblproductcolour.Text   = ds.Tables[0].Rows[0]["Product_Colour"].ToString();
            lblproductdisprice.Text = ds.Tables[0].Rows[0]["Product_Dis_Price"].ToString();
            lblproductdiscount.Text = ds.Tables[0].Rows[0]["Product_Discount"].ToString();
            lblproductprice.Text    = ds.Tables[0].Rows[0]["Product_Price"].ToString();
            lblproductpricee.Text   = ds.Tables[0].Rows[0]["Product_Price"].ToString();
            lbltotal.Text           = ds.Tables[0].Rows[0]["Product_Price"].ToString();
            lblpay.Text             = ds.Tables[0].Rows[0]["Product_Price"].ToString();
        }
        catch (Exception ex)
        {
            Response.Write("<script>alert('Error Occured Please Contact to Admin')</script>");
        }
    }
    protected void btnaddtocart_Click(object sender, EventArgs e)
    {
        try{
            if (Session["login"] == null)
            {
                Response.Write("<script>alert('Please Login')</script>");
            }



            else
            {
                KapdeWala master = (KapdeWala)Page.Master;
                Label     lbl    = (Label)master.FindControl("lblcartcount");

                DataFuction objdf = new DataFuction();
                //ds = objdf.FillDsS("select * from PRODUCT_MASTER where Product_Id ='" + productid + "'");

                //imgproductimg.ImageUrl = ds.Tables[0].Rows[0]["Product_Image"].ToString();
                //lblproductname.Text = ds.Tables[0].Rows[0]["Product_Name"].ToString();
                //lblproductdisprice.Text = ds.Tables[0].Rows[0]["Product_Dis_Price"].ToString();
                //lblproductdiscount.Text = ds.Tables[0].Rows[0]["Product_Discount"].ToString();
                //lblproductprice.Text = ds.Tables[0].Rows[0]["Product_Price"].ToString();


                SqlParameter[] param = new SqlParameter[6];

                param[0]       = new SqlParameter("@ordername", SqlDbType.VarChar);
                param[0].Value = lblproductname.Text;


                param[1]       = new SqlParameter("@orderimage", SqlDbType.VarChar);
                param[1].Value = imgproductimg.ImageUrl;

                param[2]       = new SqlParameter("@orderprice", SqlDbType.BigInt);
                param[2].Value = Convert.ToInt64(lblproductprice.Text);

                param[3]       = new SqlParameter("@orderdisprice", SqlDbType.BigInt);
                param[3].Value = Convert.ToInt64(lblproductdisprice.Text);

                param[4]       = new SqlParameter("@orderdiscount", SqlDbType.BigInt);
                param[4].Value = Convert.ToInt64(lblproductdiscount.Text);

                param[5]       = new SqlParameter("@userid", SqlDbType.Int);
                param[5].Value = Convert.ToInt32(Session["login"]);



                int result = objdf.ExecuteQuery("usp_order_insert", param);


                if (result > 0)
                {
                    lbl.Text = (Count.countcart(Convert.ToInt32(Session["login"])).ToString());
                }
                else
                {
                    Response.Write("<script> alert('Product already exists !')</script>");
                }
            }
        }
        catch (Exception ex)
        {
            Response.Write("<script>alert('Error Occured Please Contact to Admin')</script>");
        }
    }