From e9ec7ca3927e9c3e35ab6ed7bb1943bb11e16cee Mon Sep 17 00:00:00 2001 From: "c0d3.m0nk3y" Date: Fri, 15 May 2026 13:55:25 -0400 Subject: [PATCH] Minor code refactoring (renaming functions, variables, etc --- Forms/MainForm.Designer.cs | 10 +- Forms/MainForm.cs | 325 +++++++++++++++++--------------- Forms/TextAreaForm.Designer.cs | 2 +- Forms/TextAreaForm.cs | 5 +- Interfaces/IMainForm.cs | 14 +- Services/MainCtrl.cs | 14 +- Utilities/CurrencyExtensions.cs | 2 +- Utilities/DateTimeExtensions.cs | 2 +- Utilities/DialogExtensions.cs | 2 +- Utilities/FileExtensions.cs | 2 +- Utilities/StringExtensions.cs | 2 +- 11 files changed, 203 insertions(+), 177 deletions(-) diff --git a/Forms/MainForm.Designer.cs b/Forms/MainForm.Designer.cs index e0a3f37..d255f92 100644 --- a/Forms/MainForm.Designer.cs +++ b/Forms/MainForm.Designer.cs @@ -261,21 +261,21 @@ addTaskSubtaskToolStripMenuItem.Name = "addTaskSubtaskToolStripMenuItem"; addTaskSubtaskToolStripMenuItem.Size = new Size(370, 38); addTaskSubtaskToolStripMenuItem.Text = "Add Task / Sub-task"; - addTaskSubtaskToolStripMenuItem.Click += addTaskSubtaskToolStripMenuItem_Click; + addTaskSubtaskToolStripMenuItem.Click += PTask_AddTaskSubtaskToolStripMenuItem_Click; // // editThisTaskSubtaskToolStripMenuItem // editThisTaskSubtaskToolStripMenuItem.Name = "editThisTaskSubtaskToolStripMenuItem"; editThisTaskSubtaskToolStripMenuItem.Size = new Size(370, 38); editThisTaskSubtaskToolStripMenuItem.Text = "Edit this Task / Sub-task"; - editThisTaskSubtaskToolStripMenuItem.Click += editThisTaskSubtaskToolStripMenuItem_Click; + editThisTaskSubtaskToolStripMenuItem.Click += PTask_EditThisTaskSubtaskToolStripMenuItem_Click; // // deleteThisTaskSubtaskToolStripMenuItem // deleteThisTaskSubtaskToolStripMenuItem.Name = "deleteThisTaskSubtaskToolStripMenuItem"; deleteThisTaskSubtaskToolStripMenuItem.Size = new Size(370, 38); deleteThisTaskSubtaskToolStripMenuItem.Text = "Delete this Task / Sub-task"; - deleteThisTaskSubtaskToolStripMenuItem.Click += deleteThisTaskSubtaskToolStripMenuItem_Click; + deleteThisTaskSubtaskToolStripMenuItem.Click += PTask_DeleteThisTaskSubtaskToolStripMenuItem_Click; // // toolStripSeparator1 // @@ -287,7 +287,7 @@ addACommentToolStripMenuItem.Name = "addACommentToolStripMenuItem"; addACommentToolStripMenuItem.Size = new Size(370, 38); addACommentToolStripMenuItem.Text = "Add a comment"; - addACommentToolStripMenuItem.Click += addACommentToolStripMenuItem_Click; + addACommentToolStripMenuItem.Click += PTask_AddACommentToolStripMenuItem_Click; // // splitContainerTasks2 // @@ -356,7 +356,7 @@ richTextBoxTaskComments.Size = new Size(1218, 259); richTextBoxTaskComments.TabIndex = 1; richTextBoxTaskComments.Text = ""; - richTextBoxTaskComments.LinkClicked += richTextBoxTaskComments_LinkClicked; + richTextBoxTaskComments.LinkClicked += PTask_RichTextBoxTaskComments_LinkClicked; // // MainForm // diff --git a/Forms/MainForm.cs b/Forms/MainForm.cs index a89f8da..cbcca39 100644 --- a/Forms/MainForm.cs +++ b/Forms/MainForm.cs @@ -1,22 +1,22 @@ using Microsoft.Data.Sqlite; -using newcle.us.Forms; -using newcle.us.Utilities; using System.ComponentModel; + using trakker.Data; using trakker.Forms; using trakker.Interfaces; using trakker.Models; using trakker.Services; +using trakker.Utilities; namespace trakker { public partial class MainForm : Form, IMainForm { - //private readonly string _dbversion = "[N.N.N]"; - private string connectionString = string.Empty; + private const string _AppVersion = "[n.n.n]"; + private static readonly string _empty = string.Empty; + private string _ConnectionString = _empty; readonly MainCtrl _ctrl; - /// /// Initializes a new instance of the class. /// Sets up the form's controls and event handlers by calling @@ -29,19 +29,19 @@ namespace trakker // build connection string that will be used for database connections // ------------------------------------------------------------------------ var dbPath = Path.Combine(AppContext.BaseDirectory, "trakker.db"); - connectionString = new SqliteConnectionStringBuilder + _ConnectionString = new SqliteConnectionStringBuilder { DataSource = dbPath, Mode = SqliteOpenMode.ReadWriteCreate, Cache = SqliteCacheMode.Shared }.ToString(); - Text = "Project Trakker - v[n.n.n] / pragmattica.com"; + Text = $"Project Trakker - v{_AppVersion} / pragmattica.com"; tabControlMainForm.TabPages[0].Text = " Home "; tabControlMainForm.TabPages[1].Text = " Clients "; tabControlMainForm.TabPages[2].Text = " Projects "; - _ctrl = new Services.MainCtrl(this, connectionString); + _ctrl = new Services.MainCtrl(this, _ConnectionString); } /// @@ -55,7 +55,7 @@ namespace trakker Application.Exit(); } - public void InitDataGridViewClients(BindingList clients) + public void Client_DataGridViewClients_Init(BindingList clients) { dataGridViewClients.AllowUserToAddRows = true; dataGridViewClients.AllowUserToDeleteRows = true; @@ -112,56 +112,67 @@ namespace trakker dataGridViewClients.DoubleClick += (s, e) => { - if (dataGridViewClients.SelectedRows.Count > 0) - { - var selectedClient = dataGridViewClients.SelectedRows[0].DataBoundItem as Client; - if (selectedClient != null) - { - var dialog = new ClientForm(selectedClient, _ctrl.GetLOV("state")); - if (dialog.ShowDialog(this) == DialogResult.OK) - { - Client client = dialog.Client; - ClientData clientData = new ClientData(connectionString); - try - { - clientData.Upsert(client); - dataGridViewClients.Refresh(); // Refresh the DataGridView to reflect changes - } - catch (Exception ex) - { - MessageBox.Show($"Error saving client: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - } - } + Client_DataGridViewClients_DoubleClick(s!, e); }; dataGridViewClients.SelectionChanged += (s, e) => { - if (dataGridViewClients.SelectedRows.Count > 0) - { - var selectedClient = dataGridViewClients.SelectedRows[0].DataBoundItem as Client; - if (selectedClient != null) - { - // Handle the selected client as needed - // MessageBox.Show($"Selected Client: {selectedClient.AddressStreet}", "Client Selected", MessageBoxButtons.OK, MessageBoxIcon.Information ); - } - } + Client_DataGridViewClients_SelectionChanged(s!, e); }; } - public void FillDataGridViewProjects(BindingSource projects) + + public void Client_DataGridViewClients_DoubleClick(object sender, EventArgs e) + { + if (dataGridViewClients.SelectedRows.Count > 0) + { + var selectedClient = dataGridViewClients.SelectedRows[0].DataBoundItem as Client; + if (selectedClient != null) + { + var dialog = new ClientForm(selectedClient, _ctrl.GetLOV("state")); + if (dialog.ShowDialog(this) == DialogResult.OK) + { + Client client = dialog.Client; + ClientData clientData = new ClientData(_ConnectionString); + try + { + clientData.Upsert(client); + dataGridViewClients.Refresh(); // Refresh the DataGridView to reflect changes + } + catch (Exception ex) + { + MessageBox.Show($"Error saving client: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } + } + + public void Client_DataGridViewClients_SelectionChanged(object sender, EventArgs e) + { + if (dataGridViewClients.SelectedRows.Count > 0) + { + var selectedClient = dataGridViewClients.SelectedRows[0].DataBoundItem as Client; + if (selectedClient != null) + { + // Handle the selected client as needed + // MessageBox.Show($"Selected Client: {selectedClient.AddressStreet}", "Client Selected", MessageBoxButtons.OK, MessageBoxIcon.Information ); + } + } + } + + + public void Project_DataGridViewProjects_Fill(BindingSource projects) { int idx = 0; if (dataGridViewProjects.CurrentRow != null) { idx = dataGridViewProjects.CurrentRow.Index; } - //MessageBox.Show($"Project idx: {idx}", "Debug Info", MessageBoxButtons.OK, MessageBoxIcon.Information); dataGridViewProjects.DataSource = projects; dataGridViewProjects.Rows[idx].Selected = true; } - public void InitDataGridViewProjects() + public void Project_DataGridViewProjects_Init() { dataGridViewProjects.AllowUserToAddRows = true; dataGridViewProjects.AllowUserToDeleteRows = true; @@ -268,55 +279,65 @@ namespace trakker dataGridViewProjects.DoubleClick += (s, e) => { - if (dataGridViewProjects.SelectedRows.Count > 0) - { - var selectedIdx = dataGridViewProjects.SelectedRows[0].Index; - var selectedProject = dataGridViewProjects.SelectedRows[0].DataBoundItem as Project; - if (selectedProject != null) - { - var dialog = new ProjectForm(selectedProject, _ctrl.GetClients(), _ctrl.GetLOV("project.status")); - if (dialog.ShowDialog(this) == DialogResult.OK) - { - Project project = dialog.Project; - ProjectData projectData = new ProjectData(connectionString); - try - { - projectData.Upsert(project); - _ctrl.LoadProjects(); // Reload projects to update the DataGridView with any changes - dataGridViewProjects.ClearSelection(); - if (selectedIdx >= 0 && selectedIdx < dataGridViewProjects.Rows.Count) - { - dataGridViewProjects.Rows[selectedIdx].Selected = true; - } - } - catch (Exception ex) - { - MessageBox.Show($"Error saving project: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - return; - } - } + Project_DataGridViewProjects_DoubleClick(s!, e); }; dataGridViewProjects.SelectionChanged += (s, e) => { - if (_ctrl == null) return; // Safety check to prevent null reference exceptions during initialization) - if (dataGridViewProjects.SelectedRows.Count > 0) - { - var selectedProject = dataGridViewProjects.SelectedRows[0].DataBoundItem as Project; - if (selectedProject != null) - { - // Handle the selected project as needed - //MessageBox.Show($"Project ID: {selectedProject.ProjectId}, Selected Project: {selectedProject.ProjectName}", "Project Selected", MessageBoxButtons.OK, MessageBoxIcon.Information ); - _ctrl.LoadTasks(selectedProject.ProjectId); // Load tasks for the selected project - InitProjectTasks(); - } - } + Project_DataGridViewProjects_SelectionChanged(s!, e); }; } + public void Project_DataGridViewProjects_DoubleClick(object sender, EventArgs e) + { + if (dataGridViewProjects.SelectedRows.Count > 0) + { + var selectedIdx = dataGridViewProjects.SelectedRows[0].Index; + var selectedProject = dataGridViewProjects.SelectedRows[0].DataBoundItem as Project; + if (selectedProject != null) + { + var dialog = new ProjectForm(selectedProject, _ctrl.GetClients(), _ctrl.GetLOV("project.status")); + if (dialog.ShowDialog(this) == DialogResult.OK) + { + Project project = dialog.Project; + ProjectData projectData = new ProjectData(_ConnectionString); + try + { + projectData.Upsert(project); + _ctrl.LoadProjects(); // Reload projects to update the DataGridView with any changes + dataGridViewProjects.ClearSelection(); + if (selectedIdx >= 0 && selectedIdx < dataGridViewProjects.Rows.Count) + { + dataGridViewProjects.Rows[selectedIdx].Selected = true; + } + } + catch (Exception ex) + { + MessageBox.Show($"Error saving project: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + return; + } + } + } + + public void Project_DataGridViewProjects_SelectionChanged(object sender, EventArgs e) + { + if (_ctrl == null) return; // Safety check to prevent null reference exceptions during initialization) + if (dataGridViewProjects.SelectedRows.Count > 0) + { + var selectedProject = dataGridViewProjects.SelectedRows[0].DataBoundItem as Project; + if (selectedProject != null) + { + // Handle the selected project as needed + //MessageBox.Show($"Project ID: {selectedProject.ProjectId}, Selected Project: {selectedProject.ProjectName}", "Project Selected", MessageBoxButtons.OK, MessageBoxIcon.Information ); + _ctrl.LoadTasks(selectedProject.ProjectId); // Load tasks for the selected project + InitProjectTasks(); + } + } + } + public void InitProjectTasks() { //dataGridViewProjectTasks.Rows.Clear(); @@ -325,7 +346,7 @@ namespace trakker richTextBoxTaskComments.ReadOnly = true; } - public void InitTreeViewTasks() + public void PTask_TreeViewTasks1_Init() { // Basic TreeView configuration treeViewTasks1.BeginUpdate(); @@ -339,11 +360,11 @@ namespace trakker // When a tree node is clicked, fetch and show notebooks for that folder treeViewTasks1.NodeMouseClick += (sender, e) => { - TreeViewTasks1_NodeMouseClick(e.Node, e.Button); + PTask_TreeViewTasks1_NodeMouseClick(e.Node, e.Button); }; } - public void TreeViewTasks1_NodeMouseClick(TreeNode node, MouseButtons button = MouseButtons.Left) + public void PTask_TreeViewTasks1_NodeMouseClick(TreeNode node, MouseButtons button = MouseButtons.Left) { if (node == null) return; @@ -360,7 +381,7 @@ namespace trakker } _ctrl.LoadTasksRecursive(selectedNode?.GUID ?? "/", PTask.RecursiveRoot.TASK_ID); // Load all tasks for the project when root node is clicked } - public void FillTreeViewTasks(List items) + public void PTask_TreeViewTasks1_Fill(List items) { if (items == null) return; @@ -371,7 +392,7 @@ namespace trakker PTaskFS root = new(); root.GUID = "/"; root.Node = "/Project"; - root.Parent = string.Empty; + root.Parent = _empty; TreeNode rootNode = new TreeNode(root.Node) { Tag = root }; treeViewTasks1.Nodes.Add(rootNode); @@ -417,12 +438,12 @@ namespace trakker treeViewTasks1.EndUpdate(); // End the update TreeNode node = rootNode.FirstNode; - TreeViewTasks1_NodeMouseClick(node, MouseButtons.Left); + PTask_TreeViewTasks1_NodeMouseClick(node, MouseButtons.Left); //treeViewTasks1.SelectedNode = node; //treeViewTasks1.Focus(); } - private void addTaskSubtaskToolStripMenuItem_Click(object sender, EventArgs e) + private void PTask_AddTaskSubtaskToolStripMenuItem_Click(object sender, EventArgs e) { if (treeViewTasks1.SelectedNode == null) return; PTaskFS? selectedNode = (PTaskFS?)treeViewTasks1.SelectedNode.Tag ?? new PTaskFS(); @@ -436,7 +457,7 @@ namespace trakker { TaskId = taskId, Title = "New Task", - Description = string.Empty, + Description = _empty, ParentTaskId = selectedNode?.GUID == "/" ? null : selectedNode?.GUID, HourlyRate = selectedNode?.HourlyRate, ProjectId = selectedNode?.ProjectId, // Root node has no project @@ -446,7 +467,7 @@ namespace trakker if (result == DialogResult.OK) { task = dialog.Task; - TaskData taskData = new TaskData(connectionString); + TaskData taskData = new TaskData(_ConnectionString); try { taskData.Upsert(task); @@ -460,7 +481,7 @@ namespace trakker } } - private void editThisTaskSubtaskToolStripMenuItem_Click(object sender, EventArgs e) + private void PTask_EditThisTaskSubtaskToolStripMenuItem_Click(object sender, EventArgs e) { if (treeViewTasks1.SelectedNode == null) return; PTaskFS? selectedTask = treeViewTasks1.SelectedNode.Tag as PTaskFS; @@ -469,7 +490,7 @@ namespace trakker MessageBox.Show("Cannot edit root node", "Edit Task", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } - TaskData taskData = new TaskData(connectionString); + TaskData taskData = new TaskData(_ConnectionString); PTask task = taskData.Get(selectedTask?.GUID); TaskForm dialog = new TaskForm(task, _ctrl.GetLOV("task.status"), _ctrl.GetLOV("task.priority")); DialogResult result = dialog.ShowDialog(this); @@ -490,7 +511,7 @@ namespace trakker } } - private void deleteThisTaskSubtaskToolStripMenuItem_Click(object sender, EventArgs e) + private void PTask_DeleteThisTaskSubtaskToolStripMenuItem_Click(object sender, EventArgs e) { if (treeViewTasks1.SelectedNode == null) return; PTaskFS? selectedTask = treeViewTasks1.SelectedNode.Tag as PTaskFS; @@ -505,14 +526,14 @@ namespace trakker MessageBox.Show("Cannot delete a task with subtasks", "Delete Task", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } - TaskData taskData = new TaskData(connectionString); + TaskData taskData = new TaskData(_ConnectionString); DialogResult result = MessageBox.Show("Are you sure you want to delete this task?", "Delete Task", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result == DialogResult.Yes) { //MessageBox.Show(task.ToString(), "Task Details", MessageBoxButtons.OK, MessageBoxIcon.Information); try { - taskData.Delete(selectedTask?.GUID ?? string.Empty); + taskData.Delete(selectedTask?.GUID ?? _empty); treeViewTasks1.SelectedNode.Remove(); //_ctrl.LoadTasks(); // Reload tasks to update the DataGridView with any changes } @@ -523,7 +544,7 @@ namespace trakker } } - private void addACommentToolStripMenuItem_Click(object sender, EventArgs e) + private void PTask_AddACommentToolStripMenuItem_Click(object sender, EventArgs e) { if (treeViewTasks1.SelectedNode == null) return; PTaskFS? selectedTask = treeViewTasks1.SelectedNode.Tag as PTaskFS; @@ -538,17 +559,17 @@ namespace trakker if (result == DialogResult.OK) { if (string.IsNullOrEmpty(textAreaForm.BasicText)) return; - TaskData taskData = new TaskData(connectionString); + TaskData taskData = new TaskData(_ConnectionString); try { PTaskComment comment = new() { - TaskId = selectedTask?.GUID ?? string.Empty, - Comment = textAreaForm.BasicText ?? string.Empty, + TaskId = selectedTask?.GUID ?? _empty, + Comment = textAreaForm.BasicText ?? _empty, }; taskData.SaveComment(comment); DialogExtensions.GenericSuccess($"Comment saved successfully for task '{selectedTask!.Node}'."); - dataGridViewProjectTasks_SelectionChanged(null, null); + PTask_DataGridViewProjectTasks_SelectionChanged(null, null); } catch (Exception ex) { @@ -556,7 +577,7 @@ namespace trakker } } } - public void InitDataGridViewProjectTasks() + public void PTask_DataGridViewProjectTasks_Init() { dataGridViewProjectTasks.AllowUserToAddRows = false; dataGridViewProjectTasks.AllowUserToDeleteRows = false; @@ -681,52 +702,15 @@ namespace trakker dataGridViewProjectTasks.SelectionChanged += (s, e) => { - dataGridViewProjectTasks_SelectionChanged(s, e); + PTask_DataGridViewProjectTasks_SelectionChanged(s, e); }; dataGridViewProjectTasks.DoubleClick += (s, e) => - { // BCN - var projectIdx = dataGridViewProjects.SelectedRows[0].Index; - var taskIdx = dataGridViewProjectTasks.SelectedRows[0].Index; - - var row = dataGridViewProjectTasks.SelectedRows[0]; - if (row != null) - { - var task = dataGridViewProjectTasks.SelectedRows[0].DataBoundItem as PTask; - TaskForm dialog = new TaskForm(task!, _ctrl.GetLOV("task.status"), _ctrl.GetLOV("task.priority")); - DialogResult result = dialog.ShowDialog(this); - if (result == DialogResult.OK) - { - task = dialog.Task; - try - { - TaskData taskData = new TaskData(connectionString); - taskData.Upsert(task); - //_ctrl.LoadTasks(task.ProjectId ?? string.Empty); // Reload tasks to update the DataGridView with any changes - _ctrl.LoadProjects(); // Reload projects to update the DataGridView with any changes - _ctrl.LoadTasksRecursive(task.TaskId ?? string.Empty, PTask.RecursiveRoot.TASK_ID); // Reload tasks to update the tree view with any changes - - dataGridViewProjects.ClearSelection(); - if (projectIdx >= 0 && projectIdx < dataGridViewProjects.Rows.Count) - { - dataGridViewProjects.Rows[projectIdx].Selected = true; - } - dataGridViewProjectTasks.ClearSelection(); - if (taskIdx >= 0 && taskIdx < dataGridViewProjectTasks.Rows.Count) - { - dataGridViewProjectTasks.Rows[taskIdx].Selected = true; - } - } - catch (Exception ex) - { - MessageBox.Show($"Error saving task: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - - } + { + PTask_DataGridViewProjectTasks_DoubleClick(s, e); }; } - public void dataGridViewProjectTasks_SelectionChanged(object? sender, EventArgs? e) + public void PTask_DataGridViewProjectTasks_SelectionChanged(object? sender, EventArgs? e) { if (dataGridViewProjectTasks.SelectedRows.Count > 0) { @@ -734,8 +718,8 @@ namespace trakker var selectedTask = dataGridViewProjectTasks.SelectedRows[0].DataBoundItem as PTask; if (selectedTask != null) { - TaskData taskData = new TaskData(connectionString); - List comments = taskData.GetComments(selectedTask.TaskId ?? string.Empty); + TaskData taskData = new TaskData(_ConnectionString); + List comments = taskData.GetComments(selectedTask.TaskId ?? _empty); richTextBoxTaskComments.Clear(); foreach (var comment in comments) { @@ -744,14 +728,57 @@ namespace trakker } } } - public void FillDataGridViewProjectTasks(BindingSource tasks) + + public void PTask_DataGridViewProjectTasks_DoubleClick(object? sender, EventArgs? e) + { + var projectIdx = dataGridViewProjects.SelectedRows[0].Index; + var taskIdx = dataGridViewProjectTasks.SelectedRows[0].Index; + + var row = dataGridViewProjectTasks.SelectedRows[0]; + if (row != null) + { + var task = dataGridViewProjectTasks.SelectedRows[0].DataBoundItem as PTask; + TaskForm dialog = new TaskForm(task!, _ctrl.GetLOV("task.status"), _ctrl.GetLOV("task.priority")); + DialogResult result = dialog.ShowDialog(this); + if (result == DialogResult.OK) + { + task = dialog.Task; + try + { + TaskData taskData = new TaskData(_ConnectionString); + taskData.Upsert(task); + //_ctrl.LoadTasks(task.ProjectId ?? string.Empty); // Reload tasks to update the DataGridView with any changes + _ctrl.LoadProjects(); // Reload projects to update the DataGridView with any changes + _ctrl.LoadTasksRecursive(task.TaskId ?? _empty, PTask.RecursiveRoot.TASK_ID); // Reload tasks to update the tree view with any changes + + dataGridViewProjects.ClearSelection(); + if (projectIdx >= 0 && projectIdx < dataGridViewProjects.Rows.Count) + { + dataGridViewProjects.Rows[projectIdx].Selected = true; + } + dataGridViewProjectTasks.ClearSelection(); + if (taskIdx >= 0 && taskIdx < dataGridViewProjectTasks.Rows.Count) + { + dataGridViewProjectTasks.Rows[taskIdx].Selected = true; + } + } + catch (Exception ex) + { + MessageBox.Show($"Error saving task: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + } + } + + public void PTask_DataGridViewProjectTasks_Fill(BindingSource tasks) { //dataGridViewProjectTasks.Rows.Clear(); dataGridViewProjectTasks.DataSource = tasks; //dataGridViewProjectTasks.Refresh(); } - private void richTextBoxTaskComments_LinkClicked(object sender, LinkClickedEventArgs e) + private void PTask_RichTextBoxTaskComments_LinkClicked(object sender, LinkClickedEventArgs e) { try { diff --git a/Forms/TextAreaForm.Designer.cs b/Forms/TextAreaForm.Designer.cs index 273934b..7ae4635 100644 --- a/Forms/TextAreaForm.Designer.cs +++ b/Forms/TextAreaForm.Designer.cs @@ -1,4 +1,4 @@ -namespace newcle.us.Forms +namespace trakker.Forms { partial class TextAreaForm { diff --git a/Forms/TextAreaForm.cs b/Forms/TextAreaForm.cs index 69e22e6..6982eb3 100644 --- a/Forms/TextAreaForm.cs +++ b/Forms/TextAreaForm.cs @@ -1,7 +1,6 @@ -using newcle.us.Utilities; -using System.ComponentModel; +using System.ComponentModel; -namespace newcle.us.Forms +namespace trakker.Forms { public partial class TextAreaForm : Form { diff --git a/Interfaces/IMainForm.cs b/Interfaces/IMainForm.cs index ab8c38f..25cab1b 100644 --- a/Interfaces/IMainForm.cs +++ b/Interfaces/IMainForm.cs @@ -10,13 +10,13 @@ namespace trakker.Interfaces { internal interface IMainForm { - void InitDataGridViewClients(BindingList clients); - void InitDataGridViewProjects(); - void FillDataGridViewProjects(BindingSource projects); - void FillTreeViewTasks(List items); - void InitTreeViewTasks(); - void InitDataGridViewProjectTasks(); + void Client_DataGridViewClients_Init(BindingList clients); + void Project_DataGridViewProjects_Init(); + void Project_DataGridViewProjects_Fill(BindingSource projects); + void PTask_TreeViewTasks1_Fill(List items); + void PTask_TreeViewTasks1_Init(); + void PTask_DataGridViewProjectTasks_Init(); void InitProjectTasks(); - void FillDataGridViewProjectTasks(BindingSource tasks); + void PTask_DataGridViewProjectTasks_Fill(BindingSource tasks); } } diff --git a/Services/MainCtrl.cs b/Services/MainCtrl.cs index eea7a6c..0223258 100644 --- a/Services/MainCtrl.cs +++ b/Services/MainCtrl.cs @@ -22,9 +22,9 @@ namespace trakker.Services LoadClients(); - _view.InitDataGridViewProjectTasks(); - _view.InitDataGridViewProjects(); - _view.InitTreeViewTasks(); + _view.PTask_DataGridViewProjectTasks_Init(); + _view.Project_DataGridViewProjects_Init(); + _view.PTask_TreeViewTasks1_Init(); LoadProjects(); } @@ -42,7 +42,7 @@ namespace trakker.Services internal void LoadClients() { var clients = GetClients(); - _view.InitDataGridViewClients(clients); + _view.Client_DataGridViewClients_Init(clients); } public BindingList GetProjects() @@ -58,13 +58,13 @@ namespace trakker.Services { var x = project.Status; } - _view.FillDataGridViewProjects(new BindingSource { DataSource = projects }); + _view.Project_DataGridViewProjects_Fill(new BindingSource { DataSource = projects }); //LoadTasks(); } internal void LoadTasks(string projectId) { var dbo = new TaskData(_connectionString); - _view.FillTreeViewTasks(dbo.GetFS(projectId)); + _view.PTask_TreeViewTasks1_Fill(dbo.GetFS(projectId)); _view.InitProjectTasks(); //_view.InitDataGridViewProjectTasks(); } @@ -72,7 +72,7 @@ namespace trakker.Services { var dbo = new TaskData(_connectionString); BindingList tasks = dbo.GetRecursive(id, root); - _view.FillDataGridViewProjectTasks(new BindingSource { DataSource = tasks }); + _view.PTask_DataGridViewProjectTasks_Fill(new BindingSource { DataSource = tasks }); } diff --git a/Utilities/CurrencyExtensions.cs b/Utilities/CurrencyExtensions.cs index 66239f0..2f74d27 100644 --- a/Utilities/CurrencyExtensions.cs +++ b/Utilities/CurrencyExtensions.cs @@ -1,6 +1,6 @@ using System.Globalization; -namespace newcle.us.Utilities +namespace trakker.Utilities { public static class CurrencyExtensions { diff --git a/Utilities/DateTimeExtensions.cs b/Utilities/DateTimeExtensions.cs index a318df9..815ce62 100644 --- a/Utilities/DateTimeExtensions.cs +++ b/Utilities/DateTimeExtensions.cs @@ -1,4 +1,4 @@ -namespace newcle.us.Utilities +namespace trakker.Utilities { internal class DateTimeExtensions { diff --git a/Utilities/DialogExtensions.cs b/Utilities/DialogExtensions.cs index 3a5547b..799f88a 100644 --- a/Utilities/DialogExtensions.cs +++ b/Utilities/DialogExtensions.cs @@ -1,4 +1,4 @@ -namespace newcle.us.Utilities +namespace trakker.Utilities { internal class DialogExtensions { diff --git a/Utilities/FileExtensions.cs b/Utilities/FileExtensions.cs index 492dd5c..91f610a 100644 --- a/Utilities/FileExtensions.cs +++ b/Utilities/FileExtensions.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace newcle.us.Utilities +namespace trakker.Utilities { public class FileExtensions { diff --git a/Utilities/StringExtensions.cs b/Utilities/StringExtensions.cs index c609ea6..f0739bc 100644 --- a/Utilities/StringExtensions.cs +++ b/Utilities/StringExtensions.cs @@ -1,4 +1,4 @@ -namespace newcle.us.Utilities +namespace trakker.Utilities { public class StringExtensions {