From 38214e8c5ec3608dbbe8807149150a9bdee371fa Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 18 Jun 2022 03:11:59 +0000 Subject: [PATCH] --- AyaNovaQBI/Form1.Designer.cs | 56 ++++++++++++++++-------------------- AyaNovaQBI/Form1.resx | 8 +++--- AyaNovaQBI/util.cs | 3 +- 3 files changed, 30 insertions(+), 37 deletions(-) diff --git a/AyaNovaQBI/Form1.Designer.cs b/AyaNovaQBI/Form1.Designer.cs index 805c299..4ee4109 100644 --- a/AyaNovaQBI/Form1.Designer.cs +++ b/AyaNovaQBI/Form1.Designer.cs @@ -49,13 +49,13 @@ this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.grid = new System.Windows.Forms.DataGridView(); - this.wonumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.customer = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.wonumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.servicedate = new System.Windows.Forms.DataGridViewTextBoxColumn(); 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.servicedate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.project = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.linked = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.menuStrip1.SuspendLayout(); @@ -193,9 +193,10 @@ // this.grid.AllowUserToAddRows = false; this.grid.AllowUserToDeleteRows = false; + this.grid.AllowUserToResizeRows = false; dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; this.grid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; - this.grid.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; + this.grid.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -206,13 +207,13 @@ this.grid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.grid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.wonumber, this.customer, + this.wonumber, + this.servicedate, this.status, this.statuscolor, this.workorderid, this.customerid, - this.servicedate, this.project, this.linked}); this.grid.Dock = System.Windows.Forms.DockStyle.Fill; @@ -225,15 +226,6 @@ this.grid.TabIndex = 3; this.grid.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.grid_CellFormatting); // - // wonumber - // - this.wonumber.DataPropertyName = "ServiceNumber"; - this.wonumber.HeaderText = "Service number"; - this.wonumber.Name = "wonumber"; - this.wonumber.ReadOnly = true; - this.wonumber.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - this.wonumber.Width = 78; - // // customer // this.customer.DataPropertyName = "Customer"; @@ -241,7 +233,22 @@ this.customer.Name = "customer"; this.customer.ReadOnly = true; this.customer.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - this.customer.Width = 57; + // + // wonumber + // + this.wonumber.DataPropertyName = "ServiceNumber"; + this.wonumber.HeaderText = "Service number"; + this.wonumber.Name = "wonumber"; + this.wonumber.ReadOnly = true; + this.wonumber.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + // + // servicedate + // + this.servicedate.DataPropertyName = "ServiceDate"; + this.servicedate.HeaderText = "Service date"; + this.servicedate.Name = "servicedate"; + this.servicedate.ReadOnly = true; + this.servicedate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // status // @@ -250,7 +257,6 @@ this.status.Name = "status"; this.status.ReadOnly = true; this.status.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - this.status.Width = 43; // // statuscolor // @@ -260,7 +266,6 @@ this.statuscolor.ReadOnly = true; this.statuscolor.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; this.statuscolor.Visible = false; - this.statuscolor.Width = 64; // // workorderid // @@ -270,7 +275,6 @@ this.workorderid.ReadOnly = true; this.workorderid.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; this.workorderid.Visible = false; - this.workorderid.Width = 68; // // customerid // @@ -280,16 +284,6 @@ this.customerid.ReadOnly = true; this.customerid.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; this.customerid.Visible = false; - this.customerid.Width = 64; - // - // servicedate - // - this.servicedate.DataPropertyName = "ServiceDate"; - this.servicedate.HeaderText = "Service date"; - this.servicedate.Name = "servicedate"; - this.servicedate.ReadOnly = true; - this.servicedate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - this.servicedate.Width = 66; // // project // @@ -298,7 +292,6 @@ this.project.Name = "project"; this.project.ReadOnly = true; this.project.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - this.project.Width = 46; // // linked // @@ -308,7 +301,6 @@ this.linked.ReadOnly = true; this.linked.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.linked.Visible = false; - this.linked.Width = 45; // // MainForm // @@ -350,13 +342,13 @@ private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; private System.Windows.Forms.DataGridView grid; - private System.Windows.Forms.DataGridViewTextBoxColumn wonumber; private System.Windows.Forms.DataGridViewTextBoxColumn customer; + private System.Windows.Forms.DataGridViewTextBoxColumn wonumber; + private System.Windows.Forms.DataGridViewTextBoxColumn servicedate; 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 servicedate; private System.Windows.Forms.DataGridViewTextBoxColumn project; private System.Windows.Forms.DataGridViewCheckBoxColumn linked; } diff --git a/AyaNovaQBI/Form1.resx b/AyaNovaQBI/Form1.resx index 1c65a24..a28bb51 100644 --- a/AyaNovaQBI/Form1.resx +++ b/AyaNovaQBI/Form1.resx @@ -120,10 +120,13 @@ 17, 17 + + True + True - + True @@ -138,9 +141,6 @@ True - - True - True diff --git a/AyaNovaQBI/util.cs b/AyaNovaQBI/util.cs index 4753583..6c9dda3 100644 --- a/AyaNovaQBI/util.cs +++ b/AyaNovaQBI/util.cs @@ -14,10 +14,11 @@ namespace AyaNovaQBI var random = new Random(); var l = new List(); for (int i = 1; i < random.Next(25, 100); i++) - l.Add(new InvoiceableItem { Customer = $"Customer {random.Next(1, 5)}", Linked = random.Next(2) == 1, Project = $"project {i}", ServiceDate = DateTime.Now.ToString("s"), ServiceNumber = (40 + i).ToString(), Status = $"Waiting to be invoiced", StatusColor = "FF00FFAA", WorkorderId = 4 }); + l.Add(new InvoiceableItem { Customer = $"Customer {random.Next(1, 5)}", Linked = random.Next(2) == 1, Project = $"project {i}", ServiceDate = DateTime.Now.ToString("g"), ServiceNumber = (40 + i).ToString(), Status = $"Waiting to be invoiced", StatusColor = "FF00FFAA", WorkorderId = 4 }); return l.OrderBy(x => x.Customer) .ThenBy(x => x.ServiceNumber) + .ThenBy(x=>x.ServiceDate) .ToList(); }