diff --git a/FetToExcel.Designer.cs b/FetToExcel.Designer.cs index ffc6c1e..1191636 100644 --- a/FetToExcel.Designer.cs +++ b/FetToExcel.Designer.cs @@ -39,6 +39,7 @@ private void InitializeComponent() this.txtStartCell = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.llinkFetToExcelHelp = new System.Windows.Forms.LinkLabel(); + this.chkOrderByName = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // btnFileFet @@ -136,11 +137,22 @@ private void InitializeComponent() this.llinkFetToExcelHelp.Text = "Help"; this.llinkFetToExcelHelp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llinkFetToExcelHelp_LinkClicked); // + // chkOrderByName + // + this.chkOrderByName.AutoSize = true; + this.chkOrderByName.Location = new System.Drawing.Point(179, 93); + this.chkOrderByName.Name = "chkOrderByName"; + this.chkOrderByName.Size = new System.Drawing.Size(104, 17); + this.chkOrderByName.TabIndex = 9; + this.chkOrderByName.Text = "Ordina per nome"; + this.chkOrderByName.UseVisualStyleBackColor = true; + // // FetToExcel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(506, 153); + this.Controls.Add(this.chkOrderByName); this.Controls.Add(this.llinkFetToExcelHelp); this.Controls.Add(this.label1); this.Controls.Add(this.txtStartCell); @@ -174,6 +186,7 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtStartCell; private System.Windows.Forms.Label label1; private System.Windows.Forms.LinkLabel llinkFetToExcelHelp; + private System.Windows.Forms.CheckBox chkOrderByName; } } diff --git a/FetToExcel.cs b/FetToExcel.cs index 3eca201..c0c6ef2 100644 --- a/FetToExcel.cs +++ b/FetToExcel.cs @@ -161,7 +161,7 @@ private void BtnImporta_Click(object sender, EventArgs e) } - XmlNodeList teachers = teachersTimeTable[0].ChildNodes; + var teachers = document.SelectNodes("Teachers_Timetable")[0].Cast(); @@ -235,6 +235,13 @@ private void BtnImporta_Click(object sender, EventArgs e) int? idxGiorno = null; int? numeroColonna = null; + + if (this.chkOrderByName.Checked) + { + teachers = teachers.OrderBy(r => r.Attributes["name"].Value); + } + + foreach (XmlNode teacher in teachers) { string teacherName = teacher.Attributes["name"].Value; diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index fcfbf4a..15b3e45 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -37,5 +37,5 @@ // È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build // usando l'asterisco '*' come illustrato di seguito: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.3.1.0")] +[assembly: AssemblyFileVersion("1.3.1.0")]