コード例 #1
0
ファイル: Reports.aspx.cs プロジェクト: kennethrae/BC
        protected void ButtonOrders_Click(object sender, EventArgs e)
        {
            SqlConnection conn;
            SqlCommand    comm;
            SqlDataReader reader;
            string        connectionString = ConfigurationManager.ConnectionStrings["DVDdbCS"].ConnectionString;

            conn = new SqlConnection(connectionString);
            comm = new SqlCommand("SELECT Orders.OrderID, Orders.CustomerID, DVDsOrdered.DVDID, DVDtable.DVDtitle FROM Orders  " +
                                  " INNER JOIN DVDsOrdered ON DVDsOrdered.OrderID = Orders.OrderID " +
                                  " INNER JOIN DVDtable ON DVDsOrdered.DVDID = DVDtable.DVDID " +
                                  " WHERE CustomerID = @CustomerID", conn);
            comm.Parameters.Add("@CustomerID", System.Data.SqlDbType.Int);
            comm.Parameters["@CustomerID"].Value = TextBoxCustNum.Text;
            try
            {
                conn.Open();
                reader = comm.ExecuteReader();
                OrderRepeater.DataSource = reader;
                OrderRepeater.DataBind();
                reader.Close();
            }
            finally
            {
                conn.Close();
            }
        }
コード例 #2
0
ファイル: Order.aspx.cs プロジェクト: heoconxz/Ecommerce
 protected void Page_Load(object sender, EventArgs e)
 {
     //String UID = User.Identity.GetUserId();
     //Page.DataBind();
     System.Web.HttpContext.Current.Session["UserID"] = User.Identity.GetUserId();
     OrderRepeater.DataSource = ObjectDataSource1;
     OrderRepeater.DataBind();
     Debug.WriteLine(User.Identity.GetUserId());
 }
コード例 #3
0
ファイル: AllOrder.aspx.cs プロジェクト: heoconxz/Ecommerce
 protected void Page_Load(object sender, EventArgs e)
 {
     //String UID = User.Identity.GetUserId();
     //Page.DataBind();
     // System.Web.HttpContext.Current.Session["UserID"] = User.Identity.GetUserId();
     DataSetTableAdapters.OrderHeadTableAdapter ds = new DataSetTableAdapters.OrderHeadTableAdapter();
     OrderRepeater.DataSource = ds.GetAllData();
     OrderRepeater.DataBind();
     Debug.WriteLine(User.Identity.GetUserId());
 }
コード例 #4
0
    public void BindUserOrder()
    {
        Order order = new Order();

        if (Session["CommodityimagesName"] != null)
        {
            OrderRepeater.DataSource = order.GetOrderAndOrderStatus(Session["CommodityimagesName"].ToString());
            OrderRepeater.DataBind();
        }
        else
        {
            Response.Redirect("Index.aspx");
        }
    }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.UrlReferrer != null)
                {
                    Back.NavigateUrl = Request.UrlReferrer.ToString();
                }
            }

            IList <int> selectedOrders = GetSelectedOrders();

            if ((selectedOrders == null) || (selectedOrders.Count == 0))
            {
                Response.Redirect("~/Admin/Orders/Default.aspx");
            }
            OrderRepeater.DataSource = GetOrders(selectedOrders.ToArray());
            OrderRepeater.DataBind();
            OrderList.Text = GetOrderNumbers(selectedOrders);
        }