Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Authorization.CheckUser(Request.FilePath))
            {
                Response.Redirect("../LoginForm.aspx");
            }

            TimetablesConnector tc = new TimetablesConnector();
            var list = tc.getDrivers();

            foreach (var item in list)
            {
                TableRow  tr  = new TableRow();
                TableCell tc1 = new TableCell();
                TableCell tc2 = new TableCell();
                TableCell tc3 = new TableCell();
                TableCell tc4 = new TableCell();
                tc1.Text = item.departure.ToShortTimeString();
                tc2.Text = item.arrival.ToShortTimeString();
                tc3.Text = item.vehicle.name;
                tc4.Text = item.route.start + " - " + item.route.finish;
                tr.Cells.Add(tc1);
                tr.Cells.Add(tc2);
                tr.Cells.Add(tc3);
                tr.Cells.Add(tc4);
                tableJourneys.Rows.Add(tr);
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckAccess();

            FailuresConnector fc = new FailuresConnector();
            var list             = fc.getDrivers().OrderByDescending(ff => ff.created);

            foreach (var item in list)
            {
                TableRow  tr  = new TableRow();
                TableCell tc1 = new TableCell();
                TableCell tc2 = new TableCell();
                TableCell tc3 = new TableCell();
                TableCell tc4 = new TableCell();
                TableCell tc5 = new TableCell();
                tc1.Text = item.created.ToString();
                tc2.Text = item.place.ToString();
                tc3.Text = item.message.ToString();
                tc4.Text = item.timetable.vehicle.name;
                tc5.Text = item.timetable.name + " (" + item.timetable.departure.ToShortTimeString() + " - " + item.timetable.arrival.ToShortTimeString() + ")";
                tr.Cells.Add(tc1);
                tr.Cells.Add(tc2);
                tr.Cells.Add(tc3);
                tr.Cells.Add(tc4);
                tr.Cells.Add(tc5);
                tableFailures.Rows.Add(tr);
            }

            TimetablesConnector tc = new TimetablesConnector();
            var listJourneys       = tc.getDrivers();

            foreach (var item in listJourneys)
            {
                dlJourney.Items.Add(new ListItem(item.name + " (" + item.departure.ToShortTimeString() + " - " + item.arrival.ToShortTimeString() + ")", item.id.ToString()));
            }
            // dlType.DataSource = Enum.GetValues(typeof(FailureType));

            var itemValues = System.Enum.GetValues(typeof(FailureType));
            var itemNames  = System.Enum.GetNames(typeof(FailureType));

            dlType.DataSource = Enum.GetNames(typeof(FailureType));
            dlType.DataBind();
        }