Exemplo n.º 1
0
        // sets datasources and bind data to controls.

        private void Bind()
        {
            var service = new Service();

            GridViewOrders.DataSource = service.GetMembersWithOrderStatistics(SortExpression);
            GridViewOrders.DataBind();
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //只检索当前用户的订单
     SqlDataSourceOrders.SelectCommand = string.Format("SELECT * FROM [Orders] WHERE UserId IN (SELECT UserId from [aspnet_Users] WHERE UserName='******')", User.Identity.Name);
     //绑定数据
     GridViewOrders.DataBind();
 }
Exemplo n.º 3
0
    private void RefreshData()
    {
        var data = imsdb.Orders.OrderByDescending(d => d.Id).ToList();

        GridViewOrders.DataSource = data;
        GridViewOrders.DataBind();
    }
Exemplo n.º 4
0
        /// <summary>
        /// Sets datasources and bind data to controls.
        /// </summary>
        private void Bind()
        {
            // Retrieve orders via Customer Facade.
            var repository = new CustomerRepository();

            GridViewOrders.DataSource = repository.GetCustomersWithOrderStatistics(SortExpression);
            GridViewOrders.DataBind();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Sets datasources and bind data to controls.
        /// </summary>
        private void Bind()
        {
            // Retrieve orders via Customer Facade.
            CustomerController controller = new CustomerController();

            GridViewOrders.DataSource = controller.GetCustomersWithOrderStatistics(SortExpression);
            GridViewOrders.DataBind();
        }
Exemplo n.º 6
0
        protected void UpdatePanel1_Load(object sender, EventArgs e)
        {
            //Populate Orders grid
            Order     order     = new Order();
            DataTable dataTable = order.ToDataTable(order.GetAllOrders());

            GridViewOrders.DataSource = dataTable;
            GridViewOrders.DataBind();
        }
Exemplo n.º 7
0
        private void filter()
        {
            String  date = ddlOrderDate.Text;
            String  id   = txtID.Text;
            String  name = txtCName.Text;
            String  rep  = ddlSalesManager.Text;
            DataSet ds   = obj.filter_BBL(date, id, name, rep);

            Cache.Remove("ds");
            Cache.Insert("ds", ds);
            labelCID.Text             = "CID: " + (String)ViewState["CID"];
            GridViewOrders.DataSource = Cache.Get("ds");
            GridViewOrders.DataBind();
        }
Exemplo n.º 8
0
        /// <summary>
        /// Sets datasources and bind data to controls.
        /// </summary>
        private void Bind()
        {
            // Get customer via Customer Repository.
            var repository = new CustomerRepository();

            ActionServiceReference.Customer customer = repository.GetCustomerWithOrders(CustomerId);

            // Set company name
            LabelHeader.Text = "<font color='black'>Orders for:</font> "
                               + customer.Company + " (" + customer.Country + ")";

            GridViewOrders.DataSource = customer.Orders;
            GridViewOrders.DataBind();
        }
        // sets datasources and bind data to controls.

        private void Bind()
        {
            // get member

            var service = new Service();
            var member  = service.GetMember(MemberId);

            // set company name

            LabelHeader.Text = "<font color='black'>Orders for:</font> "
                               + member.CompanyName + " (" + member.Country + ")";

            GridViewOrders.DataSource = service.GetOrdersByMember(MemberId);
            GridViewOrders.DataBind();
        }
Exemplo n.º 10
0
        protected void GridViewEmployees_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridView gridView = (sender as GridView);

            if (gridView != null)
            {
                System.Threading.Thread.Sleep(3000);

                NORTHWNDEntities context = new NORTHWNDEntities();
                List <Order>     orders  = context.Orders.Where(x => x.EmployeeID == (int)gridView.SelectedValue).ToList <Order>();

                GridViewOrders.DataSource = orders;
                GridViewOrders.DataBind();
            }
        }
Exemplo n.º 11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DataSet ds = obj.GetUserOrders_BLL();
         Cache.Insert("ds", ds);
         GridViewOrders.DataSource = ds;
         GridViewOrders.DataBind();
         ddlSalesManager.DataSource     = obj.GetSalesManager_BBL();
         ddlSalesManager.DataTextField  = "CustRouteRep";
         ddlSalesManager.DataValueField = "CustRouteRep";
         ddlSalesManager.DataBind();
         ddlSalesManager.Items.Insert(0, new ListItem(String.Empty, String.Empty));
         ddlSalesManager.SelectedIndex = 0;
     }
 }
