123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- @model EMIS.ViewModel.DQPSystem.SOCDetailView
- @using EMIS.Web.Controls;
- @using Bowin.Web.Controls.Mvc;
- @using EMIS.ViewModel;
- @{
- ViewBag.Title = "Edit";
- ComboGridOptions cgopFacultymajor = new ComboGridOptions
- {
- TextField = "Name",
- ValueField = "FacultymajorID",
- Name = "FacultymajorComboGrid",
- ID = "FacultymajorComboGrid",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- new BoundFieldColumn { FieldName="Code", HeaderText="院系专业编号", Align=AlignStyle.Center },
- new BoundFieldColumn { FieldName="Name", HeaderText="院系专业名称", Align=AlignStyle.Center }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Facultymajor/List"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false,
- IsShowHeader = false
- }
- };
- ComboGridOptions cgopCourse = new ComboGridOptions
- {
- TextField = "CourseName",
- ValueField = "CoursematerialID",
- Name = "CoursematerialIDDropdownGridBo",
- ID = "CoursematerialIDDropdownGridBo",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- //new LinkButtonColumn { FieldName="CourseCode", HeaderText="课程代码", Width=0.1, Align=AlignStyle.Center },
- new BoundFieldColumn { FieldName="CourseName", HeaderText="课程名称", Width=0.3, Align=AlignStyle.Center }
- },
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Coursematerial/ListForDropdown"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false
- }
- };
- //开课教研室
- ComboGridOptions cgopDepartment = new ComboGridOptions
- {
- ID = "DepartmentDropdown",
- Name = "DepartmentDropdown",
- TextField = "Name",
- ValueField = "DepartmentID",
- GridOptions = new DataGridOptions
- {
- Columns = new List<DataGridColumn>()
- {
- //new LinkButtonColumn { FieldName="No", HeaderText="教研室代码", Align=AlignStyle.Center, Width=0.1 },
- new BoundFieldColumn { FieldName="Name", HeaderText="教研室名称", Align=AlignStyle.Center, Width=0.2 }
- },
- //IsAutoLoad = false,
- IsCheckOnSelect = true,
- DataSourceUrl = Url.Content("~/Department/List"),
- IsPagination = true,
- IsShowRowNumbers = true,
- IsSingleSelect = false,
- }
- };
- }
- @section scripts{
- <script type = "text/javascript">
- $(function () {
- windowID = $.SystemGeneral.getUrlParam("WindowID");
- mnu = $.SystemGeneral.getUrlParam("MNU");
- var detail = top.$("#" + windowID).data("inputData");
- $("#Name").val(detail.Name);
- $("#Credit").val(detail.Credit);
- $("#Weight").val(detail.Weight);
- if(detail.IsGroupin == true){
- //$("#IsGroupin").checked = true;
- $("#IsGroupin").prop("checked",true);
- }
- $("#IsGroupin").val(detail.IsGroupin);
- $("#Description").val(detail.Description);
- var dateTimeTest = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1]))$/;
- var start;
- var end;
- if(dateTimeTest.test(detail.StartTime))
- {
- start = detail.StartTime;
- }
- else{
- start = detail.StartTime != null ? detail.StartTime.toDateString("yyyy-MM-dd") : "";
- }
- if(dateTimeTest.test(detail.StartTime))
- {
- end = detail.EndTime;
- }
- else{
- end = detail.EndTime != null ? detail.EndTime.toDateString("yyyy-MM-dd") : "";
- }
- $("#StartTime").val(start);
- $("#EndTime").val(end);
- });
- function SOCDetail_Save() {
- //学分非负数
- var CreditTest = /^\d+(\.{0,1}\d+){0,1}$/;
- //权重0-100
- var WeightTest = /^(\d{1,2}(\.\d{0,})?|100)$/;
- var SOCDetail = new Object();
- SOCDetail.SOCDetailID = "@Model.SOCDetailID";
- SOCDetail.Name = $("#Name").val();
- SOCDetail.Credit = $("#Credit").val();
- SOCDetail.Weight = $("#Weight").val();
- SOCDetail.Description = $("#Description").val();
- SOCDetail.IsGroup = $("#IsGroupin").is(":checked");
- SOCDetail.IsGroupin = $("#IsGroupin").is(":checked");
- SOCDetail.StartTime = $("#StartTime").val();
- SOCDetail.EndTime = $("#EndTime").val();
- if(SOCDetail.Credit == "" || SOCDetail.Credit == null)
- {
- $.messager.alert("系统信息", "学分不能为空。");
- return;
- }
- else if(!CreditTest.test(SOCDetail.Credit))
- {
- $.messager.alert("系统信息", "学分只能是非负数字。");
- return;
- }
- if(SOCDetail.Weight == "" || SOCDetail.Weight == null)
- {
- $.messager.alert("系统信息", "权重不能为空。");
- return;
- }
- else if(!WeightTest.test(SOCDetail.Weight))
- {
- $.messager.alert("系统信息", "权重只能是0-100之间的数字。");
- return;
- }
- top.$("#@(Request["WindowID"])").data("resultData", SOCDetail);
- top.$("#@(Request["WindowID"])").dialog("close");
- };
- </script>
- }
- <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="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Detail-Edit")</div>
- </div>
- <div class="search_list">
- @Html.Hidden("hid_ActionsType")
- @Html.HiddenFor(x => x.SOCDetailID)
- <table cellpadding="0" cellspacing="0" id="departmenttable">
- <tr>
- <td>
- @Html.LabelFor(x => x.Name):
- </td>
- <td>
- @Html.TextBoxFor(x => x.Name)
- </td>
- <td>
- @Html.LabelFor(x => x.Credit):
- </td>
- <td>
- @Html.TextBoxFor(x => x.Credit)
- </td>
- </tr>
- <tr>
- <td>
- @Html.LabelFor(x => x.Weight):
- </td>
- <td>
- @Html.TextBoxFor(x => x.Weight)
- </td>
- <td>
- @Html.LabelFor(x => x.IsGroup):
- </td>
- <td>
- @Html.CheckBoxFor(x => x.IsGroupin)
- </td>
- </tr>
- <tr>
- <td>
- @Html.LabelFor(x => x.Description):
- </td>
- <td colspan = "3">
- @Html.TextAreaFor(x => x.Description, 3, 70, null)
- </td>
- </tr>
- <tr>
- <td>
- @Html.LabelFor(x => x.StartTime):
- </td>
- <td>
- @Html.TextBoxFor(x => x.StartTime, new TextBoxOptions { TextBoxType = TextBoxType.Date, ID = "StartTime", Name = "StartTime" })
- </td>
- <td>
- @Html.LabelFor(x => x.EndTime):
- </td>
- <td>
- @Html.TextBoxFor(x => x.EndTime, new TextBoxOptions { TextBoxType = TextBoxType.Date, ID = "EndTime", Name = "EndTime", })
- </td>
- </tr>
-
- </table>
- </div>
- }
- </div>
|