/// <summary> /// 請傳入「填報年度」. /// </summary> public static MemoryStream Execute(int Year) { int ShiftedYear = Year; List<int> Years = new List<int>(); try { XDocument document = XDocument.Parse(Properties.Resources.Approach_Import, LoadOptions.None); IEnumerable<XElement> elements = document.Descendants("Schema").OrderBy(x => int.Parse(x.Attribute("SchoolYear").Value)); foreach (XElement element in elements) { int SurveyYear = int.Parse(element.Attribute("SchoolYear").Value); Years.Add(SurveyYear); } } catch (Exception ex) { throw ex; } if (!Years.Contains(Year)) { ShiftedYear = Years.Where(x => x < Year).Max(); } Template Template_102 = new Template_102(); Template Template_103 = new Template_103(); // 設定責任鏈之關連 Template_102.SetSuccessor(Template_103); // 開始責任鏈之走訪並回傳結果 return Template_102.ProcessRequest(ShiftedYear); }
/// <summary> /// 請傳入「填報年度」. /// </summary> public static string Execute(int Year, Dictionary<string, Dictionary<string, string>> Data) { Template Template_102 = new Template_102(); // 設定責任鏈之關連 Template_102.SetSuccessor(null); // 開始責任鏈之走訪並回傳結果 return Template_102.ProcessRequest(Year, Data); }
/// <summary> /// 請傳入「填報年度」. /// </summary> public static MemoryStream Execute(int Year) { Template Template_102 = new Template_102(); Template Template_103 = new Template_103(); // 設定責任鏈之關連 Template_102.SetSuccessor(Template_103); // 開始責任鏈之走訪並回傳結果 return Template_102.ProcessRequest(Year); }