@using EMIS.Web.Controls; @model EMIS.ViewModel.Students.StudentsView @using Bowin.Web.Controls.Mvc; @{ ViewBag.Title = "Edit"; List ChangeFeilds = ViewBag.ChangeFeilds; List TypeNames = ViewBag.TypeNames; ComboGridOptions cgopStudentcharge = new ComboGridOptions { TextField = "Name", ValueField = "ClassmajorID", //OnSelect = "QueryClassmajorComboGrid", GridOptions = new DataGridOptions { Columns = new List() { new BoundFieldColumn { FieldName="No", HeaderText="班级编号", Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="Name", HeaderText="班级名称", Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="LearnSystem", HeaderText="学制", Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="yearID", HeaderText="学年", Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="EducationName", HeaderText=EMIS.Utility.RSL.Get("EducationID"), Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="LearningformName", HeaderText="学习形式", Align=AlignStyle.Center }, new BoundFieldColumn { FieldName="SchoolyearCode", HeaderText="毕业学年学期", Align=AlignStyle.Center }, }, IsCheckOnSelect = true, DataSourceUrl = Url.Content("~/Classmajor/List"), IsPagination = true, IsShowRowNumbers = true, IsSingleSelect = false } }; var controls = new Dictionary>(); controls.Add("LoginID", new KeyValuePair(Html.LabelFor(x => x.LoginID), Html.DisplayFor(x => x.LoginID))); controls.Add("UserName", new KeyValuePair(Html.LabelFor(x => x.UserName), Html.TextBoxFor(x => x.UserName))); //"
" + Html.SingleUploaderFor(x => x.PhotoUrl).ToHtmlString() + "
" controls.Add("PhotoUrl", new KeyValuePair(Html.LabelFor(x => x.PhotoUrl), MvcHtmlString.Create("
"))); controls.Add("Sex", new KeyValuePair(Html.LabelFor(x => x.Sex), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Sex, (x => x.Sex)))); controls.Add("CertificatesType", new KeyValuePair(Html.LabelFor(x => x.CertificatesType), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_CertificatesType, (x => x.CertificatesType)))); controls.Add("IDNumber", new KeyValuePair(Html.LabelFor(x => x.IDNumber), @Html.TextBoxFor(x => x.IDNumber))); controls.Add("StudentCardNo", new KeyValuePair(Html.LabelFor(x => x.StudentCardNo), Html.TextBoxFor(x => x.StudentCardNo))); controls.Add("ClassMajorID", new KeyValuePair(Html.LabelFor(x => x.ClassMajorID), Html.ComboGridFor(x => x.ClassMajorID, cgopStudentcharge))); controls.Add("CultureModel", new KeyValuePair(Html.LabelFor(x => x.CultureModel), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_CULTUREMODEL, (x => x.CultureModel)))); controls.Add("StudentType", new KeyValuePair(Html.LabelFor(x => x.StudentType), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_STUDENTTYPE, (x => x.StudentType)))); controls.Add("StudentStatus", new KeyValuePair(Html.LabelFor(x => x.StudentStatus), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_STUDENTSTATUS, (x => x.StudentStatus)))); controls.Add("InSchoolStatusID", new KeyValuePair(Html.LabelFor(x => x.InSchoolStatusID), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_InschoolStatus, (x => x.InSchoolStatusID)))); controls.Add("PlanningGraduateDate", new KeyValuePair(Html.LabelFor(x => x.PlanningGraduateDate), Html.TextBoxFor(x => x.PlanningGraduateDate, new TextBoxOptions() { TextBoxType = TextBoxType.Date }))); controls.Add("ExamineeNum", new KeyValuePair(Html.LabelFor(x => x.ExamineeNum), Html.TextBoxFor(x => x.ExamineeNum))); controls.Add("ExamineeType", new KeyValuePair(Html.LabelFor(x => x.ExamineeType), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_EXAMINEETYPE, (x => x.ExamineeType)))); controls.Add("EntranceDate", new KeyValuePair(Html.LabelFor(x => x.EntranceDate), Html.TextBoxFor(x => x.EntranceDate, new TextBoxOptions() { TextBoxType = TextBoxType.Date }))); controls.Add("EntranceWay", new KeyValuePair(Html.LabelFor(x => x.EntranceWay), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_EntranceWay, (x => x.EntranceWay)))); controls.Add("EnteringSchoolYearID", new KeyValuePair(Html.LabelFor(x => x.EnteringSchoolYearID), Html.DropdownListFor(x => x.EnteringSchoolYearID, new DropdownListOptions { ItemSourceUrl = "~/SchoolYear/DropDown", TextField = "Text", ValueField = "Value", }))); controls.Add("Placebirth", new KeyValuePair(Html.LabelFor(x => x.Placebirth), Html.TextBoxFor(x => x.Placebirth))); controls.Add("Features", new KeyValuePair(Html.LabelFor(x => x.Features), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Features, (x => x.Features)))); controls.Add("Score", new KeyValuePair(Html.LabelFor(x => x.Score), Html.TextBoxFor(x => x.Score))); controls.Add("Territorial", new KeyValuePair(Html.LabelFor(x => x.Territorial), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Province, (x => x.Territorial)))); controls.Add("Area", new KeyValuePair(Html.LabelFor(x => x.Area), Html.TextBoxFor(x => x.Area))); controls.Add("UsedName", new KeyValuePair(Html.LabelFor(x => x.UsedName), Html.TextBoxFor(x => x.UsedName))); controls.Add("DirectorName", new KeyValuePair(Html.LabelFor(x => x.DirectorName), Html.TextBoxFor(x => x.DirectorName))); controls.Add("BirthDate", new KeyValuePair(Html.LabelFor(x => x.BirthDate), Html.TextBoxFor(x => x.BirthDate, new TextBoxOptions() { TextBoxType = TextBoxType.Date }))); controls.Add("Country", new KeyValuePair(Html.LabelFor(x => x.Country), Html.TextBoxFor(x => x.Country))); controls.Add("Politics", new KeyValuePair(Html.LabelFor(x => x.Politics), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Politics, (x => x.Politics)))); controls.Add("Nation", new KeyValuePair(Html.LabelFor(x => x.Nation), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_Nation, (x => x.Nation)))); controls.Add("Place", new KeyValuePair(Html.LabelFor(x => x.Place), Html.TextBoxFor(x => x.Place))); controls.Add("Healthy", new KeyValuePair(Html.LabelFor(x => x.Healthy), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_HealthState, (x => x.Healthy)))); controls.Add("BloodGroup", new KeyValuePair(Html.LabelFor(x => x.BloodGroup), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_BLOODGROUP, (x => x.BloodGroup)))); controls.Add("Specialty", new KeyValuePair(Html.LabelFor(x => x.Specialty), Html.TextBoxFor(x => x.Specialty))); controls.Add("Height", new KeyValuePair(Html.LabelFor(x => x.Height), Html.TextBoxFor(x => x.Height))); controls.Add("Weight", new KeyValuePair(Html.LabelFor(x => x.Weight), Html.TextBoxFor(x => x.Weight))); controls.Add("Remarks", new KeyValuePair(Html.LabelFor(x => x.Remarks), Html.TextBoxFor(x => x.Remarks))); controls.Add("CardNo", new KeyValuePair(Html.LabelFor(x => x.CardNo), Html.TextBoxFor(x => x.CardNo))); controls.Add("BankName", new KeyValuePair(Html.LabelFor(x => x.BankName), Html.TextBoxFor(x => x.BankName))); controls.Add("Email", new KeyValuePair(Html.LabelFor(x => x.Email), Html.TextBoxFor(x => x.Email))); controls.Add("QQ", new KeyValuePair(Html.LabelFor(x => x.QQ), Html.TextBoxFor(x => x.QQ))); controls.Add("Mobile", new KeyValuePair(Html.LabelFor(x => x.Mobile), Html.TextBoxFor(x => x.Mobile))); controls.Add("Telephone", new KeyValuePair(Html.LabelFor(x => x.Telephone), Html.TextBoxFor(x => x.Telephone))); controls.Add("MicroMsgNo", new KeyValuePair(Html.LabelFor(x => x.MicroMsgNo), Html.TextBoxFor(x => x.MicroMsgNo))); controls.Add("ZipCode", new KeyValuePair(Html.LabelFor(x => x.ZipCode), Html.TextBoxFor(x => x.ZipCode))); controls.Add("Address", new KeyValuePair(Html.LabelFor(x => x.Address), Html.TextBoxFor(x => x.Address))); controls.Add("WorkUnit", new KeyValuePair(Html.LabelFor(x => x.WorkUnit), Html.TextBoxFor(x => x.WorkUnit))); controls.Add("HomeAddress", new KeyValuePair(Html.LabelFor(x => x.HomeAddress), Html.TextBoxFor(x => x.HomeAddress))); controls.Add("Recipient", new KeyValuePair(Html.LabelFor(x => x.Recipient), Html.TextBoxFor(x => x.Recipient))); controls.Add("Dormitory", new KeyValuePair(Html.LabelFor(x => x.Dormitory), Html.TextBoxFor(x => x.Dormitory))); controls.Add("Career", new KeyValuePair(Html.LabelFor(x => x.Career), Html.TextBoxFor(x => x.Career))); controls.Add("IsDreamProject", new KeyValuePair(Html.LabelFor(x => x.IsDreamProject), Html.CheckBoxFor(x => x.IsDreamProject))); controls.Add("LiteracyLevels", new KeyValuePair(Html.LabelFor(x => x.LiteracyLevels), Html.DictionaryDropDownListFor(EMIS.ViewModel.DictionaryItem.CF_LiteracyLevels, (x => x.LiteracyLevels)))); } @section scripts{ }
@Html.Position() @using (Html.BeginForm("ChangeSave", "StudentRecord", new { MNU = Request["MNU"] }, FormMethod.Post, new { enctype = "multipart/form-data" })) {
学生详细信息
@Html.ContextMenuBar("List")
@*
预览容器
*@ @foreach (var type in TypeNames) { foreach (var Feild in ChangeFeilds.Where(q => q.TypeName == type).OrderBy(q => q.OrderBy)) { } }
名称 修改前 修改后
@if (controls.Keys.Contains(Feild.ColumnFeild)) { @controls[Feild.ColumnFeild].Key } @if (!Feild.ColumnNmae.Contains("PhotoUrl"))//TODO:图片不需要显示路径 { @Html.Display(Feild.ColumnNmae) } else { @MvcHtmlString.Create("
") }
@if (Feild.IsChange && controls.Keys.Contains(Feild.ColumnFeild)) { @controls[Feild.ColumnFeild].Value } else if (Feild.ColumnNmae == "PhotoUrl") { @MvcHtmlString.Create("
") } else { @Html.Display(Feild.ColumnNmae) }
}