Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            stationRepeater.ItemDataBound += new RepeaterItemEventHandler(stationRepeater_ItemDataBound);

            if (!Page.IsPostBack)
            {
                StationTableAdapter stationAdapter = new StationTableAdapter();

                DollarSaverDB.StationDataTable stations = stationAdapter.GetActive();

                DollarSaverDB.StationDataTable activeSiteStations = new DollarSaverDB.StationDataTable();
                foreach (DollarSaverDB.StationRow station in stations)
                {
                    if (station.StationId != 1 && station.IsSiteActive)
                    {
                        activeSiteStations.ImportRow(station);
                    }
                }


                stationRepeater.DataSource = activeSiteStations.Rows;
                stationRepeater.DataBind();

                endYearLabel.Text = DateTime.Now.ToString("yyyy");
            }
        }
Esempio n. 2
0
        private void BindData()
        {
            timerBottomLabel.Text = now.ToString("MM/dd/yyyy hh:mm:ss tt");

            bool inactive = Globals.ConvertToBool(Request.QueryString["inactive"]);

            DollarSaverDB.StationDataTable stations;

            if (inactive)
            {
                mainTimer.Enabled = false;

                activeLinkHolder.Visible       = true;
                inactiveLinkHolder.Visible     = false;
                headerCell.Attributes["class"] = "inactive_header";
                headerCell.InnerText           = "Inactive Stations";

                recentOrderHolder.Visible = false;

                StationTableAdapter stationAdapter = new StationTableAdapter();
                stations = stationAdapter.GetInactive();
            }
            else
            {
                activeLinkHolder.Visible   = false;
                inactiveLinkHolder.Visible = true;

                StationTableAdapter stationAdapter = new StationTableAdapter();
                stations = stationAdapter.GetActive();

                recentOrderHolder.Visible = true;
                OrderTableAdapter            orderAdapter = new OrderTableAdapter();
                DollarSaverDB.OrderDataTable recentOrders = orderAdapter.GetSuperRecent(15);
                recentOrderGrid.DataSource = recentOrders.Rows;
                recentOrderGrid.DataBind();
            }

            if (stations.Count > 0)
            {
                stationHolder.Visible    = true;
                noStationsHolder.Visible = false;

                stationGrid.DataSource = stations.Rows;
                stationGrid.DataBind();
            }
            else
            {
                stationHolder.Visible    = false;
                noStationsHolder.Visible = true;
            }
        }
Esempio n. 3
0
        protected override void  OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            orderGrid.RowCommand += new GridViewCommandEventHandler(orderGrid_RowCommand);
            //orderGrid.PageIndexChanging += new GridViewPageEventHandler(orderGrid_PageIndexChanging);

            searchButton.Click += new EventHandler(searchButton_Click);

            if (!Page.IsPostBack)
            {
                StationTableAdapter            stationAdapter = new StationTableAdapter();
                DollarSaverDB.StationDataTable stations       = stationAdapter.GetActive();

                stationList.DataSource     = stations.Rows;
                stationList.DataTextField  = "ShortName";
                stationList.DataValueField = "Stationid";
                stationList.DataBind();

                stationList.Items.Insert(0, new ListItem("-- All Stations --", "0"));
            }
        }