private void FillDropDowns() { this.ddlRewardPointsAwardedOrderStatus.Items.Clear(); OrderStatusCollection orderStatuses1 = OrderManager.GetAllOrderStatuses(); foreach (OrderStatus orderStatus in orderStatuses1) { ListItem item2 = new ListItem(OrderManager.GetOrderStatusName(orderStatus.OrderStatusId), orderStatus.OrderStatusId.ToString()); this.ddlRewardPointsAwardedOrderStatus.Items.Add(item2); } this.ddlRewardPointsCanceledOrderStatus.Items.Clear(); OrderStatusCollection orderStatuses2 = OrderManager.GetAllOrderStatuses(); foreach (OrderStatus orderStatus in orderStatuses2) { ListItem item2 = new ListItem(OrderManager.GetOrderStatusName(orderStatus.OrderStatusId), orderStatus.OrderStatusId.ToString()); this.ddlRewardPointsCanceledOrderStatus.Items.Add(item2); } this.ddlDefaultStoreTimeZone.Items.Clear(); ReadOnlyCollection <TimeZoneInfo> timeZones = DateTimeHelper.GetSystemTimeZones(); foreach (TimeZoneInfo timeZone in timeZones) { string timeZoneName = timeZone.DisplayName; ListItem ddlDefaultStoreTimeZoneItem2 = new ListItem(timeZoneName, timeZone.Id); this.ddlDefaultStoreTimeZone.Items.Add(ddlDefaultStoreTimeZoneItem2); } CommonHelper.FillDropDownWithEnum(this.ddlCustomerNameFormat, typeof(CustomerNameFormatEnum)); CommonHelper.FillDropDownWithEnum(this.ddlRegistrationMethod, typeof(CustomerRegistrationTypeEnum)); }
private void FillDropDowns() { this.ddlOrderStatus.Items.Clear(); ListItem itemOrderStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlOrderStatus.Items.Add(itemOrderStatus); OrderStatusCollection orderStatuses = OrderManager.GetAllOrderStatuses(); foreach (OrderStatus orderStatus in orderStatuses) { ListItem item2 = new ListItem(orderStatus.Name, orderStatus.OrderStatusID.ToString()); this.ddlOrderStatus.Items.Add(item2); } this.ddlPaymentStatus.Items.Clear(); ListItem itemPaymentStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlPaymentStatus.Items.Add(itemPaymentStatus); PaymentStatusCollection paymentStatuses = PaymentStatusManager.GetAllPaymentStatuses(); foreach (PaymentStatus paymentStatus in paymentStatuses) { ListItem item2 = new ListItem(paymentStatus.Name, paymentStatus.PaymentStatusID.ToString()); this.ddlPaymentStatus.Items.Add(item2); } }
/// <summary> /// Load all valid order statuses. /// </summary> /// <returns>The collection of order statuses marked valid.</returns> public static OrderStatusCollection LoadValidOrderStatuses() { int storeId = Token.Instance.StoreId; OrderStatusCollection statuses = new OrderStatusCollection(); StringBuilder selectQuery = new StringBuilder(); selectQuery.Append("SELECT " + OrderStatus.GetColumnNames(string.Empty)); selectQuery.Append(" FROM ac_OrderStatuses "); selectQuery.Append(" WHERE StoreId = @storeId AND IsValid = 1 "); Database database = Token.Instance.Database; DbCommand selectCommand = database.GetSqlStringCommand(selectQuery.ToString()); database.AddInParameter(selectCommand, "@storeId", System.Data.DbType.Int32, storeId); //EXECUTE THE COMMAND using (IDataReader dr = database.ExecuteReader(selectCommand)) { while (dr.Read()) { OrderStatus orderStatus = new OrderStatus(); OrderStatus.LoadDataReader(orderStatus, dr); statuses.Add(orderStatus); } dr.Close(); } return(statuses); }
protected void FillDropDowns() { this.ddlOrderStatus.Items.Clear(); ListItem itemOrderStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlOrderStatus.Items.Add(itemOrderStatus); OrderStatusCollection orderStatuses = OrderManager.GetAllOrderStatuses(); foreach (OrderStatus orderStatus in orderStatuses) { ListItem item2 = new ListItem(OrderManager.GetOrderStatusName(orderStatus.OrderStatusId), orderStatus.OrderStatusId.ToString()); this.ddlOrderStatus.Items.Add(item2); } }
public static OrderStatusCollection LoadForEmailTemplate(Int32 emailTemplateId, int maximumRows, int startRowIndex, string sortExpression) { //DEFAULT SORT EXPRESSION if (string.IsNullOrEmpty(sortExpression)) { sortExpression = "OrderBy"; } //CREATE THE DYNAMIC SQL TO LOAD OBJECT StringBuilder selectQuery = new StringBuilder(); selectQuery.Append("SELECT"); if (maximumRows > 0) { selectQuery.Append(" TOP " + (startRowIndex + maximumRows).ToString()); } selectQuery.Append(" " + OrderStatus.GetColumnNames("ac_OrderStatuses")); selectQuery.Append(" FROM ac_OrderStatuses, ac_OrderStatusEmails"); selectQuery.Append(" WHERE ac_OrderStatuses.OrderStatusId = ac_OrderStatusEmails.OrderStatusId"); selectQuery.Append(" AND ac_OrderStatusEmails.EmailTemplateId = @emailTemplateId"); selectQuery.Append(" AND StoreId = @storeId"); selectQuery.Append(" ORDER BY " + sortExpression); Database database = Token.Instance.Database; DbCommand selectCommand = database.GetSqlStringCommand(selectQuery.ToString()); database.AddInParameter(selectCommand, "@emailTemplateId", System.Data.DbType.Int32, emailTemplateId); database.AddInParameter(selectCommand, "@storeId", System.Data.DbType.Int32, Token.Instance.StoreId); //EXECUTE THE COMMAND OrderStatusCollection results = new OrderStatusCollection(); int thisIndex = 0; int rowCount = 0; using (IDataReader dr = database.ExecuteReader(selectCommand)) { while (dr.Read() && ((maximumRows < 1) || (rowCount < maximumRows))) { if (thisIndex >= startRowIndex) { OrderStatus orderStatus = new OrderStatus(); OrderStatus.LoadDataReader(orderStatus, dr); results.Add(orderStatus); rowCount++; } thisIndex++; } dr.Close(); } return(results); }
public static OrderStatusCollection LoadForCriteria(string sqlCriteria, int maximumRows, int startRowIndex, string sortExpression) { //DEFAULT SORT EXPRESSION if (string.IsNullOrEmpty(sortExpression)) { sortExpression = "OrderBy"; } //CREATE THE DYNAMIC SQL TO LOAD OBJECT StringBuilder selectQuery = new StringBuilder(); selectQuery.Append("SELECT"); if (maximumRows > 0) { selectQuery.Append(" TOP " + (startRowIndex + maximumRows).ToString()); } selectQuery.Append(" " + OrderStatus.GetColumnNames(string.Empty)); selectQuery.Append(" FROM ac_OrderStatuses"); string whereClause = string.IsNullOrEmpty(sqlCriteria) ? string.Empty : " WHERE " + sqlCriteria; selectQuery.Append(whereClause); selectQuery.Append(" ORDER BY " + sortExpression); Database database = Token.Instance.Database; DbCommand selectCommand = database.GetSqlStringCommand(selectQuery.ToString()); //EXECUTE THE COMMAND OrderStatusCollection results = new OrderStatusCollection(); int thisIndex = 0; int rowCount = 0; using (IDataReader dr = database.ExecuteReader(selectCommand)) { while (dr.Read() && ((maximumRows < 1) || (rowCount < maximumRows))) { if (thisIndex >= startRowIndex) { OrderStatus orderStatus = new OrderStatus(); OrderStatus.LoadDataReader(orderStatus, dr); results.Add(orderStatus); rowCount++; } thisIndex++; } dr.Close(); } return(results); }
private void FillDropDowns() { //order statuses this.ddlOrderStatus.Items.Clear(); ListItem itemOrderStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlOrderStatus.Items.Add(itemOrderStatus); OrderStatusCollection orderStatuses = OrderManager.GetAllOrderStatuses(); foreach (OrderStatus orderStatus in orderStatuses) { ListItem item2 = new ListItem(OrderManager.GetOrderStatusName(orderStatus.OrderStatusId), orderStatus.OrderStatusId.ToString()); this.ddlOrderStatus.Items.Add(item2); } //payment statuses this.ddlPaymentStatus.Items.Clear(); ListItem itemPaymentStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlPaymentStatus.Items.Add(itemPaymentStatus); PaymentStatusCollection paymentStatuses = PaymentStatusManager.GetAllPaymentStatuses(); foreach (PaymentStatus paymentStatus in paymentStatuses) { ListItem item2 = new ListItem(PaymentStatusManager.GetPaymentStatusName(paymentStatus.PaymentStatusId), paymentStatus.PaymentStatusId.ToString()); this.ddlPaymentStatus.Items.Add(item2); } //countries ddlBillingCountry.Items.Clear(); ListItem itemBillingCountry = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlBillingCountry.Items.Add(itemBillingCountry); var countries = CountryManager.GetAllCountriesForBilling(); foreach (var country in countries) { ListItem ddlCountryItem2 = new ListItem(country.Name, country.CountryId.ToString()); ddlBillingCountry.Items.Add(ddlCountryItem2); } }
protected void FillDropDowns() { this.ddlOrderStatus.Items.Clear(); ListItem itemOrderStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlOrderStatus.Items.Add(itemOrderStatus); OrderStatusCollection orderStatuses = OrderManager.GetAllOrderStatuses(); foreach (OrderStatus orderStatus in orderStatuses) { ListItem item2 = new ListItem(OrderManager.GetOrderStatusName(orderStatus.OrderStatusId), orderStatus.OrderStatusId.ToString()); this.ddlOrderStatus.Items.Add(item2); } this.ddlPaymentStatus.Items.Clear(); ListItem itemPaymentStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlPaymentStatus.Items.Add(itemPaymentStatus); PaymentStatusCollection paymentStatuses = PaymentStatusManager.GetAllPaymentStatuses(); foreach (PaymentStatus paymentStatus in paymentStatuses) { ListItem item2 = new ListItem(PaymentStatusManager.GetPaymentStatusName(paymentStatus.PaymentStatusId), paymentStatus.PaymentStatusId.ToString()); this.ddlPaymentStatus.Items.Add(item2); } this.ddlShippingStatus.Items.Clear(); ListItem itemShippingStatus = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0"); this.ddlShippingStatus.Items.Add(itemShippingStatus); ShippingStatusCollection shippingStatuses = ShippingStatusManager.GetAllShippingStatuses(); foreach (ShippingStatus shippingStatus in shippingStatuses) { ListItem item2 = new ListItem(ShippingStatusManager.GetShippingStatusName(shippingStatus.ShippingStatusId), shippingStatus.ShippingStatusId.ToString()); this.ddlShippingStatus.Items.Add(item2); } }
private static OrderStatusCollection DBMapping(DBOrderStatusCollection dbCollection) { if (dbCollection == null) return null; OrderStatusCollection collection = new OrderStatusCollection(); foreach (DBOrderStatus dbItem in dbCollection) { OrderStatus item = DBMapping(dbItem); collection.Add(item); } return collection; }