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 AddRequirements : JobSiteRequirementsBasePage
{
    public string CurrentDate = "";
    protected bool IsRequestOnly = false;
    protected void Page_Load(object sender, EventArgs e)
    {
        string tp = Request.Params["tp"];
        if (string.Compare(tp, "ashx", true) == 0)
        {
            ProcessRequest();
        }
        else if (!IsPostBack)
        {
            Title = PageTitle;

            bool license = SystemParams.HasLicense("JobSites");
            bool license1 = SystemParams.HasLicense("JobsiteDispatch");
            if (!license || !license1)
                RedirectToEntryPage();

            bool permission = CheckRight(SystemParams.CompanyID, Feature.JOB_SITES_REQUIREMENTS, Permissions.RequestOnly);
            if (!permission)
                RedirectToLoginPage();

            bool ro = CheckReadonly(SystemParams.CompanyID, Feature.JOB_SITES_REQUIREMENTS);
            if (ro)
                RedirectToLoginPage();
            IsRequestOnly = CheckRequestonly(SystemParams.CompanyID);
        }
        DateTime userlocaldate = SystemParams.ConvertToUserTimeFromUtc(GetCurrentLoginSession().User, DateTime.UtcNow);
        CurrentDate = userlocaldate.ToShortDateString();
    }

}