This commit is contained in:
7
AyaNovaQBI/Form1.Designer.cs
generated
7
AyaNovaQBI/Form1.Designer.cs
generated
@@ -56,7 +56,7 @@
|
||||
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.linked = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
@@ -228,6 +228,7 @@
|
||||
this.grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.grid.Size = new System.Drawing.Size(765, 359);
|
||||
this.grid.TabIndex = 3;
|
||||
this.grid.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.grid_CellFormatting);
|
||||
//
|
||||
// status
|
||||
//
|
||||
@@ -291,6 +292,8 @@
|
||||
this.linked.HeaderText = "Linked";
|
||||
this.linked.Name = "linked";
|
||||
this.linked.ReadOnly = true;
|
||||
this.linked.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.linked.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
this.linked.Visible = false;
|
||||
this.linked.Width = 64;
|
||||
//
|
||||
@@ -345,7 +348,7 @@
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn wonumber;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn servicedate;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn project;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn linked;
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn linked;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,5 +23,24 @@ namespace AyaNovaQBI
|
||||
cbCustomersWithInvoiceableWorkorders.DisplayMember = "Name";
|
||||
grid.DataSource = util.GetInvoiceableItems();
|
||||
}
|
||||
|
||||
private void grid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
|
||||
{
|
||||
if (e.ColumnIndex == grid.Columns["Status"].Index
|
||||
&& e.Value != null)
|
||||
{
|
||||
var isLinked = (bool)grid.Rows[e.RowIndex].Cells["linked"].Value;
|
||||
|
||||
if (!isLinked)
|
||||
{
|
||||
grid.Rows[e.RowIndex].Cells["wonumber"].ErrorText = "Not invoiceable: use \"Invoice\" -> \"Fix problems\" to resolve";
|
||||
}else
|
||||
{
|
||||
grid.Rows[e.RowIndex].Cells["wonumber"].ErrorText = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,10 @@ namespace AyaNovaQBI
|
||||
|
||||
public static List<InvoiceableItem> GetInvoiceableItems()
|
||||
{
|
||||
var random = new Random();
|
||||
var l = new List<InvoiceableItem>();
|
||||
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 });
|
||||
l.Add(new InvoiceableItem { CustomerId = 1, Linked = random.Next(2) == 1, Project = "project blah", ServiceDate = DateTime.Now.ToString("s"), ServiceNumber = (40+i).ToString(), Status = "Waiting to be invoiced and just sitting there otherwise", StatusColor = "FF00FFAA", WorkorderId = 4 });
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user