diff --git a/AyaNovaQBI/AyaNovaQBI.csproj b/AyaNovaQBI/AyaNovaQBI.csproj index 3cbaa38..64d95cd 100644 --- a/AyaNovaQBI/AyaNovaQBI.csproj +++ b/AyaNovaQBI/AyaNovaQBI.csproj @@ -58,6 +58,7 @@ Form1.cs + diff --git a/AyaNovaQBI/Form1.Designer.cs b/AyaNovaQBI/Form1.Designer.cs index 64e76ee..1cb7a00 100644 --- a/AyaNovaQBI/Form1.Designer.cs +++ b/AyaNovaQBI/Form1.Designer.cs @@ -49,6 +49,14 @@ this.cbCustomersWithInvoiceableWorkorders = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.grid = new System.Windows.Forms.DataGridView(); + this.status = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.statuscolor = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.workorderid = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.customerid = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.wonumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.servicedate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.project = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.linked = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.menuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit(); this.SuspendLayout(); @@ -204,13 +212,88 @@ this.grid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.grid.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; this.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.grid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.status, + this.statuscolor, + this.workorderid, + this.customerid, + this.wonumber, + this.servicedate, + this.project, + this.linked}); this.grid.Location = new System.Drawing.Point(13, 103); this.grid.Name = "grid"; this.grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.grid.Size = new System.Drawing.Size(765, 359); this.grid.TabIndex = 3; // + // status + // + this.status.DataPropertyName = "Status"; + this.status.HeaderText = "Status"; + this.status.Name = "status"; + this.status.ReadOnly = true; + this.status.Width = 62; + // + // statuscolor + // + this.statuscolor.DataPropertyName = "StatusColor"; + this.statuscolor.HeaderText = "statuscolor"; + this.statuscolor.Name = "statuscolor"; + this.statuscolor.Visible = false; + this.statuscolor.Width = 83; + // + // workorderid + // + this.workorderid.DataPropertyName = "WorkorderId"; + this.workorderid.HeaderText = "workorderid"; + this.workorderid.Name = "workorderid"; + this.workorderid.Visible = false; + this.workorderid.Width = 87; + // + // customerid + // + this.customerid.DataPropertyName = "CustomerId"; + this.customerid.HeaderText = "customerid"; + this.customerid.Name = "customerid"; + this.customerid.Visible = false; + this.customerid.Width = 83; + // + // wonumber + // + this.wonumber.DataPropertyName = "ServiceNumber"; + this.wonumber.HeaderText = "Service number"; + this.wonumber.Name = "wonumber"; + this.wonumber.ReadOnly = true; + this.wonumber.Width = 97; + // + // servicedate + // + this.servicedate.DataPropertyName = "ServiceDate"; + this.servicedate.HeaderText = "Service date"; + this.servicedate.Name = "servicedate"; + this.servicedate.ReadOnly = true; + this.servicedate.Width = 85; + // + // project + // + this.project.DataPropertyName = "Project"; + this.project.HeaderText = "Project"; + this.project.Name = "project"; + this.project.ReadOnly = true; + this.project.Width = 65; + // + // linked + // + this.linked.DataPropertyName = "Linked"; + this.linked.HeaderText = "Linked"; + this.linked.Name = "linked"; + this.linked.ReadOnly = true; + this.linked.Visible = false; + this.linked.Width = 64; + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -255,6 +338,14 @@ private System.Windows.Forms.ComboBox cbCustomersWithInvoiceableWorkorders; private System.Windows.Forms.Label label1; private System.Windows.Forms.DataGridView grid; + private System.Windows.Forms.DataGridViewTextBoxColumn status; + private System.Windows.Forms.DataGridViewTextBoxColumn statuscolor; + private System.Windows.Forms.DataGridViewTextBoxColumn workorderid; + private System.Windows.Forms.DataGridViewTextBoxColumn customerid; + private System.Windows.Forms.DataGridViewTextBoxColumn wonumber; + private System.Windows.Forms.DataGridViewTextBoxColumn servicedate; + private System.Windows.Forms.DataGridViewTextBoxColumn project; + private System.Windows.Forms.DataGridViewTextBoxColumn linked; } } diff --git a/AyaNovaQBI/Form1.cs b/AyaNovaQBI/Form1.cs index f782e60..dab3a2f 100644 --- a/AyaNovaQBI/Form1.cs +++ b/AyaNovaQBI/Form1.cs @@ -19,6 +19,8 @@ namespace AyaNovaQBI private void MainForm_Load(object sender, EventArgs e) { + cbCustomersWithInvoiceableWorkorders.DataSource = util.GetCustomersWithInvoiceableItems(); + cbCustomersWithInvoiceableWorkorders.DisplayMember = "Name"; grid.DataSource = util.GetInvoiceableItems(); } } diff --git a/AyaNovaQBI/Form1.resx b/AyaNovaQBI/Form1.resx index 1b0cee2..0099a85 100644 --- a/AyaNovaQBI/Form1.resx +++ b/AyaNovaQBI/Form1.resx @@ -120,6 +120,30 @@ 17, 17 + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + diff --git a/AyaNovaQBI/InvoiceableItem.cs b/AyaNovaQBI/InvoiceableItem.cs index 09b2905..3bc66e1 100644 --- a/AyaNovaQBI/InvoiceableItem.cs +++ b/AyaNovaQBI/InvoiceableItem.cs @@ -10,7 +10,7 @@ namespace AyaNovaQBI { public string Status { get; set; } public string ServiceNumber { get; set; } - public DateTime ServiceDate { get; set; } + public string ServiceDate { get; set; } public string Project { get; set; } public string StatusColor { get; set; } diff --git a/AyaNovaQBI/NameIdItem.cs b/AyaNovaQBI/NameIdItem.cs new file mode 100644 index 0000000..6b50259 --- /dev/null +++ b/AyaNovaQBI/NameIdItem.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AyaNovaQBI +{ + + public class NameIdItem + { + public long Id { get; set; } + public string Name { get; set; } + } + + +} diff --git a/AyaNovaQBI/util.cs b/AyaNovaQBI/util.cs index a47c18f..4f210a0 100644 --- a/AyaNovaQBI/util.cs +++ b/AyaNovaQBI/util.cs @@ -12,10 +12,18 @@ namespace AyaNovaQBI public static List GetInvoiceableItems() { var l = new List(); - for(int i = 0; i < 10; i++) - l.Add(new InvoiceableItem { CustomerId = 1, Linked = true, Project = "project blah", ServiceDate = new DateTime(), ServiceNumber = "44", Status = "Waiting to be invoiced", StatusColor = "FF00FFAA", WorkorderId = 4 }); + for (int i = 0; i < 10; i++) + l.Add(new InvoiceableItem { CustomerId = 1, Linked = true, Project = "project blah", ServiceDate = DateTime.Now.ToString("s"), ServiceNumber = "44", Status = "Waiting to be invoiced and just sitting there otherwise", StatusColor = "FF00FFAA", WorkorderId = 4 }); return l; } + + public static List GetCustomersWithInvoiceableItems() + { + var l = new List(); + for (int i = 0; i < 10; i++) + l.Add(new NameIdItem { Id = i, Name = "Customer " + i.ToString() }); + return l; + } } }