<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Views/Shared/SleisLayout.Master" %>
<% bool showRegulatoryProgram = (ViewData[Constants.EnableRegulatoryProgramIn].ToString() == Constants.EnableRegulatoryProgramInEmissionUnit); bool showControlApproach = (ViewData[Constants.UseEmissionUnitControlApproach].ToString() == "true"); %> <% if (Model.Report != null && Request["reportId"] != "0") { %> <% Html.RenderPartial("ReportStatus", Model.Report.Status); %>

<%:Model.Report.Number%> Emissions Report

<%} else { %>

Master Facility

<% } %>

Emission Units

<% Html.ValidationSummary("Please correct the errors and try again"); %> <% using (Html.BeginForm()) { %>
<%--Identifier field--%>
> <%if (Model.Item.Id == 0) { %> <%:Html.TextBoxFor(x => x.Item.Identifier, new { @class = "text-input small-full-input"})%> <%:Html.ValidationMessageFor(x=>x.Item.Identifier) %> <%} else { %> <%:Model.Item.Identifier %> <%:Html.HiddenFor(x=>x.Item.Identifier) %> <%} %>
<%-- type field--%>
> <%:Html.DropDownListFor(x => x.Item.TypeCode, LookupUtility.Get(Model.Item.TypeCode, Model.Report!=null ? Model.Report.Number : 0) .Select(m => new SelectListItem { Selected = m.Code == Model.Item.TypeCode, Value = m.Code, Text = string.Format("{0} - {1}", m.Code, m.Value) }),"", new { @class = "text-input small-full-input" })%> <%:Html.ValidationMessageFor(x => x.Item.TypeCode)%>
<%-- Description--%>
> <%:Html.TextBoxFor(x => x.Item.Description, new { @class = "text-input small-full-input" })%> <%:Html.ValidationMessageFor(x => x.Item.Description)%>
> <%:Html.DropDownListFor(x => x.Item.StatusCode, LookupUtility.Get(Model.Item.StatusCode, Model.Report!=null ? Model.Report.Number:0) .Select(m => new SelectListItem { Selected = m.Code == Model.Item.StatusCode, Value = m.Code, Text = string.Format("{0} - {1}", m.Code, m.Value) }), new { @class = "text-input small-full-input" })%>
> <%:Html.EditorFor(x => x.Item.StatusEffectiveDate, "DateTime")%> <%: Html.ValidationMessageFor(x => x.Item.StatusEffectiveDate)%>
<%-- operation start date--%>
> <%:Html.EditorFor(x => x.Item.OperationDate, "DateTime")%> <%: Html.ValidationMessageFor(x => x.Item.OperationDate)%>
<%-- Add design capacity--%>
>
<%:Html.TextBoxFor(x => x.Item.DesignCapacity, new { @class = "text-input full-input emission-unit-design-capacity" })%> <%:Html.ValidationMessageFor(x => x.Item.DesignCapacity) %>
<%:Html.DropDownListFor(x=>x.Item.UomCode, LookupUtility.Get(Model.Item.UomCode,Model.Report!=null ? Model.Report.Number:0) .Select(m => new SelectListItem { Selected = m.Code == Model.Item.UomCode, Value = m.Code, Text = string.Format("{0} - {1}", m.Code, m.Value) }),"", new { @class = "text-input full-input" })%> <%:Html.ValidationMessageFor(x => x.Item.UomCode)%>
<%--related unit process--%>
> <%if (Model.Item.RelatedUnitProcesses != null) { %> <% for (int i = 0; Model.Item.RelatedUnitProcesses.Count > i; ++i) { UnitProcess up = Model.Item.RelatedUnitProcesses[i]; %> <%: Html.ActionLink(up.Identifier + " - " + up.Description, "Edit", "UnitProcess", new { id = up.Id, reportId = Model.ReportId, facilityId = Model.FacilityId }, null)%>
<%:Html.HiddenFor(m => m.Item.RelatedUnitProcesses[i].Id)%> <%:Html.HiddenFor(m => m.Item.RelatedUnitProcesses[i].UniqueIdentifier)%> <%: Html.HiddenFor(x => x.Item.RelatedUnitProcesses[i].Identifier)%> <%: Html.HiddenFor(x => x.Item.RelatedUnitProcesses[i].Description)%> <% } } %>
<%-- Comments --%> <%if (Model.Item is PublicEmissionUnit || (Model.Item is AgencyEmissionUnit && !((AgencyEmissionUnit)Model.Item).IsMaster)) { %>
> <%:Html.TextAreaFor(x => x.Item.Comment, new { @class = "text-input small-full-input growComments"})%> <%:Html.ValidationMessageFor(x => x.Item.Comment)%>
<% } %>
<% if (showRegulatoryProgram) { %>
> <%:Html.EditorFor(x => x.Item, "EmissionUnitRegulatoryProgram")%>
<% } %> <% if (showControlApproach) { %>
> <%:Html.CheckBoxFor(x => x.Item.ControlApproach.NotControlled, new { @class = "toggleControlInfo" })%> <%:Html.ValidationMessageFor(x => x.Item.ControlApproach.NotControlled)%>
> <%:Html.TextBoxFor(x => x.Item.ControlApproach.Description, new { @class = "text-input small-full-input" })%> <%:Html.ValidationMessageFor(x => x.Item.ControlApproach.Description)%>
> <%:Html.TextBoxFor(x => x.Item.ControlApproach.Efficency, new { @class = "text-input short-input emission-unit-approach-efficiency controlInfo" })%>% <%:Html.ValidationMessageFor(x => x.Item.ControlApproach.Efficency)%>
<%:Html.HiddenFor(x => x.Item.ControlApproach.Id)%> <%:Html.HiddenFor(x => ((EmissionUnitControlApproach)x.Item.ControlApproach).EmissionUnitId)%>
class="controlInfo"> <%:Html.EditorFor(x => x.Item, "EmissionUnitControlApproach")%>
<% } %>
<%= Html.EditorFor(x => x, "FacilityCustomField") %>
<% if (Model.Item is AgencyEmissionUnit && ((AgencyEmissionUnit)Model.Item).IsMaster) { %> <%/* %>
<%=Html.EditorFor(m => ((AgencyEmissionUnit)m.Item).Identifiers, "Identifiers", "Item", new { Fields = Model.Fields, EditorContext = "EmissionUnit", IdentifierType = typeof(AgencyEmissionUnitIdentifier).FullName })%>
<%*/ %>
<%=Html.EditorFor(m => ((AgencyEmissionUnit)m.Item).MasterRecordComments, "Comments", "Item", new { Comment = Model.Item.Comment, CommentType = typeof(AgencyEmissionUnitComment).FullName })%>
<%} %> <%:Html.HiddenFor(x=>x.FacilityId) %> <%:Html.HiddenFor(x=>x.Item.Id) %> <%:Html.HiddenFor(x=>x.Item.FacilityId) %> <%:Html.HiddenFor(x=>x.Report.Status) %> <%:Html.HiddenFor(x=>x.Report.Number) %> <%:Html.HiddenFor(x=>x.Report.FacilityId) %> <%:Html.HiddenFor(x=>x.Report.Id) %> <%:Html.HiddenFor(x=>x.ReportId) %> <% if (Model.Item is PublicEmissionUnit) { %> <%:Html.HiddenFor(x => ((PublicEmissionUnit)x.Item).IsAdd)%> <%} %>
<% if((Model.Item is PublicEmissionUnit && ((PublicEmissionUnit)Model.Item).IsAdd == 1) || SessionUtility.CurrentUser.IsAgencyUser()) { %> <% if (Model.Item.RelatedUnitProcesses==null || Model.Item.RelatedUnitProcesses.Count() == 0) { %> <%: Html.ActionLink("Delete", "Delete", "EmissionUnit", new { id = Model.Item.Id, reportId = Model.ReportId, facilityId = Model.FacilityId }, new { @class = "deleteButton" })%> <% } else { %> Delete <% } %> <%} %> <%: Html.ActionLink("Cancel", "List", "EmissionUnit", new {reportId=Model.ReportId,facilityId=Model.FacilityId }, new { @class = "cancelButton" })%>
<%} //begin form %>
<%Html.RenderPartial("FacilitySide"); %>

Current Record

<%= ViewUtility.LastEditedBy(Model.Item) %>

<%: Model.Item.Identifier %>

<%:Model.Item.Description %>