private void btnContinue_Click(object sender, EventArgs e) { if (gvAudits.SelectedRows.Count != 1) { return; } InventoryAuditVO audit = gvAudits.SelectedRows[0].Tag as InventoryAuditVO; if (audit == null) { return; } panelButtons.Enabled = false; ProcessingMessage = new ProcessingMessage("Loading Audit Information", 0); ProcessingMessage.Show(); CommonDatabaseContext dataContext = CreateCommonDatabaseContext(); InventoryAuditProcedures.GetSummaryInfo(audit, dataContext); InventoryAuditProcedures.GetAdditionalAuditInfo(audit, dataContext); ProcessingMessage.Close(); if (!dataContext.Result) { MessageBox.Show("Error loading CACC information"); panelButtons.Enabled = true; return; } ADS.ActiveAudit = audit; switch (audit.Status) { case AuditStatus.ACTIVE: panelButtons.Enabled = true; NavControlBox.IsCustom = true; NavControlBox.CustomDetail = "VIEWACTIVEAUDIT"; NavControlBox.Action = NavBox.NavAction.SUBMIT; break; case AuditStatus.CLOSED: panelButtons.Enabled = true; NavControlBox.IsCustom = true; NavControlBox.CustomDetail = "VIEWCLOSEDAUDIT"; NavControlBox.Action = NavBox.NavAction.SUBMIT; break; default: MessageBox.Show("Status not implemented: " + audit.Status.ToString()); panelButtons.Enabled = true; break; } }
private void bwLoadInventorySummary_DoWork(object sender, DoWorkEventArgs e) { CommonDatabaseContext dataContextSummary = CreateCommonDatabaseContext(); InventoryAuditProcedures.GetSummary(ADS.ActiveAudit, dataContextSummary); if (!dataContextSummary.Result) { e.Result = dataContextSummary; } CommonDatabaseContext dataContextAuditInfo = CreateCommonDatabaseContext(); InventoryAuditProcedures.GetAdditionalAuditInfo(ADS.ActiveAudit, dataContextAuditInfo); if (!dataContextAuditInfo.Result) { e.Result = dataContextAuditInfo; } dataContextSummary.OutputDataSet2 = dataContextAuditInfo.OutputDataSet1; e.Result = dataContextSummary; }