This commit is contained in:
2022-06-18 01:43:24 +00:00
parent ab28b85e14
commit 4a27b638c2
7 changed files with 146 additions and 3 deletions

View File

@@ -58,6 +58,7 @@
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="InvoiceableItem.cs" />
<Compile Include="NameIdItem.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="util.cs" />

View File

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

View File

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

View File

@@ -120,6 +120,30 @@
<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="status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="statuscolor.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="workorderid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="customerid.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="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>
<metadata name="linked.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

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

17
AyaNovaQBI/NameIdItem.cs Normal file
View File

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

View File

@@ -12,10 +12,18 @@ namespace AyaNovaQBI
public static List<InvoiceableItem> GetInvoiceableItems()
{
var l = new List<InvoiceableItem>();
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<NameIdItem> GetCustomersWithInvoiceableItems()
{
var l = new List<NameIdItem>();
for (int i = 0; i < 10; i++)
l.Add(new NameIdItem { Id = i, Name = "Customer " + i.ToString() });
return l;
}
}
}