private void LoadServiceLevels() { Facade.IOrderServiceLevel facServiceLevel = new Facade.Order(); cboServiceLevel.DataValueField = "OrderServiceLevelID"; cboServiceLevel.DataTextField = "Description"; cboServiceLevel.DataSource = facServiceLevel.GetAll(); cboServiceLevel.DataBind(); cboServiceLevel.Items.Insert(0, new RadComboBoxItem("Any")); }
private void ConfigureDisplay() { System.Globalization.GregorianCalendar cal = new System.Globalization.GregorianCalendar(); Facade.BusinessType facBusinessType = new Facade.BusinessType(); Facade.IOrderServiceLevel facOrderServiceLevel = new Facade.Order(); cblBusinessType.DataSource = facBusinessType.GetAll(); cblBusinessType.DataBind(); foreach (ListItem li in cblBusinessType.Items) { li.Selected = true; } cblServiceLevel.DataSource = facOrderServiceLevel.GetAll(); cblServiceLevel.DataBind(); foreach (ListItem li in cblServiceLevel.Items) { li.Selected = true; } string referencesSortExpression = Globals.Configuration.FlagForInvoicingReferencesSortExpression; if (!string.IsNullOrEmpty(referencesSortExpression)) { grdOrders.Columns.FindByUniqueName("References").SortExpression = referencesSortExpression; } int IdentityID = 0; if (!string.IsNullOrEmpty(Request.QueryString["identityid"])) { int.TryParse(Request.QueryString["identityid"].ToString(), out IdentityID); } string MinDate = string.Empty; if (!string.IsNullOrEmpty(Request.QueryString["MinDate"])) { MinDate = Request.QueryString["MinDate"]; } if (IdentityID > 0 && MinDate.Length > 0) { m_isFromDash = true; Facade.IOrganisation facOrg = new Facade.Organisation(); string name = facOrg.GetNameForIdentityId(IdentityID); cboClient.SelectedValue = IdentityID.ToString(); cboClient.Text = name; DateTime startDate = new DateTime(); DateTime.TryParse(MinDate, out startDate); rdiStartDate.SelectedDate = startDate; rdiEndDate.SelectedDate = System.DateTime.Today; if (startDate >= System.DateTime.Today) { rdiEndDate.SelectedDate = startDate.AddDays(1); } rdoListInvoiceType.Items[0].Selected = false; rdoListInvoiceType.Items[2].Selected = true; grdOrders.Rebind(); } }
protected void Page_Load(object sender, EventArgs e) { Security.Authorise.EnforceAuthorisation(eSystemPortion.AddEditOrder); _exportOrderEnabled = bool.Parse(ConfigurationManager.AppSettings["ExportOrderEnabled"].ToLower()); if (!IsPostBack) { // Show/hide the "Export to Palletforce" button depending on whether a module id is present in the config. btnExportOrder.Visible = _exportOrderEnabled; btnCreateDelivery.PostBackUrl = "DeliveryJob.aspx?" + this.CookieSessionID; rblDateFiltering.Items.Clear(); // amended to remove the var so that I can deploy a hot fix foreach (eDateFilterType item in Enum.GetValues(typeof(eDateFilterType))) { rblDateFiltering.Items.Add(new ListItem(Enum.GetName(typeof(eDateFilterType), item).Replace("_", " "), ((int)item).ToString())); } rblDateFiltering.Items.Add(new ListItem("Trunk Date", "3")); ListItem defaultDateFiltering = rblDateFiltering.Items.FindByValue(((int)C_DEFAULT_DATE_FILTERING).ToString()); if (defaultDateFiltering != null) { defaultDateFiltering.Selected = true; } if (rblDateFiltering.Items.Count > 0 && rblDateFiltering.SelectedItem == null) { rblDateFiltering.Items[0].Selected = true; } Facade.ITrafficArea facTrafficArea = new Facade.Traffic(); cblTrafficAreas.DataSource = facTrafficArea.GetAll(); cblTrafficAreas.DataBind(); Facade.IBusinessType facBusinessType = new Facade.BusinessType(); DataSet dsBusinessTypes = facBusinessType.GetAll(); cblBusinessTypes.DataSource = dsBusinessTypes; cblBusinessTypes.DataBind(); foreach (DataRow row in dsBusinessTypes.Tables[0].Rows) { RadMenuItem rmi = new RadMenuItem(); rmi.Text = row["Description"].ToString(); rmi.Value = row["BusinessTypeID"].ToString(); RadMenu1.Items.Add(rmi); } Facade.IOrderServiceLevel facOrderServiceLevel = new Facade.Order(); cblServiceLevel.DataSource = facOrderServiceLevel.GetAll(); cblServiceLevel.DataBind(); Facade.ExtraType facExtraType = new Facade.ExtraType(); cblSurcharges.DataSource = facExtraType.GetAllForFiltering(); cblSurcharges.DataBind(); PreSelectItems(cblServiceLevel, C_SELECTED_SERVICE_LEVELS); PreSelectItems(cblSurcharges, C_SELECTED_SURCHARGES); GetDates(); } }