This commit is contained in:
2022-06-18 03:11:59 +00:00
parent 8b40faea04
commit 38214e8c5e
3 changed files with 30 additions and 37 deletions

View File

@@ -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;
}

View File

@@ -120,10 +120,13 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="customer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="wonumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="customer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="servicedate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -138,9 +141,6 @@
<metadata name="customerid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="servicedate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="project.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>

View File

@@ -14,10 +14,11 @@ namespace AyaNovaQBI
var random = new Random();
var l = new List<InvoiceableItem>();
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();
}