add site
This commit is contained in:
75
Site/Maintenance/AddFuelRecord.aspx.cs
Normal file
75
Site/Maintenance/AddFuelRecord.aspx.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using Foresight.Fleet.Services.User;
|
||||
using IronIntel.Contractor;
|
||||
using IronIntel.Contractor.Site;
|
||||
using IronIntel.Contractor.Site.Maintenance;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class AddFuelRecord : FuelRecordBasePage
|
||||
{
|
||||
|
||||
public bool IsDealer = IronIntel.Contractor.SystemParams.IsDealer;
|
||||
|
||||
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)
|
||||
{
|
||||
this.Title = PageTitle;
|
||||
bool license = SystemParams.HasLicense("FuelRecords");
|
||||
if (!license)
|
||||
RedirectToLoginPage();
|
||||
|
||||
bool permission = CheckRight(SystemParams.CompanyID, Feature.FUEL_RECORDS);
|
||||
if (!permission)
|
||||
RedirectToLoginPage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool ThrowIfNotAllowed
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool AllowCurrentLoginSessionEnter()
|
||||
{
|
||||
var f = base.AllowCurrentLoginSessionEnter();
|
||||
if (!f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var user = GetCurrentUser();
|
||||
return user != null && user.UserType >= IronIntel.Contractor.Users.UserTypes.Common;
|
||||
}
|
||||
|
||||
public bool IsAdmin
|
||||
{
|
||||
get
|
||||
{
|
||||
var user = GetCurrentUser();
|
||||
if (user.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin || user.UserType == IronIntel.Contractor.Users.UserTypes.Admin)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user