protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!IsPostBack) { lstStatus.DataSource = OrderStatusCode.FindAll(); lstStatus.DataValueField = "Bvin"; lstStatus.DataTextField = "StatusDisplayName"; lstStatus.DataBind(); } }
public IEnumerable <OrderBrief> Get(int pageSize = 100, int pageNumber = 1, string period = "year", string status = "") { var totalCount = 0; List <OrderSnapshot> data = null; var dates = GetDateRange(period); if (status == "Ready for payment") { data = HccApp.OrderServices.Orders.GetReadyForPaymentPaged(dates.StartDate, dates.EndDate, pageNumber, pageSize, ref totalCount); } else if (status == "Ready for shipping") { data = HccApp.OrderServices.Orders.GetReadyForShippingPaged(dates.StartDate, dates.EndDate, pageNumber, pageSize, ref totalCount); } else { var statusCode = OrderStatusCode.FindAll().FirstOrDefault(o => o.StatusName == status); var statusCodeBvin = string.Empty; if (statusCode != null) { statusCodeBvin = statusCode.Bvin; } data = GetOrdersData(pageSize, pageNumber, dates, statusCodeBvin, ref totalCount); } return(data.Select(d => new OrderBrief { OrderId = d.bvin, OrderDate = d.TimeOfOrderUtc, CustomerName = string.Format("{0} {1}", d.BillingAddress.FirstName, d.BillingAddress.LastName), Total = d.TotalGrand, OrderNumber = d.OrderNumber, StatusCode = d.StatusName, PaymentStatus = d.PaymentStatus.ToString(), ShippingStatus = d.ShippingStatus.ToString() }).ToList()); }