<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Views/Shared/SleisLayout.Master" %> <%-- Edit --%> <% SelectedFacilityView selectedFac = ViewUtility.GetSelectedFacility(); %> <% bool isAdd = ViewContext.RouteData.Values["action"].ToString().ToLower() == "add"; %>

User Profile

<% Html.ValidationSummary("Please correct the errors and try again"); %> <% using (Html.BeginForm()) { %>

<%: Html.Label("Email Address:") %> <% if (!isAdd) { %> <%: Model.User.Email%> <%: Html.HiddenFor(x => x.User.Email)%> <%} else { %> <%: Html.TextBoxFor(m => m.User.Email, new { @class = "text-input wide-input", @maxlength = "50" })%> <%:Html.ValidationMessageFor(m=>m.User.Email) %> <%} %> <%: Html.HiddenFor(x => x.User.Id) %>

<%= Html.EditorFor(m=>m.User, "UserState") %> <%= Html.EditorFor(m=>m.User, "UserTop") %> <%= Html.EditorFor(m=>m.User, "UserContactPoints") %> <%if ((selectedFac != null && selectedFac.Id > 0) || Model.User.Type == SleisUserTypeType.Agency) { %>

<%if (Model.User.Type == SleisUserTypeType.Facility) { %> <%: Html.Label("Facility Roles:")%> r == AppUserRoleType.FacilityViewer)? "checked='checked'" : ""%> <%=(Model.MainRoles==null || Model.MainRoles.Count==0) ? "checked='checked'":""%>/>
r == AppUserRoleType.FacilityEditor)? "checked='checked'" : ""%> />
class="input-text submitterRole" <%=Model.SubRoles.Exists(r => r == AppUserRoleType.FacilitySubmitter)? "checked='checked'" : ""%> />
r == AppUserRoleType.FacilityAdmin)? "checked='checked'" : ""%> /> <%} else { %> <%: Html.Label("Agency Roles:")%> r == AppUserRoleType.AgencyViewer)? "checked='checked'" : ""%> <%=(Model.MainRoles==null || Model.MainRoles.Count==0) ? "checked='checked'":""%>/>
r == AppUserRoleType.AgencyEditor)? "checked='checked'" : ""%> />
r == AppUserRoleType.AgencySubmitter)? "checked='checked'" : ""%> />
r == AppUserRoleType.AgencyAdmin)? "checked='checked'" : ""%> />
r == AppUserRoleType.AgencyAcceptor)? "checked='checked'" : ""%> /> <%} %>

<%} %> <% if (selectedFac.Facility == null && SessionUtility.CurrentUser.IsAgencyUser() && SessionUtility.CurrentUser.IsAppAdmin && Model.User.Type == SleisUserTypeType.Facility) { %>

<%:ViewData[Constants.UserSubscriberAgreementMessage]%>

<%:Html.CheckBoxFor(m => m.User.IsElectronicSigVerified, new { @class = "cbIsElectronicSigVerified" })%>

<% } %> <% else { %> <%= Html.HiddenFor(m => m.User.IsElectronicSigVerified) %> <%} %>

<% if (selectedFac !=null && selectedFac.IsFacilityAdmin && Model.User.Id != ViewUtility.GetCurrentUser().User.Id) { %> <%: Html.ActionLink("Delete", "DeleteUserRole", "User", new { id = Model.User.Id, facilityId = selectedFac.Facility.Id }, new { @class = "deleteButton", Title = "Are you sure you want to delete this user from the facility?" })%> <%} %> <%if (Request.QueryString["facilityId"]!=null) //check if facilityId is present. if it is, we are in the context of a facility and need to load facility user list. {%> <%: Html.ActionLink("Cancel", "FacilityUser", "Facility", new { id = selectedFac.Facility.Id }, new { @class = "cancelButton" })%> <%} else { %> <%: Html.ActionLink("Cancel", "List", "User", new { type = Model.User.Type.ToString().ToLower() }, new { @class = "cancelButton" })%> <%} %>

<%} %>
<%if (ViewUtility.GetSelectedFacility() != null && ViewUtility.GetSelectedFacility().Id > 0) { %> <% Html.RenderPartial("FacilitySide"); %> <%} %>