FrmWorkLog: Tags field

This commit is contained in:
2021-10-20 09:01:16 +02:00
parent 729ae1604e
commit b8c77aba7b
4 changed files with 33 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ namespace VAR.Toolbox.Code.WorkLog
{ {
public string Name { get { return "VARText"; } } public string Name { get { return "VARText"; } }
//TODO: VARTextWorkLogImporter: Export WorkLigItem.Tags
public bool Export(List<WorkLogItem> items, Form form) public bool Export(List<WorkLogItem> items, Form form)
{ {
SaveFileDialog saveFileDialog = new SaveFileDialog(); SaveFileDialog saveFileDialog = new SaveFileDialog();
@@ -56,6 +57,7 @@ namespace VAR.Toolbox.Code.WorkLog
return true; return true;
} }
//TODO: VARTextWorkLogImporter: Import WorkLigItem.Tags
public List<WorkLogItem> Import(Form form) public List<WorkLogItem> Import(Form form)
{ {
OpenFileDialog openFileDialog = new OpenFileDialog(); OpenFileDialog openFileDialog = new OpenFileDialog();

View File

@@ -8,6 +8,7 @@ namespace VAR.Toolbox.Code.WorkLog
public DateTime DateEnd { get; set; } public DateTime DateEnd { get; set; }
public string Activity { get; set; } public string Activity { get; set; }
public string Description { get; set; } public string Description { get; set; }
public string Tags { get; set; }
public bool Overlaps(WorkLogItem other) public bool Overlaps(WorkLogItem other)
{ {

View File

@@ -54,6 +54,7 @@
this.btnDelete = new VAR.Toolbox.Controls.CButton(); this.btnDelete = new VAR.Toolbox.Controls.CButton();
this.btnAdd = new VAR.Toolbox.Controls.CButton(); this.btnAdd = new VAR.Toolbox.Controls.CButton();
this.ttPanel = new System.Windows.Forms.ToolTip(this.components); this.ttPanel = new System.Windows.Forms.ToolTip(this.components);
this.txtTags = new VAR.Toolbox.Controls.TextBoxNormal();
((System.ComponentModel.ISupportInitialize)(this.splitWindow)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitWindow)).BeginInit();
this.splitWindow.Panel1.SuspendLayout(); this.splitWindow.Panel1.SuspendLayout();
this.splitWindow.Panel2.SuspendLayout(); this.splitWindow.Panel2.SuspendLayout();
@@ -86,6 +87,7 @@
// //
// splitWindow.Panel2 // splitWindow.Panel2
// //
this.splitWindow.Panel2.Controls.Add(this.txtTags);
this.splitWindow.Panel2.Controls.Add(this.btnSearch); this.splitWindow.Panel2.Controls.Add(this.btnSearch);
this.splitWindow.Panel2.Controls.Add(this.btnStats); this.splitWindow.Panel2.Controls.Add(this.btnStats);
this.splitWindow.Panel2.Controls.Add(this.lblWorkLogItemTime); this.splitWindow.Panel2.Controls.Add(this.lblWorkLogItemTime);
@@ -325,7 +327,7 @@
this.txtDescription.Multiline = true; this.txtDescription.Multiline = true;
this.txtDescription.Name = "txtDescription"; this.txtDescription.Name = "txtDescription";
this.txtDescription.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.txtDescription.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtDescription.Size = new System.Drawing.Size(259, 444); this.txtDescription.Size = new System.Drawing.Size(259, 382);
this.txtDescription.TabIndex = 3; this.txtDescription.TabIndex = 3;
this.txtDescription.TextChanged += new System.EventHandler(this.txtDescription_TextChanged); this.txtDescription.TextChanged += new System.EventHandler(this.txtDescription_TextChanged);
// //
@@ -361,6 +363,22 @@
this.btnAdd.Text = "Add"; this.btnAdd.Text = "Add";
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
// //
// txtTags
//
this.txtTags.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtTags.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
this.txtTags.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtTags.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.txtTags.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.txtTags.Location = new System.Drawing.Point(6, 535);
this.txtTags.Multiline = true;
this.txtTags.Name = "txtTags";
this.txtTags.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtTags.Size = new System.Drawing.Size(259, 57);
this.txtTags.TabIndex = 10;
this.txtTags.TextChanged += new System.EventHandler(this.txtTags_TextChanged);
//
// FrmWorkLog // FrmWorkLog
// //
this.ClientSize = new System.Drawing.Size(721, 603); this.ClientSize = new System.Drawing.Size(721, 603);
@@ -406,5 +424,6 @@
private VAR.Toolbox.Controls.CButton btnSumary; private VAR.Toolbox.Controls.CButton btnSumary;
private System.Windows.Forms.CheckBox chkImportMerging; private System.Windows.Forms.CheckBox chkImportMerging;
private System.Windows.Forms.ToolTip ttPanel; private System.Windows.Forms.ToolTip ttPanel;
private Controls.TextBoxNormal txtTags;
} }
} }

View File

@@ -121,7 +121,7 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
{ {
if (_selecting) { return; } if (_selecting) { return; }
_selecting = true; _selecting = true;
WorkLogRow row = lsbWorkLog.SelectedItem as WorkLogRow; var row = lsbWorkLog.SelectedItem as WorkLogRow;
if (row == null) if (row == null)
{ {
lsbWorkLog.ClearSelected(); lsbWorkLog.ClearSelected();
@@ -161,6 +161,7 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
DateEnd = dtEnd.Value, DateEnd = dtEnd.Value,
Activity = txtActivity.Text, Activity = txtActivity.Text,
Description = txtDescription.Text, Description = txtDescription.Text,
Tags = txtTags.Text,
}; };
_workLog.Add(item); _workLog.Add(item);
WorkLog_Refresh(); WorkLog_Refresh();
@@ -203,6 +204,11 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
WorkLogItem_Update(refresh: false); WorkLogItem_Update(refresh: false);
} }
private void txtTags_TextChanged(object sender, EventArgs e)
{
WorkLogItem_Update(refresh: false);
}
private void dtToday_ValueChanged(object sender, System.EventArgs e) private void dtToday_ValueChanged(object sender, System.EventArgs e)
{ {
WorkLog_Refresh(); WorkLog_Refresh();
@@ -417,6 +423,7 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
dtEnd.Value = DateTime.UtcNow.Date; dtEnd.Value = DateTime.UtcNow.Date;
txtActivity.Text = string.Empty; txtActivity.Text = string.Empty;
txtDescription.Text = string.Empty; txtDescription.Text = string.Empty;
txtTags.Text = string.Empty;
lblWorkLogItemTime.Text = string.Empty; lblWorkLogItemTime.Text = string.Empty;
WorkLogItem_EnableButtons(false); WorkLogItem_EnableButtons(false);
return; return;
@@ -426,6 +433,7 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
dtEnd.Value = item.DateEnd; dtEnd.Value = item.DateEnd;
txtActivity.Text = item.Activity; txtActivity.Text = item.Activity;
txtDescription.Text = item.Description; txtDescription.Text = item.Description;
txtTags.Text = item.Tags;
lblWorkLogItemTime.Text = (item.DateEnd - item.DateStart).ToString(); lblWorkLogItemTime.Text = (item.DateEnd - item.DateStart).ToString();
WorkLogItem_EnableButtons(true); WorkLogItem_EnableButtons(true);
@@ -448,6 +456,7 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
_currentWorkLogItem.DateEnd = dtEnd.Value; _currentWorkLogItem.DateEnd = dtEnd.Value;
_currentWorkLogItem.Activity = txtActivity.Text; _currentWorkLogItem.Activity = txtActivity.Text;
_currentWorkLogItem.Description = txtDescription.Text; _currentWorkLogItem.Description = txtDescription.Text;
_currentWorkLogItem.Tags = txtTags.Text;
if (refresh) if (refresh)
{ {
lsbWorkLog.SelectedIndex = -1; lsbWorkLog.SelectedIndex = -1;