This commit is contained in:
@@ -44,7 +44,6 @@ namespace AyaNovaQBI
|
||||
}
|
||||
|
||||
Text = "AyaNova QBI - " + util.QCompanyName;
|
||||
InitializeGrid();
|
||||
//See if there are *any* data mappings, if not then we will prompt the user to start that process
|
||||
if (util.QBIntegration.Items.Count == 0)
|
||||
{
|
||||
@@ -172,165 +171,6 @@ namespace AyaNovaQBI
|
||||
b.Dispose();
|
||||
}
|
||||
|
||||
|
||||
#region DataSet stuff
|
||||
//private DataSet dsInvoices;
|
||||
//private DataTable Invoices;
|
||||
//private DataColumn Client;
|
||||
//private DataColumn WorkingID;
|
||||
//private DataColumn Linked;
|
||||
//private DataColumn ClientID;
|
||||
//private DataTable Workorders;
|
||||
//private DataColumn InvoiceWorkingID;
|
||||
//private DataColumn WorkorderID;
|
||||
//private DataColumn wostatus;
|
||||
//private DataColumn ServiceNumber;
|
||||
//private DataColumn ServiceDate;
|
||||
//private DataColumn Project;
|
||||
//private DataColumn StatusARGB;
|
||||
//private DataColumn dataColumn1;
|
||||
//private void InitDataSet()
|
||||
//{
|
||||
// dsInvoices = new DataSet();
|
||||
// Invoices = new DataTable();
|
||||
// Client = new DataColumn();
|
||||
// WorkingID = new DataColumn();
|
||||
// Linked = new DataColumn();
|
||||
// ClientID = new DataColumn();
|
||||
// Workorders = new DataTable();
|
||||
// InvoiceWorkingID = new DataColumn();
|
||||
// WorkorderID = new DataColumn();
|
||||
// wostatus = new DataColumn();
|
||||
// ServiceNumber = new DataColumn();
|
||||
// ServiceDate = new DataColumn();
|
||||
// Project = new DataColumn();
|
||||
// StatusARGB = new DataColumn();
|
||||
// dataColumn1 = new DataColumn();
|
||||
// //
|
||||
// // dsInvoices
|
||||
// //
|
||||
// dsInvoices.DataSetName = "Invoices";
|
||||
// dsInvoices.Locale = new System.Globalization.CultureInfo("en-US");
|
||||
// dsInvoices.Relations.AddRange(new DataRelation[] {
|
||||
// new DataRelation("Relation1", "Invoices", "Workorders", new string[] {
|
||||
// "WorkingID"}, new string[] {
|
||||
// "InvoiceWorkingID"}, false)});
|
||||
// dsInvoices.Tables.AddRange(new DataTable[] {
|
||||
// Invoices,
|
||||
// Workorders});
|
||||
// //
|
||||
// // Invoices
|
||||
// //
|
||||
// Invoices.Columns.AddRange(new DataColumn[] {
|
||||
// Client,
|
||||
// WorkingID,
|
||||
// Linked,
|
||||
// ClientID});
|
||||
// Invoices.Constraints.AddRange(new Constraint[] {
|
||||
// new UniqueConstraint("Constraint1", new string[] {
|
||||
// "WorkingID"}, true)});
|
||||
// Invoices.PrimaryKey = new DataColumn[] {
|
||||
//WorkingID};
|
||||
// Invoices.TableName = "Invoices";
|
||||
// //
|
||||
// // Client
|
||||
// //
|
||||
// Client.ColumnName = "Client";
|
||||
// //
|
||||
// // WorkingID
|
||||
// //
|
||||
// WorkingID.AllowDBNull = false;
|
||||
// WorkingID.AutoIncrement = true;
|
||||
// WorkingID.Caption = "WorkingID";
|
||||
// WorkingID.ColumnName = "WorkingID";
|
||||
// WorkingID.DataType = typeof(int);
|
||||
// WorkingID.ReadOnly = true;
|
||||
// //
|
||||
// // Linked
|
||||
// //
|
||||
// Linked.Caption = "Linked";
|
||||
// Linked.ColumnName = "Linked";
|
||||
// Linked.DataType = typeof(bool);
|
||||
// Linked.DefaultValue = false;
|
||||
// //
|
||||
// // ClientID
|
||||
// //
|
||||
// ClientID.Caption = "ClientID";
|
||||
// ClientID.ColumnName = "ClientID";
|
||||
// ClientID.DataType = typeof(System.Guid);
|
||||
// //
|
||||
// // Workorders
|
||||
// //
|
||||
// Workorders.Columns.AddRange(new DataColumn[] {
|
||||
// InvoiceWorkingID,
|
||||
// WorkorderID,
|
||||
// wostatus,
|
||||
// ServiceNumber,
|
||||
// ServiceDate,
|
||||
// Project,
|
||||
// StatusARGB,
|
||||
// dataColumn1});
|
||||
// Workorders.Constraints.AddRange(new Constraint[] {
|
||||
// new UniqueConstraint("Constraint1", new string[] {
|
||||
// "WorkorderID"}, true),
|
||||
// new ForeignKeyConstraint("Relation1", "Invoices", new string[] {
|
||||
// "WorkingID"}, new string[] {
|
||||
// "InvoiceWorkingID"}, AcceptRejectRule.None, Rule.None, Rule.None)});
|
||||
// Workorders.PrimaryKey = new DataColumn[] {
|
||||
//WorkorderID};
|
||||
// Workorders.TableName = "Workorders";
|
||||
// //
|
||||
// // InvoiceWorkingID
|
||||
// //
|
||||
// InvoiceWorkingID.Caption = "InvoiceWorkingID";
|
||||
// InvoiceWorkingID.ColumnName = "InvoiceWorkingID";
|
||||
// InvoiceWorkingID.DataType = typeof(int);
|
||||
// //
|
||||
// // WorkorderID
|
||||
// //
|
||||
// WorkorderID.AllowDBNull = false;
|
||||
// WorkorderID.Caption = "WorkorderID";
|
||||
// WorkorderID.ColumnName = "WorkorderID";
|
||||
// WorkorderID.DataType = typeof(System.Guid);
|
||||
// //
|
||||
// // wostatus
|
||||
// //
|
||||
// wostatus.Caption = "Status";
|
||||
// wostatus.ColumnName = "Status";
|
||||
// //
|
||||
// // ServiceNumber
|
||||
// //
|
||||
// ServiceNumber.Caption = "ServiceNumber";
|
||||
// ServiceNumber.ColumnName = "ServiceNumber";
|
||||
// ServiceNumber.DataType = typeof(int);
|
||||
// //
|
||||
// // ServiceDate
|
||||
// //
|
||||
// ServiceDate.Caption = "ServiceDate";
|
||||
// ServiceDate.ColumnName = "ServiceDate";
|
||||
// ServiceDate.DataType = typeof(object);
|
||||
// //
|
||||
// // Project
|
||||
// //
|
||||
// Project.Caption = "Project";
|
||||
// Project.ColumnName = "Project";
|
||||
// //
|
||||
// // StatusARGB
|
||||
// //
|
||||
// StatusARGB.Caption = "StatusARGB";
|
||||
// StatusARGB.ColumnName = "StatusARGB";
|
||||
// StatusARGB.DataType = typeof(int);
|
||||
// //
|
||||
// // dataColumn1
|
||||
// //
|
||||
// dataColumn1.ColumnName = "Linked";
|
||||
// dataColumn1.DataType = typeof(bool);
|
||||
// dataColumn1.DefaultValue = false;
|
||||
//}
|
||||
|
||||
#endregion dataset stuff
|
||||
|
||||
|
||||
#region Main workorder grid
|
||||
|
||||
/// <summary>
|
||||
@@ -376,20 +216,7 @@ namespace AyaNovaQBI
|
||||
lblStatus.Visible = true;
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
POST /api/v8.0/data-list
|
||||
{"offset":0,"limit":10,"dataListKey":"WorkOrderDataList","filterId":6,"clientTimeStamp":"2022-07-08T10:49:18.715-07:00"}
|
||||
|
||||
data-list-column-view:
|
||||
{"userId":1,"listKey":"WorkOrderDataList","columns":"[\"WorkOrderSerialNumber\",\"Customer\",\"WorkOrderServiceDate\",\"WorkOrderCloseByDate\",\"WorkOrderStatus\",\"Project\",\"WorkOrderAge\",\"WorkOrderInvoiceNumber\"]","sort":"{\"WorkOrderSerialNumber\":\"-\"}"}
|
||||
|
||||
data-list-filter
|
||||
filter "[{\"column\":\"WorkOrderInvoiceNumber\",\"any\":false,\"items\":[{\"op\":\"=\",\"value\":\"*NULL*\"}]}]"
|
||||
|
||||
*/
|
||||
|
||||
//private BindingList<WorkOrderGridListItem> _WorkOrderGridListItems = new BindingList<WorkOrderGridListItem>();
|
||||
|
||||
private DataTable _GridTable = null;
|
||||
private List<util.MisMatch> _MisMatches = new List<util.MisMatch>();
|
||||
private List<long> _PartPriceOverrides = new List<long>();
|
||||
@@ -411,15 +238,19 @@ namespace AyaNovaQBI
|
||||
//datatable is required to support sorting in dgv without writing a lot of extra code
|
||||
_GridTable = new DataTable();
|
||||
_GridTable.Columns.Add(new DataColumn("CustomerName"));
|
||||
_GridTable.Columns.Add(new DataColumn("Serial"));
|
||||
_GridTable.Columns.Add(new DataColumn("Serial", typeof(long)));
|
||||
_GridTable.Columns.Add(new DataColumn("ServiceDate", typeof(DateTime)));
|
||||
_GridTable.Columns.Add(new DataColumn("WorkorderStatusName"));
|
||||
_GridTable.Columns.Add(new DataColumn("ProjectName"));
|
||||
_GridTable.Columns.Add(new DataColumn("Color"));
|
||||
_GridTable.Columns.Add(new DataColumn("CustomerId"));
|
||||
_GridTable.Columns.Add(new DataColumn("Id"));
|
||||
_GridTable.Columns.Add(new DataColumn("CustomerId", typeof(long)));
|
||||
_GridTable.Columns.Add(new DataColumn("Id", typeof(long)));
|
||||
_GridTable.Columns.Add(new DataColumn("Linked", typeof(bool)));
|
||||
}
|
||||
else
|
||||
{
|
||||
_GridTable.Clear();
|
||||
}
|
||||
_MisMatches.Clear();
|
||||
|
||||
//[HttpGet("accounting-list-billable/{workOrderStatusId}")]
|
||||
@@ -439,86 +270,14 @@ namespace AyaNovaQBI
|
||||
row["CustomerId"] = z.CustomerId;
|
||||
row["Id"] = z.Id;
|
||||
row["Linked"]= util.ScanLinksOK(z.Id, _MisMatches, _PartPriceOverrides);
|
||||
|
||||
_GridTable.Rows.Add(row);
|
||||
}
|
||||
|
||||
grid.DataSource = _GridTable;
|
||||
|
||||
//foreach (WorkOrderAccountingListItem z in v)
|
||||
//{
|
||||
// _WorkOrderGridListItems.Add(new WorkOrderGridListItem
|
||||
// {
|
||||
// Color = z.Color,
|
||||
// CustomerId = z.CustomerId,
|
||||
// CustomerName = z.CustomerName,
|
||||
// Id = z.Id,
|
||||
// ProjectName = z.ProjectName,
|
||||
// Serial = z.Serial,
|
||||
// ServiceDate = z.ServiceDate,
|
||||
// WorkorderStatusName = z.WorkorderStatusName
|
||||
// });
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//foreach (WorkOrderGridListItem i in _WorkOrderGridListItems)
|
||||
//{
|
||||
// w.Step = "WO: " + i.Serial;
|
||||
// i.Linked = util.ScanLinksOK(i.Id, _MisMatches, _PartPriceOverrides);
|
||||
// //DataRow dri = InvoiceRowForClientID(i.ClientID);
|
||||
|
||||
// //if (dri == null)
|
||||
// //{
|
||||
// // dri = dtInvoice.NewRow();
|
||||
// // dri["Client"] = i.Client;
|
||||
// // dri["ClientID"] = i.ClientID;
|
||||
// // dtInvoice.Rows.Add(dri);
|
||||
//}
|
||||
|
||||
//If any one single workorder is linked
|
||||
//then the invoice is flagged as linked because
|
||||
//you can invoice out anything under it that is linked and the
|
||||
//not linked items simply won't invoice
|
||||
//if (bLinked)
|
||||
// dri["Linked"] = true;
|
||||
|
||||
//DataRow drw = dtWorkorder.NewRow();
|
||||
//drw["InvoiceWorkingID"] = (int)dri["WorkingID"];
|
||||
//drw["WorkorderID"] = i.ID;
|
||||
//drw["Status"] = i.Status;
|
||||
//drw["ServiceNumber"] = i.ServiceNumber;
|
||||
//drw["ServiceDate"] = i.ServiceDate;
|
||||
//drw["Project"] = i.Project;
|
||||
//drw["StatusARGB"] = i.StatusARGB;
|
||||
|
||||
//drw["Linked"] = bLinked;
|
||||
//dtWorkorder.Rows.Add(drw);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// grid.DisplayLayout.Rows.CollapseAll(false);
|
||||
//foreach (UltraGridRow r in grid.Rows)
|
||||
//{
|
||||
// foreach (UltraGridRow rr in r.ChildBands[0].Rows)
|
||||
// {
|
||||
// if ((bool)rr.Cells["Linked"].Value == false)
|
||||
// r.Expanded = true;
|
||||
// }
|
||||
|
||||
//}
|
||||
//grid.EndUpdate();
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
w.Close();
|
||||
}
|
||||
|
||||
await SetState();
|
||||
}
|
||||
|
||||
@@ -545,34 +304,6 @@ namespace AyaNovaQBI
|
||||
|
||||
|
||||
|
||||
private void InitializeGrid()
|
||||
{
|
||||
|
||||
//grid.DataSource = _GridTable;
|
||||
//grid.Columns["WorkingID"].Visible = false;
|
||||
//grid.Columns["ClientID"].Visible = false;
|
||||
//grid.Columns["Linked"].Visible = false;
|
||||
//grid.Columns["Client"].Visible = false;
|
||||
//grid.Columns["InvoiceWorkingID"].Visible = false;
|
||||
//grid.Columns["WorkorderID"].Visible = false;
|
||||
//grid.Columns["StatusARGB"].Visible = false;
|
||||
//grid.Columns["WorkingID"].Visible = false;
|
||||
//string currentAssemblyDirectoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||
|
||||
//Load the grid layout from file
|
||||
//if (System.IO.File.Exists(currentAssemblyDirectoryName + "\\MainGrid.lyt"))
|
||||
// grid.DisplayLayout.Load(currentAssemblyDirectoryName + "\\MainGrid.lyt");
|
||||
//grid.DisplayLayout.Bands[0].Columns["WorkingID"].Hidden = true;
|
||||
//grid.DisplayLayout.Bands[0].Columns["ClientID"].Hidden = true;
|
||||
//grid.DisplayLayout.Bands[0].Columns["Linked"].Hidden = true;
|
||||
//grid.DisplayLayout.Bands[0].Columns["Client"].Header.Caption = "Invoice";
|
||||
|
||||
//grid.DisplayLayout.Bands[1].Columns["InvoiceWorkingID"].Hidden = true;
|
||||
//grid.DisplayLayout.Bands[1].Columns["WorkorderID"].Hidden = true;
|
||||
//grid.DisplayLayout.Bands[1].Columns["StatusARGB"].Hidden = true;
|
||||
//grid.DisplayLayout.Bands[1].Columns["Linked"].Hidden = true;
|
||||
}
|
||||
|
||||
//private void grid_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
|
||||
//{
|
||||
// if (e.Row.Band.Index == 0)
|
||||
|
||||
Reference in New Issue
Block a user