@using EnVisage.Code @using EnVisage.Models @model ExpenditureCategoryModel @{ ViewBag.Title = Model.Id != Guid.Empty ? "Edit " + Model.Name : "Add New Expenditure Category"; var expenditures = ViewBag.Expenditures as IEnumerable; } @section scripts { }
@using (Html.BeginForm()) { @Html.AntiForgeryToken() if (Model.Id != Guid.Empty) { @Html.HiddenFor(t => t.ExpenditureId) @Html.HiddenFor(t => t.UseType) @Html.HiddenFor(t => t.Type) @Html.HiddenFor(t => t.ResourceCount) }
@Html.ValidationSummary(true) @Html.HiddenFor(model => model.Id)
@Html.LabelFor(model => model.ExpenditureId, "Expenditure", new { @class = "control-label col-sm-2 disabled" })
@(Model.Id == Guid.Empty ? Html.DropDownListFor(model => model.ExpenditureId, expenditures, new {@class = "form-control"}) : Html.DropDownListFor(model => model.ExpenditureId, expenditures, new {@class = "form-control disabled", disabled = "disabled"})) @Html.ValidationMessageFor(model => model.ExpenditureId)
@Html.LabelFor(model => model.Name, new { @class = "col-sm-2 control-label" })
@Html.TextBoxFor(model => model.Name, new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.Name)
@Html.LabelFor(model => model.GLId, "GL Account Name", new { @class = "control-label col-sm-2" })
@Html.DropDownListFor(model => model.GLId, Utils.GetGLAccounts(), new { @class = "form-control disabled" }) @Html.ValidationMessageFor(model => model.GLId)
@Html.LabelFor(model => model.UOMId, new { @class = "control-label col-sm-2" })
@Html.DropDownListFor(model => model.UOMId, Utils.GetUnitsOfMeasure(), new { @class = "form-control disabled" }) @Html.ValidationMessageFor(model => model.UOMId)
@Html.LabelFor(model => model.CreditId, new { @class = "control-label col-sm-2" })
@Html.DropDownListFor(model => model.CreditId, Utils.GetCreditDepartments(), new { @class = "form-control disabled" }) @Html.ValidationMessageFor(model => model.CreditId)
@Html.LabelFor(model => model.Type, "Category Type", new { @class = "control-label col-sm-2" })
@(Model.Id == Guid.Empty ? Html.DropDownListFor(model => model.Type, Utils.GetCategoryTypes(), new {@class = "form-control disabled", onchange = "categoryChanged()"}) : Html.DropDownListFor(model => model.Type, Utils.GetCategoryTypes(), new {@class = "form-control disabled", onchange = "categoryChanged()", disabled = "disabled"})) @Html.ValidationMessageFor(model => model.Type)
@Html.LabelFor(model => model.AllowResourceAssignment, "Allow Resource assignments", new { @class = "control-label col-sm-2" })
@{ var isChecked = (Model.AllowResourceAssignment); var checkedStr = ""; if (isChecked || Model.Id == Guid.Empty) { checkedStr = "checked"; } @(Model.ResourceCount > 0 ? Html.CheckBoxFor(m => m.AllowResourceAssignment, new {@class = "control-label", @checked = checkedStr, disabled = "disabled"}) : Html.CheckBoxFor(m => m.AllowResourceAssignment, new {@checked = checkedStr})) }
@Html.LabelFor(model => model.UseType, "Usage", new { @class = "control-label col-sm-2" })
@(Model.Id == Guid.Empty ? Html.DropDownListFor(model => model.UseType, Utils.GetUseTypes(), new {@class = "form-control", onchange = "usageChanged()"}) : Html.DropDownListFor(model => model.UseType, Utils.GetUseTypes(), new {@class = "form-control", disabled = "disabled"})) @Html.ValidationMessageFor(model => model.UseType)
@*
@Html.LabelFor(model => model.CGEFX, "CGEFX", new { @class = "control-label col-sm-2" })
@Html.DropDownListFor(model => model.CGEFX, Utils.GetCGEFX(), new { @class = "form-control disabled" }) @Html.ValidationMessageFor(model => model.CGEFX)
*@
@Html.LabelFor(model => model.SystemAttributeOne, "System Attribute One", new { @class = "control-label col-sm-2" })
@Html.DropDownListFor(model => model.SystemAttributeOne, Utils.GetSystemAttributeOne(), new { @class = "form-control disabled" }) @Html.ValidationMessageFor(model => model.SystemAttributeOne)
@Html.LabelFor(model => model.WksSubjectToFee, new { @class = "control-label col-md-2" })
@Html.TextBoxFor(model => model.WksSubjectToFee) @Html.ValidationMessageFor(model => model.WksSubjectToFee)
}
@{ Html.RenderPartial("_calculatesContainer", Model.CalculatesCategories);}
@{ Html.RenderPartial("_feesContainer", Model.Fees);}
@{ Html.RenderPartial("_ratesContainer", Model.Rates);}