protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { liHeader.Text = DateTime.Now.ToString("MMMM") + " " + DateTime.Now.Day.ToString() + ", " + DateTime.Now.Year.ToString(); liSubHeader.Text = DateTime.Now.DayOfWeek + " " + DateTime.Now.AddHours(3).ToShortTimeString() + " (EST)"; ddlVersion.DataSource = CSFactory.GetAllVersion(); ddlVersion.DataTextField = "Title"; ddlVersion.DataValueField = "VersionId"; ddlVersion.DataBind(); ddlVersion.Items.Insert(0, new ListItem("Select", "0")); if (Request.Cookies["FromDate"] != null && Request.Cookies["ToDate"] != null) { rangeDateControlCriteria.StartDateValueLocal = Convert.ToDateTime(Request.Cookies["FromDate"]); rangeDateControlCriteria.EndDateValueLocal = Convert.ToDateTime(Request.Cookies["ToDate"]); } else { rangeDateControlCriteria.StartDateValueLocal = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); rangeDateControlCriteria.EndDateValueLocal = DateTime.Now.Date; } BindData(rangeDateControlCriteria.StartDateValueLocal, rangeDateControlCriteria.EndDateValueLocal); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { liHeader.Text = DateTime.Now.ToString("MMMM") + " " + DateTime.Now.Day.ToString() + ", " + DateTime.Now.Year.ToString(); liSubHeader.Text = DateTime.Now.DayOfWeek + " " + DateTime.Now.AddHours(3).ToShortTimeString() + " (EST)"; ddlVersion.DataSource = CSFactory.GetAllVersion().FindAll(x => x.Visible == true); ddlVersion.DataTextField = "Title"; ddlVersion.DataValueField = "VersionId"; ddlVersion.DataBind(); ddlVersion.Items.Insert(0, new ListItem("All", "0")); //ddlPaths.DataSource = new PathManager().GetAllPaths(false); //ddlPaths.DataTextField = "Title"; //ddlPaths.DataValueField = "PathId"; //ddlPaths.DataBind(); //ddlPaths.Items.Insert(0, new ListItem("Select", "0")); if (Session["FilterFromDate"] != null && Session["FilterToDate"] != null) { rangeDateControlCriteria.StartDateValueLocal = Convert.ToDateTime(Session["FilterFromDate"]); rangeDateControlCriteria.EndDateValueLocal = Convert.ToDateTime(Session["FilterToDate"]); } else { rangeDateControlCriteria.StartDateValueLocal = DateTime.Now.Date; rangeDateControlCriteria.EndDateValueLocal = DateTime.Now.Date; } BindData(DateTimeUtil.GetEastCoastStartDate(rangeDateControlCriteria.StartDateValueLocal), DateTimeUtil.GetEastCoastDate(rangeDateControlCriteria.EndDateValueLocal), 0, 0); } }
private void BindVersions() { ddlVersion.DataSource = CSFactory.GetAllVersion().FindAll(x => x.Visible == true); ddlVersion.DataTextField = "Title"; ddlVersion.DataValueField = "VersionId"; ddlVersion.DataBind(); ddlVersion.Items.Insert(0, new ListItem("All", "0")); }
private void BindAvailableVersions() { lbAllVersions.Items.Clear(); lbAllVersions.DataSource = CSFactory.GetAllVersion().Where(x => lbSelectedVersions.Items.FindByValue(x.VersionId.ToString()) == null); lbAllVersions.DataTextField = "Title"; lbAllVersions.DataValueField = "VersionId"; lbAllVersions.DataBind(); }
private void BindVersions() { ddlWinningVersion.Items.Clear(); ddlWinningVersion.DataSource = CSFactory.GetAllVersion(); ddlWinningVersion.DataTextField = "Title"; ddlWinningVersion.DataValueField = "VersionId"; ddlWinningVersion.DataBind(); ddlWinningVersion.Items.Insert(0, "None"); }
public void BindPathInfo(int PathId) { //pull the list from Master location PathManager pathMgr = new PathManager(); List <Template> MasterTemplateList; if (PathId > 0) { MasterTemplateList = pathMgr.GetAllTemplates(false); Path pathItem = pathMgr.GetUpSalePath(PathId, true); txtTitle.Text = pathItem.Title; txtWeight.Text = String.Format("{0:0.##}", pathItem.Weight); foreach (Template item in pathItem.Templates) { Template existItem = MasterTemplateList.FirstOrDefault(x => x.TemplateId == item.TemplateId); if (existItem != null) { existItem.Active = true; existItem.OrderNo = item.OrderNo; } } lstVersion.DataSource = CSFactory.GetAllVersion().FindAll(x => x.Visible == true); lstVersion.DataTextField = "Title"; lstVersion.DataValueField = "VersionId"; lstVersion.DataBind(); foreach (Int32 item in pathItem.Versions) { ListItem listItem = lstVersion.Items.FindByValue(item.ToString()); listItem.Selected = true; } } else { MasterTemplateList = pathMgr.GetAllTemplates(true); lstVersion.DataSource = CSFactory.GetAllVersion().FindAll(x => x.Visible == true); lstVersion.DataTextField = "Title"; lstVersion.DataValueField = "VersionId"; lstVersion.DataBind(); } dlTemplateList.DataSource = MasterTemplateList; dlTemplateList.DataKeyField = "TemplateId"; dlTemplateList.DataBind(); }
private void BindModelVersions(string currentVersion, DataListItem dlic) { DropDownList ddlModelCotnrol; //Bind Models Versions if (dlic != null) { ddlModel = (DropDownList)dlic.FindControl("ddlModelEdit"); } else { ddlModelCotnrol = ddlModel; } ddlModel.DataSource = CSFactory.GetAllVersion().FindAll(x => x.Title != currentVersion);//x.IsDynamic == false && ddlModel.DataTextField = "Title"; ddlModel.DataValueField = "VersionID"; ddlModel.DataBind(); ddlModel.Items.Insert(0, new ListItem("Select", "-1")); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { rangeDateControlCriteria.StartDateValueLocal = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); rangeDateControlCriteria.EndDateValueLocal = DateTime.Now.Date; ddlVersion.DataSource = CSFactory.GetAllVersion(); ddlVersion.DataTextField = "Title"; ddlVersion.DataValueField = "VersionId"; ddlVersion.DataBind(); ddlVersion.Items.Insert(0, new ListItem("Select", "0")); ddlPaths.DataSource = new PathManager().GetAllPaths(false); ddlPaths.DataTextField = "Title"; ddlPaths.DataValueField = "PathId"; ddlPaths.DataBind(); ddlPaths.Items.Insert(0, new ListItem("Select", "0")); BindData(rangeDateControlCriteria.StartDateValueLocal, DateTimeUtil.GetEndDate(rangeDateControlCriteria.EndDateValueLocal), 0, 0, rptTotals, rptTotalsItem); } }
private void BindVersion() { dlVersionList.DataSource = CSFactory.GetAllVersion(); dlVersionList.DataKeyField = "VersionId"; dlVersionList.DataBind(); }
public string GetVersionName() { return(CSFactory.GetAllVersion().First(x => { return x.VersionId == CartContext.VersionId; }).Title.Trim().ToUpper()); }