Continued development
This commit is contained in:
parent
9f0303fbef
commit
222a37c0de
|
|
@ -40,9 +40,14 @@
|
||||||
textBoxName = new TextBox();
|
textBoxName = new TextBox();
|
||||||
textBoxCompany = new TextBox();
|
textBoxCompany = new TextBox();
|
||||||
textBoxEmail = new TextBox();
|
textBoxEmail = new TextBox();
|
||||||
textBoxPhone = new TextBox();
|
|
||||||
richTextBoxAddress = new RichTextBox();
|
|
||||||
comboBoxIsActive = new ComboBox();
|
comboBoxIsActive = new ComboBox();
|
||||||
|
maskedTextBox_Phone = new MaskedTextBox();
|
||||||
|
tableLayoutPanel4 = new TableLayoutPanel();
|
||||||
|
tableLayoutPanel5 = new TableLayoutPanel();
|
||||||
|
textBoxAddressCity = new TextBox();
|
||||||
|
comboBoxAddressState = new ComboBox();
|
||||||
|
maskedTextBoxAddressZipcode = new MaskedTextBox();
|
||||||
|
textBoxAddressStreet = new TextBox();
|
||||||
groupBoxNotes = new GroupBox();
|
groupBoxNotes = new GroupBox();
|
||||||
richTextBoxNotes = new RichTextBox();
|
richTextBoxNotes = new RichTextBox();
|
||||||
tableLayoutPanel3 = new TableLayoutPanel();
|
tableLayoutPanel3 = new TableLayoutPanel();
|
||||||
|
|
@ -52,6 +57,8 @@
|
||||||
groupBoxNewClient.SuspendLayout();
|
groupBoxNewClient.SuspendLayout();
|
||||||
tableLayoutPanel1.SuspendLayout();
|
tableLayoutPanel1.SuspendLayout();
|
||||||
tableLayoutPanel2.SuspendLayout();
|
tableLayoutPanel2.SuspendLayout();
|
||||||
|
tableLayoutPanel4.SuspendLayout();
|
||||||
|
tableLayoutPanel5.SuspendLayout();
|
||||||
groupBoxNotes.SuspendLayout();
|
groupBoxNotes.SuspendLayout();
|
||||||
tableLayoutPanel3.SuspendLayout();
|
tableLayoutPanel3.SuspendLayout();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
|
|
@ -98,9 +105,9 @@
|
||||||
tableLayoutPanel2.Controls.Add(textBoxName, 1, 0);
|
tableLayoutPanel2.Controls.Add(textBoxName, 1, 0);
|
||||||
tableLayoutPanel2.Controls.Add(textBoxCompany, 1, 1);
|
tableLayoutPanel2.Controls.Add(textBoxCompany, 1, 1);
|
||||||
tableLayoutPanel2.Controls.Add(textBoxEmail, 1, 2);
|
tableLayoutPanel2.Controls.Add(textBoxEmail, 1, 2);
|
||||||
tableLayoutPanel2.Controls.Add(textBoxPhone, 1, 3);
|
|
||||||
tableLayoutPanel2.Controls.Add(richTextBoxAddress, 1, 4);
|
|
||||||
tableLayoutPanel2.Controls.Add(comboBoxIsActive, 1, 5);
|
tableLayoutPanel2.Controls.Add(comboBoxIsActive, 1, 5);
|
||||||
|
tableLayoutPanel2.Controls.Add(maskedTextBox_Phone, 1, 3);
|
||||||
|
tableLayoutPanel2.Controls.Add(tableLayoutPanel4, 1, 4);
|
||||||
tableLayoutPanel2.Dock = DockStyle.Fill;
|
tableLayoutPanel2.Dock = DockStyle.Fill;
|
||||||
tableLayoutPanel2.Location = new Point(3, 3);
|
tableLayoutPanel2.Location = new Point(3, 3);
|
||||||
tableLayoutPanel2.Name = "tableLayoutPanel2";
|
tableLayoutPanel2.Name = "tableLayoutPanel2";
|
||||||
|
|
@ -179,8 +186,10 @@
|
||||||
textBoxName.Dock = DockStyle.Fill;
|
textBoxName.Dock = DockStyle.Fill;
|
||||||
textBoxName.Location = new Point(153, 3);
|
textBoxName.Location = new Point(153, 3);
|
||||||
textBoxName.Name = "textBoxName";
|
textBoxName.Name = "textBoxName";
|
||||||
|
textBoxName.PlaceholderText = "Nancy Thompson";
|
||||||
textBoxName.Size = new Size(960, 39);
|
textBoxName.Size = new Size(960, 39);
|
||||||
textBoxName.TabIndex = 6;
|
textBoxName.TabIndex = 6;
|
||||||
|
textBoxName.Validating += textBoxName_Validating;
|
||||||
//
|
//
|
||||||
// textBoxCompany
|
// textBoxCompany
|
||||||
//
|
//
|
||||||
|
|
@ -198,31 +207,92 @@
|
||||||
textBoxEmail.Size = new Size(960, 39);
|
textBoxEmail.Size = new Size(960, 39);
|
||||||
textBoxEmail.TabIndex = 8;
|
textBoxEmail.TabIndex = 8;
|
||||||
//
|
//
|
||||||
// textBoxPhone
|
|
||||||
//
|
|
||||||
textBoxPhone.Dock = DockStyle.Fill;
|
|
||||||
textBoxPhone.Location = new Point(153, 153);
|
|
||||||
textBoxPhone.Name = "textBoxPhone";
|
|
||||||
textBoxPhone.Size = new Size(960, 39);
|
|
||||||
textBoxPhone.TabIndex = 9;
|
|
||||||
//
|
|
||||||
// richTextBoxAddress
|
|
||||||
//
|
|
||||||
richTextBoxAddress.Dock = DockStyle.Fill;
|
|
||||||
richTextBoxAddress.Location = new Point(153, 203);
|
|
||||||
richTextBoxAddress.Name = "richTextBoxAddress";
|
|
||||||
richTextBoxAddress.Size = new Size(960, 94);
|
|
||||||
richTextBoxAddress.TabIndex = 10;
|
|
||||||
richTextBoxAddress.Text = "";
|
|
||||||
//
|
|
||||||
// comboBoxIsActive
|
// comboBoxIsActive
|
||||||
//
|
//
|
||||||
comboBoxIsActive.FormattingEnabled = true;
|
comboBoxIsActive.FormattingEnabled = true;
|
||||||
|
comboBoxIsActive.Items.AddRange(new object[] { "True", "False" });
|
||||||
comboBoxIsActive.Location = new Point(153, 303);
|
comboBoxIsActive.Location = new Point(153, 303);
|
||||||
comboBoxIsActive.Name = "comboBoxIsActive";
|
comboBoxIsActive.Name = "comboBoxIsActive";
|
||||||
comboBoxIsActive.Size = new Size(147, 40);
|
comboBoxIsActive.Size = new Size(147, 40);
|
||||||
comboBoxIsActive.TabIndex = 11;
|
comboBoxIsActive.TabIndex = 11;
|
||||||
//
|
//
|
||||||
|
// maskedTextBox_Phone
|
||||||
|
//
|
||||||
|
maskedTextBox_Phone.Dock = DockStyle.Fill;
|
||||||
|
maskedTextBox_Phone.Location = new Point(153, 153);
|
||||||
|
maskedTextBox_Phone.Mask = "(999) 000-0000";
|
||||||
|
maskedTextBox_Phone.Name = "maskedTextBox_Phone";
|
||||||
|
maskedTextBox_Phone.Size = new Size(960, 39);
|
||||||
|
maskedTextBox_Phone.TabIndex = 12;
|
||||||
|
//
|
||||||
|
// tableLayoutPanel4
|
||||||
|
//
|
||||||
|
tableLayoutPanel4.ColumnCount = 1;
|
||||||
|
tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
|
||||||
|
tableLayoutPanel4.Controls.Add(tableLayoutPanel5, 0, 1);
|
||||||
|
tableLayoutPanel4.Controls.Add(textBoxAddressStreet, 0, 0);
|
||||||
|
tableLayoutPanel4.Dock = DockStyle.Fill;
|
||||||
|
tableLayoutPanel4.Location = new Point(153, 203);
|
||||||
|
tableLayoutPanel4.Name = "tableLayoutPanel4";
|
||||||
|
tableLayoutPanel4.RowCount = 2;
|
||||||
|
tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
|
||||||
|
tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
|
||||||
|
tableLayoutPanel4.Size = new Size(960, 94);
|
||||||
|
tableLayoutPanel4.TabIndex = 13;
|
||||||
|
//
|
||||||
|
// tableLayoutPanel5
|
||||||
|
//
|
||||||
|
tableLayoutPanel5.ColumnCount = 3;
|
||||||
|
tableLayoutPanel5.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 70F));
|
||||||
|
tableLayoutPanel5.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 15F));
|
||||||
|
tableLayoutPanel5.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 15F));
|
||||||
|
tableLayoutPanel5.Controls.Add(textBoxAddressCity, 0, 0);
|
||||||
|
tableLayoutPanel5.Controls.Add(comboBoxAddressState, 1, 0);
|
||||||
|
tableLayoutPanel5.Controls.Add(maskedTextBoxAddressZipcode, 2, 0);
|
||||||
|
tableLayoutPanel5.Dock = DockStyle.Fill;
|
||||||
|
tableLayoutPanel5.Location = new Point(3, 50);
|
||||||
|
tableLayoutPanel5.Name = "tableLayoutPanel5";
|
||||||
|
tableLayoutPanel5.RowCount = 1;
|
||||||
|
tableLayoutPanel5.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||||
|
tableLayoutPanel5.Size = new Size(954, 41);
|
||||||
|
tableLayoutPanel5.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// textBoxAddressCity
|
||||||
|
//
|
||||||
|
textBoxAddressCity.Dock = DockStyle.Fill;
|
||||||
|
textBoxAddressCity.Location = new Point(3, 3);
|
||||||
|
textBoxAddressCity.Name = "textBoxAddressCity";
|
||||||
|
textBoxAddressCity.PlaceholderText = "Springwood";
|
||||||
|
textBoxAddressCity.Size = new Size(661, 39);
|
||||||
|
textBoxAddressCity.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// comboBoxAddressState
|
||||||
|
//
|
||||||
|
comboBoxAddressState.Dock = DockStyle.Fill;
|
||||||
|
comboBoxAddressState.FormattingEnabled = true;
|
||||||
|
comboBoxAddressState.Location = new Point(670, 3);
|
||||||
|
comboBoxAddressState.Name = "comboBoxAddressState";
|
||||||
|
comboBoxAddressState.Size = new Size(137, 40);
|
||||||
|
comboBoxAddressState.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// maskedTextBoxAddressZipcode
|
||||||
|
//
|
||||||
|
maskedTextBoxAddressZipcode.Dock = DockStyle.Fill;
|
||||||
|
maskedTextBoxAddressZipcode.Location = new Point(813, 3);
|
||||||
|
maskedTextBoxAddressZipcode.Mask = "00000";
|
||||||
|
maskedTextBoxAddressZipcode.Name = "maskedTextBoxAddressZipcode";
|
||||||
|
maskedTextBoxAddressZipcode.Size = new Size(138, 39);
|
||||||
|
maskedTextBoxAddressZipcode.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// textBoxAddressStreet
|
||||||
|
//
|
||||||
|
textBoxAddressStreet.Dock = DockStyle.Fill;
|
||||||
|
textBoxAddressStreet.Location = new Point(3, 3);
|
||||||
|
textBoxAddressStreet.Name = "textBoxAddressStreet";
|
||||||
|
textBoxAddressStreet.PlaceholderText = "1428 Elm Street";
|
||||||
|
textBoxAddressStreet.Size = new Size(954, 39);
|
||||||
|
textBoxAddressStreet.TabIndex = 1;
|
||||||
|
//
|
||||||
// groupBoxNotes
|
// groupBoxNotes
|
||||||
//
|
//
|
||||||
groupBoxNotes.Controls.Add(richTextBoxNotes);
|
groupBoxNotes.Controls.Add(richTextBoxNotes);
|
||||||
|
|
@ -304,6 +374,10 @@
|
||||||
tableLayoutPanel1.ResumeLayout(false);
|
tableLayoutPanel1.ResumeLayout(false);
|
||||||
tableLayoutPanel2.ResumeLayout(false);
|
tableLayoutPanel2.ResumeLayout(false);
|
||||||
tableLayoutPanel2.PerformLayout();
|
tableLayoutPanel2.PerformLayout();
|
||||||
|
tableLayoutPanel4.ResumeLayout(false);
|
||||||
|
tableLayoutPanel4.PerformLayout();
|
||||||
|
tableLayoutPanel5.ResumeLayout(false);
|
||||||
|
tableLayoutPanel5.PerformLayout();
|
||||||
groupBoxNotes.ResumeLayout(false);
|
groupBoxNotes.ResumeLayout(false);
|
||||||
tableLayoutPanel3.ResumeLayout(false);
|
tableLayoutPanel3.ResumeLayout(false);
|
||||||
tableLayoutPanel3.PerformLayout();
|
tableLayoutPanel3.PerformLayout();
|
||||||
|
|
@ -325,13 +399,18 @@
|
||||||
private TextBox textBoxName;
|
private TextBox textBoxName;
|
||||||
private TextBox textBoxCompany;
|
private TextBox textBoxCompany;
|
||||||
private TextBox textBoxEmail;
|
private TextBox textBoxEmail;
|
||||||
private TextBox textBoxPhone;
|
|
||||||
private RichTextBox richTextBoxAddress;
|
|
||||||
private ComboBox comboBoxIsActive;
|
private ComboBox comboBoxIsActive;
|
||||||
private RichTextBox richTextBoxNotes;
|
private RichTextBox richTextBoxNotes;
|
||||||
private TableLayoutPanel tableLayoutPanel3;
|
private TableLayoutPanel tableLayoutPanel3;
|
||||||
private Button buttonOkay;
|
private Button buttonOkay;
|
||||||
private Button buttonCancel;
|
private Button buttonCancel;
|
||||||
private Label labelCreatedUpdatedDT;
|
private Label labelCreatedUpdatedDT;
|
||||||
|
private MaskedTextBox maskedTextBox_Phone;
|
||||||
|
private TableLayoutPanel tableLayoutPanel4;
|
||||||
|
private TableLayoutPanel tableLayoutPanel5;
|
||||||
|
private TextBox textBoxAddressCity;
|
||||||
|
private ComboBox comboBoxAddressState;
|
||||||
|
private MaskedTextBox maskedTextBoxAddressZipcode;
|
||||||
|
private TextBox textBoxAddressStreet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,20 +1,42 @@
|
||||||
using System;
|
using System.Reflection.Metadata.Ecma335;
|
||||||
using System.Collections.Generic;
|
using trakker.Models;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace trakker.Forms
|
namespace trakker.Forms
|
||||||
{
|
{
|
||||||
public partial class ClientForm : Form
|
public partial class ClientForm : Form
|
||||||
{
|
{
|
||||||
public ClientForm()
|
private readonly Client _client;
|
||||||
|
private BindingSource bindingSource = new BindingSource();
|
||||||
|
private ErrorProvider errorProvider = new ErrorProvider();
|
||||||
|
|
||||||
|
public ClientForm(Client client)
|
||||||
{
|
{
|
||||||
|
_client = client;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
bindingSource.DataSource = _client;
|
||||||
|
textBoxName.DataBindings.Add("Text", bindingSource, "Name", true);
|
||||||
|
textBoxCompany.DataBindings.Add("Text", bindingSource, "Company", true);
|
||||||
|
textBoxEmail.DataBindings.Add("Text", bindingSource, "Email", true);
|
||||||
|
maskedTextBox_Phone.DataBindings.Add("Text", bindingSource, "Phone", true);
|
||||||
|
//richTextBoxAddress.DataBindings.Add("Text", bindingSource, "Address", true);
|
||||||
|
comboBoxIsActive.DataBindings.Add("Text", bindingSource, "IsActive", true);
|
||||||
|
richTextBoxNotes.DataBindings.Add("Text", bindingSource, "Notes", true);
|
||||||
|
|
||||||
|
}
|
||||||
|
public Client Client { get => _client; private set { } }
|
||||||
|
|
||||||
|
private void textBoxName_Validating(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(textBoxName.Text))
|
||||||
|
{
|
||||||
|
errorProvider.SetError(textBoxName, "Name is required.");
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errorProvider.SetError(textBoxName, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
using trakker.Forms;
|
using trakker.Forms;
|
||||||
|
using trakker.Models;
|
||||||
|
|
||||||
namespace trakker
|
namespace trakker
|
||||||
{
|
{
|
||||||
public partial class MainForm : Form
|
public partial class MainForm : Form
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="MainForm"/> class.
|
/// Initializes a new instance of the <see cref="MainForm"/> class.
|
||||||
/// Sets up the form's controls and event handlers by calling
|
/// Sets up the form's controls and event handlers by calling
|
||||||
|
|
@ -11,6 +13,7 @@ namespace trakker
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MainForm()
|
public MainForm()
|
||||||
{
|
{
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -27,8 +30,12 @@ namespace trakker
|
||||||
|
|
||||||
private void button1_Click(object sender, EventArgs e)
|
private void button1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var dialog = new ClientForm();
|
Client client = new Client();
|
||||||
dialog.ShowDialog();
|
client.ClientId = Guid.NewGuid().ToString();
|
||||||
|
var dialog = new ClientForm(client);
|
||||||
|
dialog.ShowDialog(this);
|
||||||
|
client = dialog.Client;
|
||||||
|
MessageBox.Show($"Client Name: {client.Name}\nCompany: {client.Company}\nEmail: {client.Email}\nPhone: {client.Phone}\nAddress: {client.Address}\nIs Active: {client.IsActive}\nNotes: {client.Notes}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace YourProject.Models
|
namespace trakker.Models
|
||||||
{
|
{
|
||||||
public class Client
|
public class Client
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace YourProject.Models
|
namespace trakker.Models
|
||||||
{
|
{
|
||||||
public class Project
|
public class Project
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace YourProject.Models
|
namespace trakker.Models
|
||||||
{
|
{
|
||||||
public class TimeEntry
|
public class TimeEntry
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue