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

50 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Foresight.Fleet.Services.User;
using IronIntel.Contractor;
using IronIntel.Contractor.Site.Maintenance;
public partial class Maintenance_MaintanceRecordsManagement : MaintanceRecordsBasePage
{
public string BeginDate = "";
public string EndDate = "";
public string AssetID = "";
public bool InDialog = false;
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)
{
bool license = SystemParams.HasLicense("PreventativeMaintenance");
bool mrlicense = SystemParams.HasLicense("MaintenanceRecord");
if (!license || !mrlicense)
RedirectToLoginPage();
bool permission = CheckRight(SystemParams.CompanyID, Feature.PREVENTATIVE_MAINTENANCE);
if (!permission)
RedirectToLoginPage();
AssetID = Request.Params["mid"] ?? "";
InDialog = Request.Params["InDialog"] == "1";
DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
BeginDate = userlocaldate.AddDays(-6).ToString("yyyy-MM-dd");
EndDate = userlocaldate.ToString("yyyy-MM-dd");
}
}
}
}