67 lines
2.2 KiB
C#
67 lines
2.2 KiB
C#
using Foresight.Fleet.Services.User;
|
|
using IronIntel.Contractor;
|
|
using IronIntel.Contractor.Site;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
public partial class AddUser : UserManageBasePage
|
|
{
|
|
protected string IID;
|
|
public bool IsDealer = IronIntel.Contractor.SystemParams.IsDealer;
|
|
public bool EmailSubscribe = false;
|
|
public bool AllowSMSMessagesLisence = false;
|
|
public bool AllowSMSMessagesFeature = false;
|
|
protected string SystemLoginVerifyType = "";
|
|
|
|
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;
|
|
IID = GetCurrentLoginSession().User.UID;
|
|
EmailSubscribe = SystemParams.HasLicense("EmailSubscribe");
|
|
|
|
AllowSMSMessagesLisence = SystemParams.HasLicense("WorkOrder");
|
|
AllowSMSMessagesFeature = CheckRight(SystemParams.CompanyID, Feature.WORK_ORDER);
|
|
}
|
|
var LoginVerifyType = SystemParams.GetStringParam("LoginVerifyType");
|
|
string lang = GetLanguageCookie();
|
|
string text = GetLandLoginVerifyType(lang, LoginVerifyType);
|
|
SystemLoginVerifyType = SystemParams.GetTextByKey(lang, "P_UM_ORGANIZATIONSETTING", "Organization Setting") + " (" + text + ")";
|
|
}
|
|
}
|
|
|
|
private string GetLandLoginVerifyType(string lang, string LoginVerifyType)
|
|
{
|
|
string text = SystemParams.GetTextByKey(lang, "P_UM_NONE1", "None");
|
|
if ("Email".Equals(LoginVerifyType, StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
text = SystemParams.GetTextByKey(lang, "P_UM_EMAIL", "Email");
|
|
}
|
|
return text;
|
|
}
|
|
|
|
public bool IsSupperAdmin
|
|
{
|
|
get
|
|
{
|
|
var user = GetCurrentUser();
|
|
return user.UserType == IronIntel.Contractor.Users.UserTypes.SupperAdmin;
|
|
}
|
|
}
|
|
} |