add site
This commit is contained in:
57
Site/OTRConfig/ManageHarshDriving.aspx.cs
Normal file
57
Site/OTRConfig/ManageHarshDriving.aspx.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using IronIntel.Contractor;
|
||||
using IronIntel.Contractor.Site.OTRConfig;
|
||||
using IronIntel.Contractor.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class ManageHarshDriving : OTRConfigBasePage
|
||||
{
|
||||
public string BeginDate = "";
|
||||
public string EndDate = "";
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!CheckLoginSession())
|
||||
{
|
||||
RedirectToLoginPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
string methodName = Request.Form["MethodName"];
|
||||
if (!string.IsNullOrEmpty(methodName))
|
||||
{
|
||||
ProcessRequest(methodName);
|
||||
}
|
||||
else if (!IsPostBack)
|
||||
{
|
||||
// todo nothing
|
||||
}
|
||||
}
|
||||
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
|
||||
BeginDate = userlocaldate.AddDays(-6).ToShortDateString();
|
||||
EndDate = userlocaldate.ToShortDateString();
|
||||
}
|
||||
protected override bool AllowCurrentLoginSessionEnter()
|
||||
{
|
||||
var f = base.AllowCurrentLoginSessionEnter();
|
||||
if (!f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool license = SystemParams.HasLicense("OTRConfig");
|
||||
bool permission = CheckRight(SystemParams.CompanyID, Foresight.Fleet.Services.User.Feature.HARSH_DRIVING);
|
||||
|
||||
return license && permission;
|
||||
}
|
||||
protected override bool ThrowIfNotAllowed
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user