public static void LogRank(string action, RatingParameters parameters, bool includeSemester) { try { StringBuilder builder = new StringBuilder(); if (includeSemester) { builder.AppendLine(string.Format("學年度:{0},學期:{1}", parameters.SchoolYear, parameters.Semester)); } else { builder.AppendLine(string.Format("學年度:{0}", parameters.SchoolYear)); } builder.AppendLine(string.Format("排名選項:{0}", GetRatingOption(parameters.RatingMethod))); builder.AppendLine(string.Format("排名年級:{0}", GetRatingDataCondition(parameters.TargetGradeYears))); builder.AppendLine(string.Format("排名項目:{0}", GetRatingItems(parameters.RatingItems))); CurrentUser.Instance.AppLog.Write(action, builder.ToString(), action, string.Empty); } catch (Exception ex) { CurrentUser.ReportError(ex); } }
public RankProgressForm(RatingParameters parameters, bool view) { InitializeComponent(); InitializeBackgroundWorker(); _parameters = parameters; _view = view; }
public StudentScoreRank(RankProgressForm rankForm, DoWorkEventArgs workArgs) { //排名相關參數,由主畫面選項決定。 _parameters = rankForm.RatingParams; //BackgroundWorker 事件物件。 _work_args = workArgs; //工作進度權重管理物件。 _weights = new JobWeightTable(); //畫面進度回報物件。 _progress = new MainProgress(rankForm.ProgressUI, rankForm.MessageLabel); //要排名的學生集合。 _students = new StudentCollection(); //填入資料的 Adapter 集合。 _adapters = new AdapterCollection(); //是否不儲存,只試排看結果。 _save_required = !rankForm.IsViewMode; }
public YearSubjectScoreAdapter(StudentCollection students, RatingParameters parameters) : base(students, parameters) { }
public YearMoralAdapter(StudentCollection students, RatingParameters parameters) : base(students, parameters) { }
public SemsScoreAdapter(StudentCollection students, RatingParameters parameters) : base(students, parameters) { }
public StudentAdapter(StudentCollection emptyContainer, RatingParameters parameters) : base(emptyContainer, parameters) { }
private void btnRank_Click(object sender, EventArgs e) { RatingParameters parameters = new RatingParameters(); parameters.SchoolYear = intSchoolYear.Value.ToString(); parameters.Semester = intSemester.Value.ToString(); string msg = string.Format("現在將會進行成績排名,您確定嗎?", parameters.SchoolYear, parameters.Semester); DialogResult dr = MsgBox.Show(msg, Application.ProductName, MessageBoxButtons.YesNo); if (dr != DialogResult.Yes) { return; } if (chkSequence.Checked) { parameters.RatingMethod = RatingMethod.Sequence; } else if (chkUnSequence.Checked) { parameters.RatingMethod = RatingMethod.Unsequence; } else { MsgBox.Show("您必須要決定一種「排名選項」。", Application.ProductName); return; } if (chkGrade1.Checked) { parameters.TargetGradeYears.Add("1"); } if (chkGrade2.Checked) { parameters.TargetGradeYears.Add("2"); } if (chkGrade3.Checked) { parameters.TargetGradeYears.Add("3"); } if (parameters.TargetGradeYears.Count <= 0) { MsgBox.Show("您必須選擇要排名的年級。", Application.ProductName); return; } if (chkSemsSubjectScore.Checked) { parameters.RatingItems |= RatingItems.SemsSubject; } if (chkSemsScore.Checked) { parameters.RatingItems |= RatingItems.SemsScore; } if (chkSemsMoral.Checked) { parameters.RatingItems |= RatingItems.SemsMoral; } if (((int)parameters.RatingItems) == 0) { MsgBox.Show("您必須至少選擇一種「排名項目」。", Application.ProductName); return; } RankProgressForm progress; if (Control.ModifierKeys == Keys.Shift) { progress = new RankProgressForm(parameters, true); } else { progress = new RankProgressForm(parameters, false); } if (progress.ShowDialog() == DialogResult.OK) { Utility.LogRank("學期成績固定排名", parameters, true); MsgBox.Show("排名完成。"); } }
public DataAdapter(StudentCollection students, RatingParameters parameters) { _students = students; _parameters = parameters; }