diff --git a/SubProject/FCOMMON/fLovDateList.Designer.cs b/SubProject/FCOMMON/fLovDateList.Designer.cs new file mode 100644 index 0000000..504c843 --- /dev/null +++ b/SubProject/FCOMMON/fLovDateList.Designer.cs @@ -0,0 +1,67 @@ +namespace FCOMMON +{ + partial class fLovDateList + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.listBox1 = new System.Windows.Forms.ListBox(); + this.SuspendLayout(); + // + // listBox1 + // + this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listBox1.Font = new System.Drawing.Font("Tahoma", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.listBox1.FormattingEnabled = true; + this.listBox1.ItemHeight = 33; + this.listBox1.Location = new System.Drawing.Point(0, 0); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(303, 445); + this.listBox1.TabIndex = 0; + this.listBox1.DoubleClick += new System.EventHandler(this.listBox1_DoubleClick); + this.listBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.listBox1_KeyDown); + // + // fLovDateList + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(303, 445); + this.Controls.Add(this.listBox1); + this.Font = new System.Drawing.Font("Tahoma", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "fLovDateList"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "fLovDateList"; + this.Load += new System.EventHandler(this.@__Load); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListBox listBox1; + } +} \ No newline at end of file diff --git a/SubProject/FCOMMON/fLovDateList.cs b/SubProject/FCOMMON/fLovDateList.cs new file mode 100644 index 0000000..b5401ef --- /dev/null +++ b/SubProject/FCOMMON/fLovDateList.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace FCOMMON +{ + public partial class fLovDateList : Form + { + public string selectedDate = string.Empty; + public fLovDateList(List dateList) + { + InitializeComponent(); + this.KeyPreview = true; + this.KeyDown += fLovDateList_KeyDown; + + this.listBox1.Items.Clear(); + foreach (var dateStr in dateList) + this.listBox1.Items.Add(dateStr); + } + private void __Load(object sender, EventArgs e) + { + + } + void fLovDateList_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Escape) this.Close(); + } + void selectItem() + { + selectedDate = string.Empty; + if (listBox1.Items.Count < 1) DialogResult = System.Windows.Forms.DialogResult.Cancel; + if (listBox1.SelectedItem == null) DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.selectedDate = listBox1.SelectedItem.ToString(); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + + private void listBox1_DoubleClick(object sender, EventArgs e) + { + selectItem(); + } + + private void listBox1_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + selectItem(); + } + + + } +} diff --git a/SubProject/FCOMMON/fLovDateList.resx b/SubProject/FCOMMON/fLovDateList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SubProject/FCOMMON/fLovDateList.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SubProject/FCOMMON/keyValuedataTable.cs b/SubProject/FCOMMON/keyValuedataTable.cs new file mode 100644 index 0000000..ecc1344 --- /dev/null +++ b/SubProject/FCOMMON/keyValuedataTable.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; + +namespace FCOMMON +{ + + public class keyValuedataTable + { + System.Data.DataTable dt; + public System.Data.DataTable DataTable + { + get + { + return dt; + } + } + public keyValuedataTable() + { + dt = new System.Data.DataTable(); + dt.Columns.Add("key"); + dt.Columns.Add("value"); + } + public void Add(string key, string value) + { + dt.Rows.Add(new string[] { key,value }); + dt.AcceptChanges(); + } + } + +}