123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- @model EMIS.ViewModel.SchedulingManage.SchedulingSettings.CollegeClassroomView
- @using EMIS.Web.Controls;
- @using Bowin.Web.Controls.Mvc;
- @{
- ViewBag.Title = "Edit";
- var isEnable = Request["type"] == "detail" ? false : true;
- var isDisable = Request["type"] == "detail" ? false : (Request["type"] == "edit" ? false : true);
-
- //院系所
- ComboGridOptions cgopCollege = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "CollegeID",
- IsEnabled = isDisable,
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new LinkButtonColumn { FieldName="No", HeaderText=@EMIS.Utility.RSL.Get("CollegeCode"), Align=AlignStyle.Center, Width=0.1 },
- new BoundFieldColumn { FieldName="Name", HeaderText=@EMIS.Utility.RSL.Get("CollegeName"), Align=AlignStyle.Center, Width=0.3 },
- new BoundFieldColumn { FieldName="CampusName", HeaderText=@EMIS.Utility.RSL.Get("CampusName"), Align=AlignStyle.Center, Width=0.3 }
- },
- PageSize = 5,
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/College/ListOnlyCollege"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- }
- };
- //教室信息
- ComboGridOptions cgopClassroom = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "ClassroomID",
- IsEnabled = isEnable,
- OnSelect = "queryClassroom",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new LinkButtonColumn { FieldName="Code", HeaderText="教室编号", Align=AlignStyle.Center, Width=0.12, OverflowLength=6 },
- new BoundFieldColumn { FieldName="Name", HeaderText="教室名称", Align=AlignStyle.Center, Width=0.2, OverflowLength=8 },
- new BoundFieldColumn { FieldName="ClassroomTypeName", HeaderText="教室类型", Align=AlignStyle.Center, Width=0.15, OverflowLength=6 },
- new BoundFieldColumn { FieldName="IsAvailableName", HeaderText="是否可用", Align=AlignStyle.Center, Width=0.1, CustomFormatFun="SetRedColumn" }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Classroom/List"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false,
- }
- };
- //建筑信息
- ComboGridOptions cgopBuildings = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "BuildingsInfoID",
- IsEnabled = false,
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new LinkButtonColumn { FieldName="Code", HeaderText="建筑代码", Align=AlignStyle.Center, Width=0.1 },
- new BoundFieldColumn { FieldName="Name", HeaderText="建筑名称", Align=AlignStyle.Center, Width=0.2 }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Buildings/List"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- }
- };
- }
- <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
- @using (Ajax.BeginForm(new AjaxOptions
- {
- OnSuccess = "EMISFunction.FormSuccess",
- OnBegin = "EMISFunction.FormSubmit",
- OnComplete = "EMISFunction.FormComplete" }))
- {
- <div class="p_title">
- <div style="float: left; margin-left: 10px; line-height: 30px; font-size: 12px;"></div>
- <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">
- @if (Request["type"] != "detail")
- {
- @Html.ContextMenuBar("Edit")
- }
- </div>
- </div>
- <div class="search_list">
- @Html.HiddenFor(x => x.CollegeClassroomID)
- <table cellpadding="0" cellspacing="0" id="collegePrioritytable">
- <tr>
- <td style="color: red;">
- @Html.LabelFor(x => x.CollegeName):
- </td>
- <td>
- @Html.ComboGridFor(x => x.CollegeID, cgopCollege)
- </td>
- <td style="color: red;">
- @Html.LabelFor(x => x.ClassroomName):
- </td>
- <td>
- @Html.ComboGridFor(x => x.ClassroomID, cgopClassroom)
- </td>
- </tr>
- <tr>
- <td>
- @Html.LabelFor(x => x.ClassroomCode):
- </td>
- <td>
- @Html.TextBoxFor(x => x.ClassroomCode, new TextBoxOptions() { IsEnabled = false })
- </td>
- <td>
- @Html.LabelFor(x => x.BuildingsInfoID):
- </td>
- <td>
- @Html.ComboGridFor(x => x.BuildingsInfoID, cgopBuildings)
- </td>
- </tr>
- <tr>
- <td style="color:red;">
- @Html.LabelFor(x => x.ClassroomTypeIDList):
- </td>
- <td>
- @Html.TextBoxFor(x => x.ClassroomTypeName, new TextBoxOptions() { IsEnabled = false })
- </td>
- <td>
- @Html.LabelFor(x => x.RoomUseID):
- </td>
- <td>
- @Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_RoomUse, (x => x.RoomUseID), new DropdownListOptions() { IsEnabled = false })
- </td>
- </tr>
- <tr>
- <td>
- @Html.LabelFor(x => x.Totalseating):
- </td>
- <td>
- @Html.TextBoxFor(x => x.Totalseating, new TextBoxOptions() { IsEnabled = false })
- </td>
- <td>
- @Html.LabelFor(x => x.Effectiveseating):
- </td>
- <td>
- @Html.TextBoxFor(x => x.Effectiveseating, new TextBoxOptions() { IsEnabled = false })
- </td>
- </tr>
- <tr>
- <td style="color:red;">
- @Html.LabelFor(x => x.IsConcurrentUse):
- </td>
- <td>
- @Html.TextBoxFor(x => x.IsConcurrentUseName, new TextBoxOptions() { IsEnabled = false })
- </td>
- <td style="color:red;">
- @Html.LabelFor(x => x.IsReserve):
- </td>
- <td>
- @Html.TextBoxFor(x => x.IsReserveName, new TextBoxOptions() { IsEnabled = false })
- </td>
- </tr>
- <tr>
- <td style="color:red;">
- @Html.LabelFor(x => x.IsAvailable):
- </td>
- <td colspan="3">
- @Html.TextBoxFor(x => x.IsAvailableName, new TextBoxOptions() { IsEnabled = false })
- </td>
- </tr>
- </table>
- </div>
- }
- </div>
- @section scripts{
- <script type="text/javascript">
- //设置列颜色为红色
- function SetRedColumn(index, row, value) {
- return " <span style=\"color: red;\">" + value + "</span>";
- }
- //教室信息
- function queryClassroom(data) {
- var classroomID = $("#ClassroomID").combogridX("getValue");
- if (classroomID == "" || classroomID == "-1" || classroomID == null) {
- $("#ClassroomCode").val("");
- $("#BuildingsInfoID").combogridX("setValue", "-1");
- $("#ClassroomTypeName").val("");
- $("#RoomUseID").combobox("setValue", "-1");
- $("#Totalseating").val("");
- $("#Effectiveseating").val("");
- $("#IsConcurrentUseName").val("");
- $("#IsReserveName").val("");
- $("#IsAvailableName").val("");
- }
- else {
- $("#ClassroomCode").val(data.Code);
- $("#BuildingsInfoID").combogridX("setValue", data.BuildingsInfoID);
- $("#ClassroomTypeName").val(data.ClassroomTypeName);
- $("#RoomUseID").combobox("setValue", data.RoomUseID);
- $("#Totalseating").val(data.Totalseating);
- $("#Effectiveseating").val(data.Effectiveseating);
- $("#IsConcurrentUseName").val(data.IsConcurrentUseName);
- $("#IsReserveName").val(data.IsReserveName);
- $("#IsAvailableName").val(data.IsAvailableName);
- }
- }
- //保存
- function CollegeClassroom_Save() {
- $(document.forms[0]).submit();
- }
- </script>
- }
|