protected void OrderGrid_RowUpdating(object sender, GridViewUpdateEventArgs e) { Label Oid = OrderGrid.Rows[e.RowIndex].FindControl("lblOrderId") as Label; DropDownList OStatus = OrderGrid.Rows[e.RowIndex].FindControl("StatusDrop") as DropDownList; SqlCommand cmd = new SqlCommand("Update Orders set OrderStatus=@status where OrderId=@oid", con); //String updatedata = "Update Orders set OrderStatus=@status where OrderId=@oid"; //SqlCommand cmd = new SqlCommand(); //cmd.CommandText = updatedata; //cmd.Connection = con; cmd.Parameters.AddWithValue("@oid", Oid.Text); cmd.Parameters.AddWithValue("@status", OStatus.SelectedValue); con.Open(); cmd.ExecuteNonQuery(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); OrderGrid.EditIndex = -1; OrderGrid.DataSource = dt; OrderGrid.DataBind(); con.Close(); FillGridView(); }
private void PopulateOrderGrid() { using ( var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString)) { var spname = ""; switch (_type) { case OrderDrillDownType.Firm: spname = "GetFirmOrdersForGivenWeekForPieces"; break; case OrderDrillDownType.Reservations: spname = "GetReservationsForGivenWeekForPieces"; break; case OrderDrillDownType.Hold: spname = "GetHoldItemsForGivenWeekForPieces"; break; } var data= connection.Query<OrderDrillDownMedel>(string.Format("EXEC [dbo].[SPC_{0}] '{1}'", spname, _weekEndDate.ToString("yyyyMMdd"))).ToList(); if (data.Count < 1) { dvEmptyContent.Visible = true; return; } OrderGrid.DataSource = data; OrderGrid.DataBind(); dvDataContent.Visible = true; } }
protected void OrderGrid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Capture") || e.CommandName.Equals("Ship")) { int orderId = (int)OrderGrid.DataKeys[AlwaysConvert.ToInt(e.CommandArgument)].Value; Order order = OrderDataSource.Load(orderId); if (order != null) { if (e.CommandName.Equals("Capture")) { if ((order.Payments.Count == 1) && (order.Payments[0].PaymentStatus == PaymentStatus.Authorized)) { Response.Redirect("Payments/CapturePayment.aspx?PaymentId=" + order.Payments[0].Id.ToString()); } } else { foreach (OrderShipment shipment in order.Shipments) { if (shipment.ShipDate == System.DateTime.MinValue) { Response.Redirect("Shipments/ShipOrder.aspx?OrderShipmentId=" + shipment.Id.ToString()); } } } } OrderGrid.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { _DigitalGoodId = AlwaysConvert.ToInt(Request.QueryString["DigitalGoodId"]); _DigitalGood = DigitalGoodDataSource.Load(_DigitalGoodId); if (_DigitalGood == null) { Response.Redirect("Default.aspx"); } Caption.Text = string.Format(Caption.Text, _DigitalGood.Name); //GET ALL ORDER ITEMS ASSOCIATED WITH DIGITAL GOOD IList <OrderItemDigitalGood> oidgs = OrderItemDigitalGoodDataSource.LoadForDigitalGood(_DigitalGoodId); //BUILD DISTINCT LIST OF ORDERS List <Order> orders = new List <Order>(); foreach (OrderItemDigitalGood oidg in oidgs) { Order order = oidg.OrderItem.Order; if (orders.IndexOf(order) < 0) { orders.Add(order); } } //BIND TO GRID OrderGrid.DataSource = orders; OrderGrid.DataBind(); }
private void BindData() { //_orders = _orderRepo.GetAll(); _orders = _orderRepo.GetAllByCustomerId(_customerId); OrderGrid.DataSource = _orders; OrderGrid.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { IList <Order> orders = AbleContext.Current.User.Orders; orders.Sort("OrderDate", CommerceBuilder.Common.SortDirection.DESC); OrderGrid.DataSource = orders; OrderGrid.DataBind(); }
protected void btnEditOrders_Click(object sender, EventArgs e) { var customerId = ((GridViewDataItemTemplateContainer)(sender as ASPxButton).Parent).KeyValue; CustomerIdHiddenField.Value = customerId.ToString(); OrderPopup.ShowOnPageLoad = true; OrderGrid.DataBind(); }
protected void SyncButton_Click(object sender, EventArgs e) { _shipStationExportManager.SyncStatuses(); Timer1.Enabled = true; SyncButton.Visible = false; ProgressPanel.Visible = true; OrderGrid.DataBind(); }
void GetAll() { string sqlstr; sqlstr = "SELECT OrderID, CustomerID, ProductID, Qty , Amount FROM myOrder"; OrderGrid.DataSource = mydb.BuildDataTable(sqlstr); OrderGrid.DataBind(); }
private void ReBindGrid() { if (Session["DrilldownView"] == null) { return; } OrderGrid.DataSource = (List <DrillDownModel>)Session["DrilldownView"]; OrderGrid.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { IList <int> selectedOrders = AbleContext.Current.Session.SelectedOrderIds; if ((selectedOrders == null) || (selectedOrders.Count == 0)) { Response.Redirect("~/Admin/Orders/Default.aspx"); } LoadOrders(selectedOrders.ToArray()); OrderGrid.DataSource = _Orders; OrderGrid.DataBind(); OrderList.Text = _OrderNumbers; }
protected void Page_Init(object sender, System.EventArgs e) { _DigitalGoodId = AlwaysConvert.ToInt(Request.QueryString["DigitalGoodId"]); _DigitalGood = DigitalGoodDataSource.Load(_DigitalGoodId); if (_DigitalGood == null) { Response.Redirect("Default.aspx"); } Caption.Text = string.Format(Caption.Text, _DigitalGood.Name); InstructionText.Text = string.Format(InstructionText.Text, _DigitalGood.Name); ProductsGrid.DataSource = _DigitalGood.ProductDigitalGoods; ProductsGrid.DataBind(); //GET ALL ORDER ITEMS ASSOCIATED WITH DIGITAL GOOD IList <OrderItemDigitalGood> oidgs = OrderItemDigitalGoodDataSource.LoadForDigitalGood(_DigitalGoodId); //BUILD DISTINCT LIST OF ORDERS List <CommerceBuilder.Orders.Order> orders = new List <CommerceBuilder.Orders.Order>(); foreach (OrderItemDigitalGood oidg in oidgs) { CommerceBuilder.Orders.Order order = oidg.OrderItem.Order; if (orders.IndexOf(order) < 0) { orders.Add(order); } } //BIND TO GRID OrderGrid.DataSource = orders; OrderGrid.DataBind(); if (!String.IsNullOrEmpty(_DigitalGood.FileName)) { ICriteria criteria = NHibernateHelper.CreateCriteria <DigitalGood>(); criteria.Add(Restrictions.Eq("FileName", StringHelper.SafeSqlString(_DigitalGood.FileName))); IList <DigitalGood> dgc = DigitalGoodDataSource.LoadForCriteria(criteria); if (dgc != null && dgc.Count > 1) { DeleteAllowedPanel.Visible = false; DeletePreventedPanel.Visible = true; NoDeleteFileText.Text = string.Format(NoDeleteFileText.Text, _DigitalGood.FileName); } else { DeleteAllowedPanel.Visible = true; DeletePreventedPanel.Visible = false; DeleteFile.Text = string.Format(DeleteFile.Text, _DigitalGood.FileName); } } }
protected void GetOrdersButton_Click(object sender, EventArgs e) { string debugHtml; Orders = CoreLogic.GetOrders("ewexler", "40mil", out debugHtml); int count = PenatnaDB.Instance.InsertOrders(Orders); Response.Write("Inserted " + count + " orders into the database."); if (!String.IsNullOrWhiteSpace(debugHtml)) { debugHtml = Server.HtmlEncode(debugHtml); debugHtml = debugHtml.Replace("\r\n", "<br />"); Response.Write(debugHtml); } OrderGrid.DataSource = Orders; OrderGrid.DataBind(); }
public void FillGridView() { SqlCommand cmd = new SqlCommand("SELECT OrderId, CustomerName, MobileNo, Address, Vendor, OrderStatus, PickupPerson, PickupDate, DeliveryPerson, DeliveryDate FROM Orders WHERE OrderStatus= @OrderStatus", con); con.Open(); cmd.Parameters.AddWithValue("@OrderStatus", drpordstatus.SelectedValue); cmd.ExecuteNonQuery(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); OrderGrid.DataSource = dt; OrderGrid.DataBind(); con.Close(); }
protected void ShipStationWizard_NextButtonClick(object sender, WizardNavigationEventArgs e) { switch (e.NextStepIndex) { case 1: OrderGrid.DataBind(); if (OrderGrid.Rows.Count == 0) { ShipStationWizard.FinishCompleteButtonStyle.CssClass = "hideExportButton"; ExportOptionsPanel.Visible = false; OrdersTitleLabel.Visible = false; } else { ShipStationWizard.FinishCompleteButtonStyle.CssClass = "button"; ExportOptionsPanel.Visible = true; OrdersTitleLabel.Visible = true; } break; } }
protected void Page_Load(object sender, EventArgs e) { IList <Order> orders = AbleContext.Current.User.Orders; orders.Sort("OrderDate", CommerceBuilder.Common.SortDirection.DESC); OrderGrid.DataSource = orders; OrderGrid.DataBind(); if (AbleContext.Current.Store.EmailLists.Count > 0) { EmailPreferences.Visible = true; } UpdateEmailLink.NavigateUrl = NavigationHelper.GetMobileStoreUrl("~/Members/MyCredentials.aspx"); EmailPreferencesLink.NavigateUrl = NavigationHelper.GetMobileStoreUrl("~/Members/EmailPreferences.aspx"); ChangePassLink.NavigateUrl = NavigationHelper.GetMobileStoreUrl("~/Members/ChangePassword.aspx"); AddressBookLink.NavigateUrl = NavigationHelper.GetMobileStoreUrl("~/Members/MyAddressBook.aspx"); PaymentTypesLink.NavigateUrl = NavigationHelper.GetMobileStoreUrl("~/Members/PaymentTypes.aspx"); MyReviewsLink.NavigateUrl = NavigationHelper.GetMobileStoreUrl("~/Members/MyProductReviews.aspx"); WishlistLink.NavigateUrl = NavigationHelper.GetMobileStoreUrl("~/Members/MyWishlist.aspx"); PhPaymentTypes.Visible = AbleContext.Current.Store.Settings.EnablePaymentProfilesStorage && !AbleContext.Current.User.IsAnonymousOrGuest; PhMyReviews.Visible = AbleContext.Current.Store.Settings.ProductReviewEnabled != CommerceBuilder.Users.UserAuthFilter.None; }
private void fillORDList() { string connectionString = ConfigurationManager.ConnectionStrings["CN"].ConnectionString; string sql = "SELECT ORDMAN.UNIT,DCOD,ORDMAN.DBCD,PCOD,ORDMAN.BRCD,ORDMAN.TXCD,ORDT,ORDN,PORD,TRCD,QNTY,DISPATCHQTY,CANCELQTY,(QNTY-DISPATCHQTY-CANCELQTY) AS BALQTY,ICOD,ORDMAN.RATE AS RATE,ARAT,ACCMST.NAME AS PARTY,REFMST.NAME AS AGENT,FINITMMST.NAME AS ITEM,GRDMST.GRAD AS GRADE FROM ORDMAN LEFT JOIN ACCMST ON ORDMAN.PCOD = ACCMST.CODE LEFT JOIN REFMST ON ORDMAN.BRCD = REFMST.CODE LEFT JOIN FINITMMST ON ORDMAN.COMP = FINITMMST.COMP AND ORDMAN.UNIT = FINITMMST.UNIT AND ORDMAN.DCOD = FINITMMST.DVCD AND ORDMAN.ICOD = FINITMMST.CODE LEFT JOIN GRDMST ON ORDMAN.TRCD = GRDMST.CODE WHERE ORDMAN.COMP = '0001' AND ORDMAN.UNIT ='000001' AND (QNTY-DISPATCHQTY-CANCELQTY) >.001"; using (SqlConnection sqlConnection = new SqlConnection(connectionString)) { using (SqlCommand cmd = new SqlCommand(sql)) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = sqlConnection; sda.SelectCommand = cmd; using (DataTable dt = new DataTable()) { sda.Fill(dt); OrderGrid.DataSource = dt; OrderGrid.DataBind(); } } } } }
protected void BatchButton_Click(object sender, EventArgs e) { List <string> messages = new List <string>(); List <int> orderIds = GetSelectedOrderIds(); if (orderIds.Count > 0) { if (BatchAction.SelectedValue.StartsWith("OS_")) { //UPDATE ORDER STATUS REQUESTED int orderStatusId = AlwaysConvert.ToInt(BatchAction.SelectedValue.Substring(3)); //VALIDATE STATUS OrderStatus status = OrderStatusDataSource.Load(orderStatusId); if (status != null) { IDatabaseSessionManager database = AbleContext.Current.Database; database.BeginTransaction(); foreach (int orderId in orderIds) { Order order = OrderDataSource.Load(orderId); if (order != null) { order.UpdateOrderStatus(status); } } database.CommitTransaction(); } } else { switch (BatchAction.SelectedValue) { case "INVOICE": AbleContext.Current.Session.SelectedOrderIds = orderIds; Response.Redirect("Print/Invoices.aspx"); break; case "PACKSLIP": AbleContext.Current.Session.SelectedOrderIds = orderIds; Response.Redirect("Print/PackSlips.aspx"); break; case "PULLSHEET": AbleContext.Current.Session.SelectedOrderIds = orderIds; Response.Redirect("Print/PullSheet.aspx"); break; case "CANCEL": AbleContext.Current.Session.SelectedOrderIds = orderIds; Response.Redirect("Batch/Cancel.aspx"); break; case "SHIPOPT": AbleContext.Current.Session.SelectedOrderIds = orderIds; Response.Redirect("Batch/Ship.aspx"); break; case "SHIP": AbleContext.Current.Database.BeginTransaction(); int shipCount = 0; foreach (int orderId in orderIds) { Order order = OrderDataSource.Load(orderId); if (order != null && order.Shipments != null) { bool shipped = false; int shipmentCount = order.Shipments.Count; for (int i = 0; i < shipmentCount; i++) { OrderShipment shipment = order.Shipments[i]; if (shipment != null && !shipment.IsShipped) { shipment.Ship(); shipped = true; } } if (shipped) { messages.Add("Order #" + order.OrderNumber + " shipped."); shipCount++; } else { messages.Add("Order #" + order.OrderNumber + " did not have any unshipped items."); } } } AbleContext.Current.Database.CommitTransaction(); messages.Add(shipCount + " orders shipped."); break; case "PAY": AbleContext.Current.Database.BeginTransaction(); int payCount = 0; foreach (int orderId in orderIds) { Order order = OrderDataSource.Load(orderId); if (order != null) { bool paid = false; int paymentCount = order.Payments.Count; for (int i = 0; i < paymentCount; i++) { Payment payment = order.Payments[i]; if (payment.PaymentStatus == PaymentStatus.Authorized) { payment.Capture(payment.Amount, true); paid = true; } else if (payment.PaymentStatus == PaymentStatus.Unprocessed) { payment.Authorize(); paid = true; } } if (paid) { payCount++; messages.Add("Order " + order.OrderNumber.ToString() + " processed."); } else { messages.Add("Order " + order.OrderNumber.ToString() + " does not have any payments to be processed."); } } } AbleContext.Current.Database.CommitTransaction(); messages.Add(payCount + " orders processed."); break; case "DELETE": if (AbleContext.Current.User.IsSystemAdmin) { IDatabaseSessionManager database = AbleContext.Current.Database; database.BeginTransaction(); foreach (int orderId in orderIds) { OrderDataSource.Delete(orderId); } database.CommitTransaction(); OrderGrid.DataBind(); } break; case "EXPORT": AbleContext.Current.Session.SelectedOrderIds = orderIds; Response.Redirect("../DataExchange/OrdersExport.aspx?type=selected"); break; } } } if (messages.Count > 0) { BatchMessage.Visible = true; BatchMessage.Text = string.Join("<br />", messages.ToArray()); } BatchAction.SelectedIndex = -1; OrderGrid.DataBind(); }
protected void Page_Init(object sender, EventArgs e) { OrderGrid.DataBind(); }
private void PopulateOrderGrid() { using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString)) { var type = 1; switch (_type) { case ViewDrillDownType.Firm: type = 1; break; case ViewDrillDownType.Hold: type = 2; break; case ViewDrillDownType.AllPieces: type = 3; break; case ViewDrillDownType.Outerware: type = 4; break; case ViewDrillDownType.UptoFive: type = 5; break; case ViewDrillDownType.Samples: type = 6; break; case ViewDrillDownType.Reservations: type = 7; break; case ViewDrillDownType.Shipments: type = 8; break; case ViewDrillDownType.ShipmentDetails: type = 9; break; } var data = _type == ViewDrillDownType.ShipmentDetails ? connection.Query <DrillDownModel>(string.Format("EXEC [dbo].[SPC_{0}] '{1}', '{2}'", "GetShipmentDetails", _shipTo, _etd)).OrderBy(i => i.Order).ToList() : connection.Query <DrillDownModel>(string.Format("EXEC [dbo].[SPC_{0}] {1}, {2}, {3}", "GetPoloOrdersForGivenWeek", _year, _weekNumber, type)).ToList(); if (_type != ViewDrillDownType.Shipments) { var orders = data.GroupBy(i => i.Order); foreach (var o in orders) { var i = 1; var vls = o.OrderBy(t => t.ProductID).ToList(); foreach (var vl in vls) { //vl.PurchaseOrderNumber = vl.PurchaseOrderNumber + "-" + i; string index = (i < 10) ? ("0" + i) : i.ToString(); vl.PurchaseOrderNumber = vl.PurchaseOrderNumber + "-" + index; i++; } } data = data.OrderBy(d => d.Order).ThenBy(d => d.ProductID).ToList(); } if (data.Count < 1) { dvEmptyContent.Visible = true; return; } switch (_type) { case ViewDrillDownType.Reservations: OrderGrid.Columns[2].Display = false; OrderGrid.Columns[4].Display = false; OrderGrid.Columns[15].Display = false; OrderGrid.Columns[16].Display = false; OrderGrid.Columns[17].Visible = false; OrderGrid.Columns[19].Display = false; OrderGrid.Columns[20].Display = false; OrderGrid.Columns[21].Display = false; break; case ViewDrillDownType.Shipments: OrderGrid.Columns[0].Visible = false; OrderGrid.Columns[1].Visible = false; OrderGrid.Columns[2].Visible = false; OrderGrid.Columns[3].Visible = false; OrderGrid.Columns[4].Visible = false; OrderGrid.Columns[5].Visible = false; OrderGrid.Columns[6].Visible = true; OrderGrid.Columns[7].Visible = false; OrderGrid.Columns[8].Visible = false; OrderGrid.Columns[9].Visible = false; OrderGrid.Columns[10].Visible = false; OrderGrid.Columns[11].Visible = false; OrderGrid.Columns[12].Visible = false; OrderGrid.Columns[13].Visible = false; OrderGrid.Columns[14].Visible = false; OrderGrid.Columns[15].Visible = true; OrderGrid.Columns[16].Visible = false; OrderGrid.Columns[17].Visible = false; OrderGrid.Columns[18].Visible = false; OrderGrid.Columns[19].Visible = true; OrderGrid.Columns[20].Visible = true; OrderGrid.Columns[21].Visible = true; OrderGrid.Columns[22].Visible = false; OrderGrid.Columns[23].Visible = false; OrderGrid.Columns[24].Visible = false; OrderGrid.Columns[25].Visible = false; OrderGrid.Columns[26].Visible = true; OrderGrid.Columns[27].Visible = false; OrderGrid.Columns[28].Visible = false; OrderGrid.Columns[29].Visible = false; break; default: if (_type != ViewDrillDownType.AllPieces) { OrderGrid.Columns[14].Display = false; OrderGrid.Columns[13].Display = false; OrderGrid.Columns[12].Display = false; } break; } Session["DrilldownView"] = data; OrderGrid.DataSource = data; OrderGrid.DataBind(); dvDataContent.Visible = true; } }
private void Bind() { OrderGrid.DataSource = bllOrderRecord.GetOrderList(); OrderGrid.DataBind(); }
protected void SearchButton_Click(object sender, EventArgs e) { ResetSearchButton.Visible = true; OrderGrid.DataBind(); SearchResultAjax.Update(); }
protected void OrderGrid_PageIndexChanging(object sender, GridViewPageEventArgs e) { OrderGrid.PageIndex = e.NewPageIndex; OrderGrid.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { _UserId = AlwaysConvert.ToInt(Request.QueryString["UserId"]); OrderGrid.DataSource = OrderDataSource.LoadForUser(_UserId, "OrderDate DESC"); OrderGrid.DataBind(); }