fleet-contractor/Site/JobSite/SchedulerManagement.aspx.cs
2024-03-26 15:56:31 +08:00

65 lines
2.0 KiB
C#

using Foresight.Fleet.Services.User;
using IronIntel.Contractor;
using IronIntel.Contractor.Site.JobSite;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class SchedulerManagement : JobSiteRequirementsBasePage
{
protected bool CanConfig = false;
protected string BeginDate = "";
protected string CurrentDate = "";
protected bool IsReadOnly = false;
protected void Page_Load(object sender, EventArgs e)
{
string methodName = Request.Form["MethodName"];
if (!string.IsNullOrEmpty(methodName))
{
ProcessRequest();
}
else if (!IsPostBack)
{
Title = PageTitle;
if (CheckLoginSession())
{
bool license = SystemParams.HasLicense("JobSites");
bool license1 = SystemParams.HasLicense("JobsiteDispatch");
if (!license || !license1)
RedirectToEntryPage();
bool permission = CheckRight(SystemParams.CompanyID, Feature.JOB_SITES_SCHEDULER);
if (!permission)
RedirectToLoginPage();
IsReadOnly = CheckReadonly(SystemParams.CompanyID, Feature.JOB_SITES_SCHEDULER);
}
}
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
BeginDate = userlocaldate.ToString("yyyy-MM-dd");
CurrentDate = userlocaldate.ToShortDateString();
}
protected override int FeatureID
{
get
{
return Foresight.Fleet.Services.User.Feature.JOB_SITES_SCHEDULER;
}
}
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;
}
}
}