public bool LogRun(int runLogID, string callDateTime, int callFromLocationId, string collectDateTime, int collectionLocationId, int controllerMemberId, string deliverDateTime, int deliverToLocationId, string dutyDate, int finalDestinationLocationId, int originLocationId, int riderMemberId, int urgency, int vehicleTypeId, string productIdCsv, string homeSafeDateTime, string notes, string callerNumber, string callerExt) { Authenticate(); // Fix dates and times DateTime _dutyDate = DateTime.Parse(dutyDate); DateTime _callDateTime = DateTime.Parse(callDateTime); DateTime _collectDateTime = DateTime.MinValue; DateTime _deliverDateTime = DateTime.MinValue; DateTime?_homeSafeDateTime = null; if (riderMemberId > 0) { _collectDateTime = DateTime.Parse(collectDateTime); _deliverDateTime = DateTime.Parse(deliverDateTime); if (!string.IsNullOrEmpty(homeSafeDateTime.Replace(":", "").Trim())) { _homeSafeDateTime = DateTime.Parse(homeSafeDateTime); } } // Log it bool res = new RunLogBLL().CreateRunLog(_callDateTime, callFromLocationId, _collectDateTime, collectionLocationId, controllerMemberId, CurrentUser().UserID, _deliverDateTime, deliverToLocationId, _dutyDate, finalDestinationLocationId, originLocationId, riderMemberId, urgency, vehicleTypeId, productIdCsv, _homeSafeDateTime, notes, callerNumber, callerExt); // If we were updating a record, delete the old one if (runLogID > 0) { new RunLogBLL().DeleteRun(runLogID); } return(res); }
private bool IsMilkRun() { if (RunLogID < 0) { return(false); } var runLogBll = new RunLogBLL(); return(runLogBll.IsMilkRun(RunLogID)); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); List <Report> reports = new 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\">×</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(); }