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 DispatchRequests : JobSiteRequirementsBasePage
{
    protected bool CanConfig = false;
    protected string LatestStartDate = "";
    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_DISPATCHREQUESTS);
                if (!permission)
                    RedirectToLoginPage();

                IsReadOnly = CheckReadonly(SystemParams.CompanyID, Feature.JOB_SITES_DISPATCHREQUESTS);
            }
        }
        DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
        LatestStartDate = userlocaldate.ToShortDateString();
    }

    protected override int FeatureID
    {
        get
        {
            return Foresight.Fleet.Services.User.Feature.JOB_SITES_DISPATCHREQUESTS;
        }
    }
}