Ejemplo n.º 1
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication();
     if (CalendarId == 0)
     {
         Response.Redirect("Calendars.aspx");
     }
 }
Ejemplo n.º 2
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication();
     if (Request["new"] != null)
     {
         int blank = SERVGlobal.Service.CreateBlankLocation(SERVGlobal.User);
         Response.Redirect("ViewLocation.aspx?locationId=" + blank + "&message=Make sure the location you intend on adding does not already exist!");
     }
 }
Ejemplo n.º 3
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication();
     if (Request["new"] != null)
     {
         int blank = SERVGlobal.Service.CreateBlankMember(SERVGlobal.User);
         Response.Redirect("ViewMember.aspx?memberId=" + blank);
     }
 }
Ejemplo n.º 4
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication();
     if (IsAdding())
     {
         SERVGlobal.AssertAuthentication((int)SERVDataContract.UserLevel.Controller, "Sorry, only controllers and above have access to contribute to the controller log.");
         Model = new MilkRunEditViewModel {
             Controller = MemberName()
         };
         return;
     }
     Model = new MilkLogBLL(new MilkRunMapper()).GetRunLogForEdit(Request["RunLogID"]);
 }
Ejemplo n.º 5
0
 protected override void OnLoad(EventArgs e)
 {
     if (Request["Delete"] != null)
     {
         SERVGlobal.AssertAuthentication((int)SERVDataContract.UserLevel.Admin, "Sorry, only administrators can delete from the controller log.");
         SERVGlobal.Service.DeleteRun(RunLogID);
         Response.Redirect("RecentRuns.aspx");
     }
     if (RunLogID < 0)
     {
         SERVGlobal.AssertAuthentication((int)SERVDataContract.UserLevel.Controller, "Sorry, only controllers and above have access to contribute to the controller log.");
     }
 }
Ejemplo n.º 6
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            List <Report>      reports = SERVBLLFactory.Factory.RunLogBLL().RunReports();
            ContentPlaceHolder contentPlaceholderContent = (ContentPlaceHolder)Master.FindControl("contentPlaceholder");

            contentPlaceholderContent.Controls.AddAt(contentPlaceholderContent.Controls.Count - 1, new Literal()
            {
                Text = "<div class=\"alert\">\n  <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>\n  " +
                       "<strong>Please Note:</strong> This data is cached for 2 minutes.  If you log or update a run, you may need to wait before you see it displayed here.</div>"
            });
            foreach (Report r in reports)
            {
                contentPlaceholderContent.Controls.AddAt(contentPlaceholderContent.Controls.Count - 1, new Literal()
                {
                    Text = "<div class=\"row\">"
                });
                contentPlaceholderContent.Controls.AddAt(contentPlaceholderContent.Controls.Count - 1, new Literal()
                {
                    Text = "<div class=\"span12\">"
                });
                contentPlaceholderContent.Controls.AddAt(contentPlaceholderContent.Controls.Count - 1, new Literal()
                {
                    Text = "<a id=\"" + r.Anchor + "\"></a>"
                });
                contentPlaceholderContent.Controls.AddAt(contentPlaceholderContent.Controls.Count - 1, new Literal()
                {
                    Text = "<h3>" + r.Heading + "</h3>"
                });
                contentPlaceholderContent.Controls.AddAt(contentPlaceholderContent.Controls.Count - 1, new Literal()
                {
                    Text = "<p>" + r.Description + "</p> "
                });
                DataGrid dg = new DataGrid();
                dg.CssClass   = "table table-striped table-bordered table-condensed";
                dg.DataSource = r.Results;
                dg.DataBind();
                contentPlaceholderContent.Controls.AddAt(contentPlaceholderContent.Controls.Count - 1, dg);
                contentPlaceholderContent.Controls.AddAt(contentPlaceholderContent.Controls.Count - 1, new Literal()
                {
                    Text = "</div>"
                });
                contentPlaceholderContent.Controls.AddAt(contentPlaceholderContent.Controls.Count - 1, new Literal()
                {
                    Text = "</div>"
                });
            }

            SERVGlobal.AssertAuthentication();
        }
Ejemplo n.º 7
0
        protected override void OnLoad(EventArgs e)
        {
            if (!IsPostBack)
            {
                for (var year = DateTime.Now.Year; year >= 2014; year--)
                {
                    RunYear.Items.Add(new ListItem(year.ToString(), year.ToString()));
                }
            }

            var selectedYear = RunYear.Items[RunYear.SelectedIndex].Value;

            SERVGlobal.AssertAuthentication();
            dgRecentRuns.DataSource = new RunLogBLL().Report_RunLog(selectedYear);
            dgRecentRuns.DataBind();
            if ((dgRecentRuns.DataSource as DataTable).Rows.Count == 0)
            {
                runMessage.Text = "No runs for selected year";
            }
            else
            {
                runMessage.Text = "";
            }
        }
Ejemplo n.º 8
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication();
 }
Ejemplo n.º 9
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication();
     dgRecentRuns.DataSource = SERVBLLFactory.Factory.RunLogBLL().Report_RunLog();
     dgRecentRuns.DataBind();
 }
Ejemplo n.º 10
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication((int)SERVDataContract.UserLevel.Admin, "Sorry, only admins can access this page.");
 }
Ejemplo n.º 11
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication((int)SERVDataContract.UserLevel.Controller, "Sorry, you don't have access to take control.");
     this.DefaultNumber = SERVGlobal.User.Member.MobileNumber.Replace(" ", "");
 }
Ejemplo n.º 12
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication();
     pushBulletPanel.Visible = SERVGlobal.PushBulletEnabled;
 }
Ejemplo n.º 13
0
 protected override void OnLoad(EventArgs e)
 {
     SERVGlobal.AssertAuthentication((int)SERVDataContract.UserLevel.Controller, "Sorry, you don't have access to the Bulk SMS tool.");
 }