This commit is contained in:
1
AyaNovaQBI/Form1.Designer.cs
generated
1
AyaNovaQBI/Form1.Designer.cs
generated
@@ -198,6 +198,7 @@
|
||||
this.cbCustomersWithInvoiceableWorkorders.Name = "cbCustomersWithInvoiceableWorkorders";
|
||||
this.cbCustomersWithInvoiceableWorkorders.Size = new System.Drawing.Size(765, 21);
|
||||
this.cbCustomersWithInvoiceableWorkorders.TabIndex = 1;
|
||||
this.cbCustomersWithInvoiceableWorkorders.SelectedIndexChanged += new System.EventHandler(this.cbCustomersWithInvoiceableWorkorders_SelectedIndexChanged);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace AyaNovaQBI
|
||||
{
|
||||
cbCustomersWithInvoiceableWorkorders.DataSource = util.GetCustomersWithInvoiceableItems();
|
||||
cbCustomersWithInvoiceableWorkorders.DisplayMember = "Name";
|
||||
grid.DataSource = util.GetInvoiceableItems();
|
||||
// grid.DataSource = util.GetInvoiceableItems();
|
||||
}
|
||||
|
||||
private void grid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
|
||||
@@ -47,5 +47,16 @@ namespace AyaNovaQBI
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void cbCustomersWithInvoiceableWorkorders_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (cbCustomersWithInvoiceableWorkorders.SelectedValue != null)
|
||||
{
|
||||
var selectedNameIdItem = cbCustomersWithInvoiceableWorkorders.SelectedValue as NameIdItem;
|
||||
grid.DataSource = util.GetInvoiceableItems(selectedNameIdItem.Name);
|
||||
}
|
||||
else
|
||||
grid.DataSource = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,20 +9,21 @@ namespace AyaNovaQBI
|
||||
internal class util
|
||||
{
|
||||
|
||||
public static List<InvoiceableItem> GetInvoiceableItems()
|
||||
public static List<InvoiceableItem> GetInvoiceableItems(string customerName)
|
||||
{
|
||||
var random = new Random();
|
||||
var l = new List<InvoiceableItem>();
|
||||
for (int i = 1; i < 100; i++)
|
||||
l.Add(new InvoiceableItem { CustomerId = 1, Linked = random.Next(2) == 1, Project = $"project {i}", ServiceDate = DateTime.Now.ToString("s"), ServiceNumber = (40+i).ToString(), Status = "Waiting to be invoiced and just sitting there otherwise", StatusColor = "FF00FFAA", WorkorderId = 4 });
|
||||
for (int i = 1; i < random.Next(3,100); i++)
|
||||
l.Add(new InvoiceableItem { CustomerId = 1, Linked = random.Next(2) == 1, Project = $"project {i}", ServiceDate = DateTime.Now.ToString("s"), ServiceNumber = (40+i).ToString(), Status = $"Waiting to be invoiced ({customerName})", StatusColor = "FF00FFAA", WorkorderId = 4 });
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
public static List<NameIdItem> GetCustomersWithInvoiceableItems()
|
||||
{
|
||||
var random = new Random();
|
||||
var l = new List<NameIdItem>();
|
||||
for (int i = 1; i < 100; i++)
|
||||
for (int i = 1; i < random.Next(5,100); i++)
|
||||
l.Add(new NameIdItem { Id = i, Name = $"Customer {i}"});
|
||||
return l;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user