Edit.cshtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. @using EMIS.Web.Controls;
  2. @model EMIS.ViewModel.Students.StudentsView
  3. @using Bowin.Web.Controls.Mvc;
  4. @{
  5. ViewBag.Title = "Edit";
  6. List<EMIS.ViewModel.Students.StudentChangeFeildView> ChangeFeilds = ViewBag.ChangeFeilds;
  7. List<string> TypeNames = ViewBag.TypeNames;
  8. ComboGridOptions cgopStudentcharge = new ComboGridOptions
  9. {
  10. TextField = "Name",
  11. ValueField = "ClassmajorID",
  12. //OnSelect = "QueryClassmajorComboGrid",
  13. GridOptions = new DataGridOptions
  14. {
  15. Columns = new List<DataGridColumn>()
  16. {
  17. new BoundFieldColumn { FieldName="No", HeaderText="班级编号", Align=AlignStyle.Center },
  18. new BoundFieldColumn { FieldName="Name", HeaderText="班级名称", Align=AlignStyle.Center },
  19. new BoundFieldColumn { FieldName="LearnSystem", HeaderText="学制", Align=AlignStyle.Center },
  20. new BoundFieldColumn { FieldName="yearID", HeaderText="学年", Align=AlignStyle.Center },
  21. new BoundFieldColumn { FieldName="EducationName", HeaderText=EMIS.Utility.RSL.Get("EducationID"), Align=AlignStyle.Center },
  22. new BoundFieldColumn { FieldName="LearningformName", HeaderText="学习形式", Align=AlignStyle.Center },
  23. new BoundFieldColumn { FieldName="SchoolyearCode", HeaderText="毕业学年学期", Align=AlignStyle.Center },
  24. },
  25. IsCheckOnSelect = true,
  26. DataSourceUrl = Url.Content("~/Classmajor/List"),
  27. IsPagination = true,
  28. IsShowRowNumbers = true,
  29. IsSingleSelect = false
  30. }
  31. };
  32. var controls = new Dictionary<string, KeyValuePair<MvcHtmlString, MvcHtmlString>>();
  33. controls.Add("LoginID", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.LoginID), Html.DisplayFor(x => x.LoginID)));
  34. controls.Add("UserName", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.UserName), Html.TextBoxFor(x => x.UserName)));
  35. //"<div><img src=" + Model.PhotoUrl + " width=120 height=160 /></div><div>" + Html.SingleUploaderFor(x => x.PhotoUrl).ToHtmlString() + "</div>"
  36. controls.Add("PhotoUrl", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.PhotoUrl), MvcHtmlString.Create("<div id=\"prvid\"><img src=" + Model.PhotoUrl + " width=120 height=160 /></div><div><input id=\"files\" name=\"PhotoUrl\" type=\"file\" onchange=\"previewImage(this, 'prvid')\" multiple=\"multiple\"/>")));
  37. controls.Add("Sex", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Sex), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Sex, (x => x.Sex))));
  38. controls.Add("CertificatesType", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.CertificatesType), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_CertificatesType, (x => x.CertificatesType))));
  39. controls.Add("IDNumber", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.IDNumber), @Html.TextBoxFor(x => x.IDNumber)));
  40. controls.Add("StudentCardNo", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.StudentCardNo), Html.TextBoxFor(x => x.StudentCardNo)));
  41. controls.Add("ClassMajorID", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.ClassMajorID), Html.ComboGridFor(x => x.ClassMajorID, cgopStudentcharge)));
  42. controls.Add("CultureModel", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.CultureModel), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_CULTUREMODEL, (x => x.CultureModel))));
  43. controls.Add("StudentType", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.StudentType), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_STUDENTTYPE, (x => x.StudentType))));
  44. controls.Add("StudentStatus", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.StudentStatus), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_STUDENTSTATUS, (x => x.StudentStatus))));
  45. controls.Add("InSchoolStatusID", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.InSchoolStatusID), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_InschoolStatus, (x => x.InSchoolStatusID))));
  46. controls.Add("PlanningGraduateDate", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.PlanningGraduateDate), Html.TextBoxFor(x => x.PlanningGraduateDate, new TextBoxOptions() { TextBoxType = TextBoxType.Date })));
  47. controls.Add("ExamineeNum", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.ExamineeNum), Html.TextBoxFor(x => x.ExamineeNum)));
  48. controls.Add("ExamineeType", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.ExamineeType), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_EXAMINEETYPE, (x => x.ExamineeType))));
  49. controls.Add("EntranceDate", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.EntranceDate), Html.TextBoxFor(x => x.EntranceDate, new TextBoxOptions() { TextBoxType = TextBoxType.Date })));
  50. controls.Add("EntranceWay", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.EntranceWay), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_EntranceWay, (x => x.EntranceWay))));
  51. controls.Add("EnteringSchoolYearID", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.EnteringSchoolYearID), Html.DropdownListFor(x => x.EnteringSchoolYearID, new DropdownListOptions { ItemSourceUrl = "~/SchoolYear/DropDown", TextField = "Text", ValueField = "Value", })));
  52. controls.Add("Placebirth", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Placebirth), Html.TextBoxFor(x => x.Placebirth)));
  53. controls.Add("Features", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Features), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Features, (x => x.Features))));
  54. controls.Add("Score", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Score), Html.TextBoxFor(x => x.Score)));
  55. controls.Add("Territorial", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Territorial), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Province, (x => x.Territorial))));
  56. controls.Add("Area", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Area), Html.TextBoxFor(x => x.Area)));
  57. controls.Add("UsedName", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.UsedName), Html.TextBoxFor(x => x.UsedName)));
  58. controls.Add("DirectorName", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.DirectorName), Html.TextBoxFor(x => x.DirectorName)));
  59. controls.Add("BirthDate", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.BirthDate), Html.TextBoxFor(x => x.BirthDate, new TextBoxOptions() { TextBoxType = TextBoxType.Date })));
  60. controls.Add("Country", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Country), Html.TextBoxFor(x => x.Country)));
  61. controls.Add("Politics", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Politics), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Politics, (x => x.Politics))));
  62. controls.Add("Nation", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Nation), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Nation, (x => x.Nation))));
  63. controls.Add("Place", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Place), Html.TextBoxFor(x => x.Place)));
  64. controls.Add("Healthy", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Healthy), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_HealthState, (x => x.Healthy))));
  65. controls.Add("BloodGroup", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.BloodGroup), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_BLOODGROUP, (x => x.BloodGroup))));
  66. controls.Add("Specialty", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Specialty), Html.TextBoxFor(x => x.Specialty)));
  67. controls.Add("Height", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Height), Html.TextBoxFor(x => x.Height)));
  68. controls.Add("Weight", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Weight), Html.TextBoxFor(x => x.Weight)));
  69. controls.Add("Remarks", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Remarks), Html.TextBoxFor(x => x.Remarks)));
  70. controls.Add("CardNo", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.CardNo), Html.TextBoxFor(x => x.CardNo)));
  71. controls.Add("BankName", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.BankName), Html.TextBoxFor(x => x.BankName)));
  72. controls.Add("Email", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Email), Html.TextBoxFor(x => x.Email)));
  73. controls.Add("QQ", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.QQ), Html.TextBoxFor(x => x.QQ)));
  74. controls.Add("Mobile", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Mobile), Html.TextBoxFor(x => x.Mobile)));
  75. controls.Add("Telephone", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Telephone), Html.TextBoxFor(x => x.Telephone)));
  76. controls.Add("MicroMsgNo", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.MicroMsgNo), Html.TextBoxFor(x => x.MicroMsgNo)));
  77. controls.Add("ZipCode", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.ZipCode), Html.TextBoxFor(x => x.ZipCode)));
  78. controls.Add("Address", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Address), Html.TextBoxFor(x => x.Address)));
  79. controls.Add("WorkUnit", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.WorkUnit), Html.TextBoxFor(x => x.WorkUnit)));
  80. controls.Add("HomeAddress", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.HomeAddress), Html.TextBoxFor(x => x.HomeAddress)));
  81. controls.Add("Recipient", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Recipient), Html.TextBoxFor(x => x.Recipient)));
  82. controls.Add("Dormitory", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Dormitory), Html.TextBoxFor(x => x.Dormitory)));
  83. controls.Add("Career", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.Career), Html.TextBoxFor(x => x.Career)));
  84. controls.Add("IsDreamProject", new KeyValuePair<MvcHtmlString, MvcHtmlString>(Html.LabelFor(x => x.IsDreamProject), Html.CheckBoxFor(x => x.IsDreamProject)));
  85. }
  86. <style type="text/css">
  87. #Coursematerialtable {
  88. width: 100%;
  89. border: 0px none;
  90. }
  91. #Coursematerialtable tr {
  92. min-height: 30px;
  93. }
  94. /*防止遮盖列表按钮*/
  95. .popupWindowContent {
  96. top: 70px;
  97. }
  98. </style>
  99. @section scripts{
  100. <script type="text/javascript">
  101. function StudentPersonal_Save() {
  102. $(document.forms[0]).submit(); //提交Form表单
  103. }
  104. </script>
  105. }
  106. <div class="easyui-panel" data-options="border:false,fit:true" style="position: relative;">
  107. @using (Ajax.BeginForm(new AjaxOptions { Url = "/StudentRecord/Edit", OnSuccess = "EMISFunction.FormSuccess", OnBegin = "EMISFunction.FormSubmit", OnComplete = "EMISFunction.FormComplete" }))
  108. {
  109. <div class="p_title">
  110. <div style="margin-right: 10px; line-height: 30px; font-size: 12px;">@Html.ContextMenuBar("Edit")</div>
  111. </div>
  112. <div class="search_list">
  113. @*<input id="files" type="file" onchange="previewImage(this, 'prvid')" multiple="multiple"/>
  114. <div style="height:300px; width:330px;" id="prvid">预览容器</div>*@
  115. <table cellpadding="0" cellspacing="0" id="Coursematerialtable">
  116. <tr>
  117. <td style=" text-align:right; width:20%">
  118. 名称
  119. </td>
  120. <td style=" width:35%">
  121. 修改前
  122. </td>
  123. <td style="width:35%">
  124. 修改后
  125. </td>
  126. </tr>
  127. @foreach (var type in TypeNames)
  128. {
  129. foreach (var Feild in ChangeFeilds.Where(q => q.TypeName == type).OrderBy(q => q.OrderBy))
  130. {
  131. <tr>
  132. <td style=" width:20%">
  133. @if (controls.Keys.Contains(Feild.ColumnFeild))
  134. {
  135. @controls[Feild.ColumnFeild].Key
  136. }
  137. </td>
  138. <td style=" width:35%">
  139. @if (!Feild.ColumnNmae.Contains("PhotoUrl"))//TODO:图片不需要显示路径
  140. {
  141. @Html.Display(Feild.ColumnNmae)
  142. }
  143. else
  144. {
  145. @MvcHtmlString.Create("<div><img src=\"" + Model.PhotoUrl + "\" width=120 height=160 /></div>")
  146. }
  147. </td>
  148. <td style=" width:35%">
  149. @if (Feild.IsChange && controls.Keys.Contains(Feild.ColumnFeild))
  150. {
  151. @controls[Feild.ColumnFeild].Value
  152. }
  153. else if (Feild.ColumnNmae == "PhotoUrl")
  154. {
  155. @MvcHtmlString.Create("<div><img src=\"" + Model.PhotoUrl + "\" width=120 height=160 /></div>")
  156. }
  157. else
  158. {
  159. @Html.Display(Feild.ColumnNmae)
  160. }
  161. </td>
  162. </tr>
  163. }
  164. }
  165. </table>
  166. </div>
  167. }
  168. </div>