Exemplo n.º 12
0
    protected void txtSearch_TextChanged(object sender, EventArgs e)
    {
        var data = imsdb.Orders.Where(d => d.OrderDate.ToString() == txtSearch.Text ||
                                      d.CustomerName.Contains(txtSearch.Text) ||
                                      d.CustomerPhone.Contains(txtSearch.Text) ||
                                      d.Id.ToString() == txtSearch.Text ||
                                      d.ProductName.Contains(txtSearch.Text) ||
                                      d.Quantity.ToString() == txtSearch.Text ||
                                      d.Rate.ToString() == txtSearch.Text ||
                                      d.Amount.ToString() == txtSearch.Text ||
                                      d.Vat.ToString() == txtSearch.Text ||
                                      d.ServiceCharge.ToString() == txtSearch.Text ||
                                      d.Discount.ToString() == txtSearch.Text ||
                                      d.NetAmount.ToString() == txtSearch.Text).ToList();

        GridViewOrders.DataSource = data;
        GridViewOrders.DataBind();
    }
Exemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (Session["typeid"].ToString() != "2")
         {
             Response.Redirect("~/Login/Login.aspx");
         }
     }
     catch (Exception)
     {
         Response.Redirect("~/Login/Login.aspx");
     }
     if (!IsPostBack)
     {
         var data = imsdb.Orders.OrderByDescending(d => d.Id).ToList();
         GridViewOrders.DataSource = data;
         GridViewOrders.DataBind();
     }
 }
Exemplo n.º 14
0
        protected void GridViewOrders_Sorting(object sender, GridViewSortEventArgs e)
        {
            if (e.SortExpression == (string)ViewState["SortColumn"])
            {
                // We are resorting the same column, so flip the sort direction
                e.SortDirection =
                    ((SortDirection)ViewState["SortColumnDirection"] == SortDirection.Ascending) ?
                    SortDirection.Descending : SortDirection.Ascending;
            }
            // Apply the sort
            DataTable dataTable = GridViewOrders.DataSource as DataTable;

            dataTable.DefaultView.Sort = e.SortExpression +
                                         (string)((e.SortDirection == SortDirection.Ascending) ? " ASC" : " DESC");
            ViewState["SortColumn"]          = e.SortExpression;
            ViewState["SortColumnDirection"] = e.SortDirection;

            GridViewOrders.DataSource = dataTable;
            GridViewOrders.DataBind();
        }
Exemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                var email = HttpContext.Current.User.Identity.Name.Trim();

                if (!IsPostBack)
                {
                    int       userID   = GetSignedInUserID(email);
                    DataTable datTable = GetOrders(userID);
                    if (datTable != null && datTable.Rows.Count > 0)
                    {
                        GridViewOrders.DataSource = datTable;
                        GridViewOrders.DataBind();
                    }
                    else
                    {
                        divAlertMessage.Visible             = true;
                        divAlertMessage.Attributes["class"] = "alert fade in alert-error";
                        LabelAlertMessage.Text = "There are no order records.";
                    }
                }
            }
        }
Exemplo n.º 16
0
 protected void GridViewOrders_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GridViewOrders.PageIndex = e.NewPageIndex;
     GridViewOrders.DataBind();
 }
Exemplo n.º 17
0
 protected void GridViewOrders_RowEditing(object sender, GridViewEditEventArgs e)
 {
     GridViewOrders.EditIndex  = e.NewEditIndex;
     GridViewOrders.DataSource = Cache.Get("ds");
     GridViewOrders.DataBind();
 }
Exemplo n.º 18
0
 protected void GridViewOrders_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
 {
     GridViewOrders.EditIndex  = -1;
     GridViewOrders.DataSource = Cache.Get("ds");
     GridViewOrders.DataBind();
 }
Exemplo n.º 19
0
 private void UpdateGridViewOrders()
 {
     GridViewOrders.DataSource = DataAccess.selectQuery("Select * from Orders where UID=" + id);
     GridViewOrders.DataBind();
 }
Exemplo n.º 20
0
 private void GridViewOrdersBind()
 {
     GridViewOrders.DataSource = Connection.dbTable("SELECT * FROM clients_order");
     GridViewOrders.DataBind();
 }