private TypeListDifferences ValidateSchools(ImportResultsContainer irc) { var abilitySchoolTypes = irc.AbilityRows.Select(ar => ar.School.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var commandSchoolTypes = irc.CommandRows.Select(ar => ar.School.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); var otherSchoolTypes = irc.OtherRows.Where(ar => !String.IsNullOrWhiteSpace(ar.Type)).Select(ar => ar.School.Split(",".ToCharArray())). SelectMany(el => el).Select(s => s.Trim()).Distinct().OrderBy(e => e).ToList(); //SchoolTypes - source var unifiedSchoolTypesList = abilitySchoolTypes.Union(commandSchoolTypes).Union(otherSchoolTypes).OrderBy(e => e); //SchoolTypes - id list var schoolTypesIdList = new SchoolList(); var schoolTypesIdListSchoolNames = schoolTypesIdList.TypeList.Where(il => il.Key != 0).Select(kvp => kvp.Value).ToList(); TypeListDifferences schoolTypesDifferences = new TypeListDifferences() { IdListName = nameof(SchoolList), ValuesMissingFromIdList = unifiedSchoolTypesList.Except(schoolTypesIdListSchoolNames).ToList(), ValuesSuperfluousInIdList = schoolTypesIdListSchoolNames.Except(unifiedSchoolTypesList).ToList(), SuggestedIdListContents = GenerateSuggestedIdListContents(unifiedSchoolTypesList) }; return(schoolTypesDifferences); }
private static SchoolList ReadTable(DataTable table, string sheetName) { var schools = new SchoolList(); foreach (DataRow row in table.Rows) { if (sheetName == "KiTa") { var school = GetSchool(row, 5, 4); if (school != null) { schools.Add(school); } } else { var school = GetSchool(row, 13, 12); if (school != null) { schools.Add(school); } } } return(schools); }
/// <summary> /// 绑定学校列表 /// </summary> public void BindSchoolList() { string functionName = "BindSchoolList"; try { List <AMS.Model.AMS_ProvinceSchoolInfo> List = AMS.ServiceProxy.IssuedInfoWindow.GetSchoolList(); SchoolList.Clear(); SchoolList.Add(new AMS.Model.AMS_School() { Number = "-1", Name = "请选择" }); foreach (AMS.Model.AMS_ProvinceSchoolInfo model in List) { foreach (AMS.Model.AMS_School modelChild in model.Schools) { SchoolList.Add(modelChild); } } } catch (AMS.Model.CustomerException ex) { ErrorMessage = string.Format("{0} 出自{1}.{2}", ex.Message, ex.ErrorSourcesClass, ex.ErrorSourcesFunction); } catch (Exception ex) { ErrorMessage = string.Format("{0} 出自{1}.{2}", ex.Message, CLASSNAME, functionName); } }
protected void Clear(object sender, EventArgs e) { ID.Text = ""; ProgramName.Text = ""; DiplomaName.Text = ""; SchoolList.ClearSelection(); Tuition.Text = ""; InternationalTuition.Text = ""; }
public bool CanSelect() { if (IsCompanyUser && ApplicationList.Count() == 1) return false; if (IsSchoolUser && ApplicationList.Count() == 1 && SchoolList.Count() == 1) return false; return true; }
/// <summary> /// 绑定学校列表 /// </summary> public void BindSchool() { SchoolList.Clear(); List <AdvertManage.Model.AMS_SchoolModel> schoolList = AdvertManage.BLL.AMS_SchoolBLL.GetAllSchoolInfo(); SchoolList.Add(new AdvertManage.Model.AMS_SchoolModel() { Id = -1, Name = "请选择" }); foreach (AdvertManage.Model.AMS_SchoolModel model in schoolList) { SchoolList.Add(model); } }
//Method that binds all of the data to the dropdown menus protected void BindBasicData() { SchoolList.DataSource = CreateSchoolList(); SchoolList.DataTextField = "SchoolName"; SchoolList.DataValueField = "SchoolValue"; JobList.DataSource = CreateJobList(); JobList.DataTextField = "JobName"; JobList.DataValueField = "JobValue"; JobList_HS.DataSource = CreateJobList(); JobList_HS.DataTextField = "JobName"; JobList_HS.DataValueField = "JobValue"; SchoolList.DataBind(); JobList.DataBind(); JobList_HS.DataBind(); }
protected void SchoolDataBind() { try { SchoolController sysmgr = new SchoolController(); List <School> info = sysmgr.School_List(); info.Sort((x, y) => x.SchoolName.CompareTo(y.SchoolName)); SchoolList.DataSource = info; SchoolList.DataValueField = "SchoolCode"; SchoolList.DataTextField = "SchoolName"; SchoolList.DataBind(); SchoolList.Items.Insert(0, "select ..."); } catch (DbUpdateException ex) { UpdateException updateException = (UpdateException)ex.InnerException; if (updateException.InnerException != null) { errormsgs.Add(updateException.InnerException.Message.ToString()); } else { errormsgs.Add(updateException.Message); } LoadMessageDisplay(errormsgs, "alert alert-danger"); } catch (DbEntityValidationException ex) { foreach (var entityValidationErrors in ex.EntityValidationErrors) { foreach (var validationError in entityValidationErrors.ValidationErrors) { errormsgs.Add(validationError.ErrorMessage); } } LoadMessageDisplay(errormsgs, "alert alert-danger"); } catch (Exception ex) { errormsgs.Add(GetInnerException(ex).ToString()); LoadMessageDisplay(errormsgs, "alert alert-danger"); } }
protected void BindSchoolList() { try { SchoolController sysmgr = new SchoolController(); List <Schools> info = null; info = sysmgr.List(); info.Sort((x, y) => x.SchoolName.CompareTo(y.SchoolName)); SchoolList.DataSource = info; SchoolList.DataTextField = nameof(Schools.SchoolName); SchoolList.DataValueField = nameof(Schools.SchoolCode); SchoolList.DataBind(); SchoolList.Items.Insert(0, "select..."); } catch (Exception ex) { errormsgs.Add(GetInnerException(ex).ToString()); LoadMessageDisplay(errormsgs, "alert alert-danger"); } }
protected void BindSchoolList() { try { SchoolController sysmgr = new SchoolController(); List <Schools> info = null; info = sysmgr.List(); info.Sort((x, y) => x.SchoolCode.CompareTo(y.SchoolCode)); SchoolList.DataSource = info; SchoolList.DataTextField = nameof(Schools.SchoolName); SchoolList.DataValueField = nameof(Schools.SchoolCode); SchoolList.DataBind(); ListItem myitem = new ListItem(); myitem.Value = "0"; myitem.Text = "select..."; SchoolList.Items.Insert(0, myitem); } catch (Exception ex) { ShowMessage(GetInnerException(ex).ToString(), "alert alert-danger"); } }