protected override void OnInit(EventArgs e) { base.OnInit(e); errorDisplayer = new ErrorMessageDisplayer(lblMessage); errorDisplayer.ClearErrorMessage(); transferedData = new PageDataTransfer(Request.Path); GINGridViewer1.Driver = TruckGridViewDriver; GINDataEditor1.Driver = GINViewConfigurationReader.GetViewConfiguration("GINProcess", "PUNSummary"); GINDataEditor2.Driver = GINViewConfigurationReader.GetViewConfiguration("GINProcess", "Truck"); GINDataEditor2.Ok += new EventHandler(GINDataEditor2_Ok); GINDataEditor2.Cancel += new EventHandler(GINDataEditor2_Cancel); btnAddTruck.Visible = ((WorkflowTaskType)transferedData.GetTransferedData("WorkflowTask") == WorkflowTaskType.LoadTruck) && ((transferedData.GetTransferedData("IsGINTransaction") == null) || (bool)(transferedData.GetTransferedData("IsGINTransaction"))); try { ginProcess = GINProcessWrapper.GetGINProcess(IsPostBack); GINGridViewer1.Lookup = ginProcess.LookupSource; GINDataEditor1.Lookup = ginProcess.LookupSource; GINDataEditor2.Lookup = ginProcess.LookupSource; GINGridViewer1.DataSource = ginProcess.GINProcessInformation.Trucks; GINDataEditor1.Setup(); GINDataEditor2.Setup(); } catch (Exception ex) { throw ex; } }
void linkCommand_Command(object sender, CommandEventArgs e) { if (e.CommandName == "Samplers") { PageDataTransfer sampleTransfer = new PageDataTransfer("/GINSamplers.aspx"); sampleTransfer.TransferData["SampleId"] = new Guid((string)e.CommandArgument); sampleTransfer.TransferData["TransactionId"] = transferedData.GetTransferedData("TransactionId"); sampleTransfer.TransferData["IsGINTransaction"] = false; sampleTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.Path; GINProcessWrapper.RemoveGINProcessInformation(); transferedData.RemoveAllData(); sampleTransfer.Navigate(); } else if (e.CommandName == "Results") { PageDataTransfer sampleTransfer = new PageDataTransfer("/GINSamplingResults.aspx"); sampleTransfer.TransferData["SampleId"] = new Guid((string)e.CommandArgument); sampleTransfer.TransferData["TransactionId"] = transferedData.GetTransferedData("TransactionId"); sampleTransfer.TransferData["IsGINTransaction"] = false; sampleTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.Path; GINProcessWrapper.RemoveGINProcessInformation(); transferedData.RemoveAllData(); sampleTransfer.Navigate(); } else if (e.CommandName == "EditSample") { SampleDataEditor.IsNew = false; var sampleToEdit = from sample in ginProcess.GINProcessInformation.Samples where sample.Id == new Guid((string)e.CommandArgument) select sample; SampleDataEditor.DataSource = sampleToEdit.ElementAt(0); SampleDataEditor.DataBind(); SampleDataEditorContainer.Attributes["class"] = "ShowPopupEditor"; } }
void PUNADataEditor_Ok(object sender, EventArgs e) { try { PUNAcknowledgementInformation puna = (PUNAcknowledgementInformation)PUNADataEditor.DataSource; PUNWrapper.AcknowledgePickupNotice(puna);//, new AuditTrailWrapper("Initiate PUN Process", //new object[][]{new object[]{pickupNotice.PUNAInformation, puna}})); PageDataTransfer reportTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/ReportViewerForm.aspx"); reportTransfer.TransferData["TransactionId"] = puna.TransactionId; reportTransfer.TransferData["IsGINTransaction"] = false; reportTransfer.TransferData["RequestedReport"] = "rptPUNTrackingReport"; reportTransfer.TransferData["ReturnPage"] = transferedData.GetTransferedData("ReturnPage"); reportTransfer.PersistToSession(); ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowReport", "<script type=\"text/javascript\">" + string.Format("javascript:window.open(\"ReportViewerForm.aspx?id={0}\", \"_blank\",\"height=400px,width=600px,top=0,left=0,resizable=yes,scrollbars=yes\");", Guid.NewGuid()) + string.Format("location.href = '{0}';", transferedData.GetTransferedData("ReturnPage")) + "</script>", false); GINProcessWrapper.RemoveGINProcessInformation(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
protected void btnSave_Click(object sender, EventArgs e) { try { btnSave.Enabled = false; GINProcessWrapper.SaveTruckRegistration(); PageDataTransfer reportTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/ReportViewerForm.aspx"); reportTransfer.TransferData["TransactionId"] = ginProcess.GINProcessInformation.TransactionId; reportTransfer.TransferData["IsGINTransaction"] = false; reportTransfer.TransferData["RequestedReport"] = "rptGINTrackingReport"; reportTransfer.TransferData["GINTrackingReportData"] = ginProcess.GINTrackingReportData; reportTransfer.TransferData["ReturnPage"] = transferedData.GetTransferedData("ReturnPage"); reportTransfer.PersistToSession(); ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowReport", "<script type=\"text/javascript\">" + string.Format("javascript:window.open(\"ReportViewerForm.aspx?id={0}\", \"_blank\",\"height=400px,width=600px,top=0,left=0,resizable=yes,scrollbars=yes\");", Guid.NewGuid()) + string.Format("location.href = '{0}';", transferedData.GetTransferedData("ReturnPage")) + "</script>", false); GINProcessWrapper.RemoveGINProcessInformation(); } catch (Exception ex) { btnSave.Enabled = true; errorDisplayer.ShowErrorMessage(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { ActiveReport report = ReportFactory.GetReport(); PageDataTransfer transferedData = new PageDataTransfer(HttpContext.Current.Request.Path); string requestedReport = (string)(transferedData.GetTransferedData("RequestedReport")); report.Run(false); // Response.AddHeader("Cache-Control", "no-cache"); Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", string.Format("inline; filename={0}.PDF", requestedReport)); // Create the PDF export object PdfExport pdf = new PdfExport(); // Create a new memory stream that will hold the pdf output System.IO.MemoryStream memStream = new System.IO.MemoryStream(); // Export the report to PDF: pdf.Export(report.Document, memStream); // Write the PDF stream out Response.BinaryWrite(memStream.ToArray()); // Send all buffered content to the client Response.End(); transferedData.RemoveAllData(); }
public static void RejectGINEditRequest() { PageDataTransfer transferedData = new PageDataTransfer(HttpContext.Current.Request.Path); GINEditingRequest request = (GINEditingRequest)transferedData.GetTransferedData("GINEditingRequest"); ECXWF.ECXEngine engine = new WarehouseApplication.ECXWF.ECXEngine(); engine.CloseTransaction(request.TransactionId); }
public static ActiveReport GetReport() { ActiveReport report = null; PageDataTransfer transferedData = new PageDataTransfer(HttpContext.Current.Request.Path); string requestedReport = (string)(transferedData.GetTransferedData("RequestedReport")); IGINProcess ginProcess = null; switch (requestedReport) { case "rptGINReport": ginProcess = GINProcessWrapper.GetGINProcess(false); ILookupSource lookupSource = ginProcess.LookupSource; report = new Reports.rptGINReport(); report.DataSource = new GINReportDataCollection(ginProcess.GetGINReport(ginProcess.GINProcessInformation.Trucks[0].TruckId), lookupSource); return(report); case "rptPUNTrackingReport": ginProcess = GINProcessWrapper.GetGINProcess(false); report = new Reports.rptPUNTrackingReport(); report.DataSource = new TrackingReportDataCollection(ginProcess.PUNTrackingReportData); return(report); case "rptGINTrackingReport": report = new Reports.rptGINTrackingReport(); GINTrackingReportDataCollection gtrDataSource = new GINTrackingReportDataCollection(); gtrDataSource.AddList((List <GINTrackingReportData>)transferedData.GetTransferedData("GINTrackingReportData")); report.DataSource = gtrDataSource; return(report); case "rptPUNReport": report = new Reports.rptPUNReport(); PUNReportDataCollection puDataSource = new PUNReportDataCollection((PUNReportData)transferedData.GetTransferedData("PUNReportData")); report.DataSource = puDataSource; return(report); } return(null); }
public static IGINProcess GetGINProcess(bool isPostBack) { IGINProcess ginProcess; if (!isPostBack) { PageDataTransfer transferedData = new PageDataTransfer(HttpContext.Current.Request.Path); string transactionId = (string)transferedData.GetTransferedData("TransactionId"); Guid ginProcessId = Guid.Empty; if (transactionId == null) { ginProcessId = (Guid)transferedData.GetTransferedData("GINProcessId"); } object oIsGINTransaction = transferedData.GetTransferedData("IsGINTransaction"); if (transactionId == null) { ginProcess = new GINAuditController(ginProcessId); } else if (oIsGINTransaction != null) { ginProcess = new GINAuditController(transactionId, (bool)oIsGINTransaction); } else { ginProcess = new GINAuditController(transactionId); } HttpContext.Current.Session["GIN-Process-Information"] = ginProcess.GINProcessInformation; } else { ginProcess = new GINAuditController(); ginProcess.GINProcessInformation = (GINProcessInfo)HttpContext.Current.Session["GIN-Process-Information"]; } return(ginProcess); }
public static PhysicalCountInfo GetPhysicalCountInformation(bool isPostBack) { if (!isPostBack) { PageDataTransfer transferedData = new PageDataTransfer(HttpContext.Current.Request.Path); Guid physicalCountId = (Guid)transferedData.GetTransferedData("PhysicalCountId"); IInventoryServices invertoryServices = InventoryServices.GetInventoryService(); PhysicalCountInfo physicalCountInformation = invertoryServices.OpenPhysicalCount(physicalCountId); HttpContext.Current.Session["Physical-Count-Information"] = physicalCountInformation; return(physicalCountInformation); } else { return((PhysicalCountInfo)HttpContext.Current.Session["Physical-Count-Information"]); } }
public static PickupNoticeInformation GetPickupNoticeInformation(bool isPostBack) { PickupNoticeInformation punInfo; if (!isPostBack) { PageDataTransfer transferedData = new PageDataTransfer(HttpContext.Current.Request.Path); Guid punId = (Guid)transferedData.GetTransferedData("PickupNoticeId"); IPickupNotice pun = new PickupNoticeBLL(punId); punInfo = pun.PickupNoticeInformation; HttpContext.Current.Session["Pickup-Notice-Information"] = punInfo; } else { punInfo = (PickupNoticeInformation)HttpContext.Current.Session["Pickup-Notice-Information"]; } return(punInfo); }
public static GINProcessInfo GetGINProcessInformation(bool isPostBack) { GINProcessInfo ginProcessInfo; if (!isPostBack) { PageDataTransfer transferedData = new PageDataTransfer(HttpContext.Current.Request.Path); string transactionId = (string)transferedData.GetTransferedData("TransactionId"); IGINProcess ginProcess = new GINAuditController(transactionId); ginProcessInfo = ginProcess.GINProcessInformation; HttpContext.Current.Session["GIN-Process-Information"] = ginProcessInfo; } else { ginProcessInfo = (GINProcessInfo)HttpContext.Current.Session["GIN-Process-Information"]; } return(ginProcessInfo); }
public static void ApproveGINEditRequest() { IGINProcess originalGinProcess = GetGINProcess(true); PageDataTransfer transferedData = new PageDataTransfer(HttpContext.Current.Request.Path); GINEditingRequest request = (GINEditingRequest)transferedData.GetTransferedData("GINEditingRequest"); XmlSerializer s = new XmlSerializer(typeof(GINProcessInfo)); GINProcessInfo ginProcessInformation = (GINProcessInfo)s.Deserialize(new StringReader(request.ProposedChange)); ginProcessInformation.Trucks[0].TransactionId = request.TransactionId; ginProcessInformation.Trucks[0].Status = (int)GINStatusType.GINGenerated; IGINProcess ginProcess = new GINAuditController(); ginProcess.GINProcessInformation = ginProcessInformation; SqlTransaction transaction = null; try { switch (request.TargetPage) { case "EditTruckInformation.aspx": transaction = ginProcess.SaveTruckInformation(ginProcessInformation.Trucks[0].TruckId); break; case "EditTruckLoading.aspx": transaction = ginProcess.SaveLoading(ginProcessInformation.Trucks[0].TruckId); break; case "EditTruckScaling.aspx": transaction = ginProcess.SaveScaling(ginProcessInformation.Trucks[0].TruckId); break; } transaction.Commit(); CompleteWorkflowTask(request.TransactionId); } catch (Exception ex) { if (transaction != null) { transaction.Rollback(); } throw ex; } }
private void Confirm() { GINProcessWrapper.CompleteScaling(GINTruckInformation.TruckId); PageDataTransfer reportTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/ReportViewerForm.aspx"); reportTransfer.TransferData["TransactionId"] = GINTruckInformation.TransactionId; reportTransfer.TransferData["IsGINTransaction"] = true; reportTransfer.TransferData["RequestedReport"] = "rptGINReport"; reportTransfer.TransferData["ReturnPage"] = transferedData.GetTransferedData("ReturnPage"); reportTransfer.PersistToSession(); ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowReport", "<script type=\"text/javascript\">" + string.Format("javascript:window.open(\"ReportViewerForm.aspx?id={0}\", \"_blank\",\"height=400px,width=600px,top=0,left=0,resizable=yes,scrollbars=yes\");", Guid.NewGuid()) + string.Format("location.href = '{0}';", transferedData.GetTransferedData("ReturnPage")) + "</script>", false); GINProcessWrapper.RemoveGINProcessInformation(); }
protected void btnGenerate_Click(object sender, EventArgs e) { //AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.TruckWeighing); if (GINDataEditor.DataSource != null) { GINInfo editedGin = new GINInfo(); editedGin.Copy((GINInfo)GINDataEditor.DataSource); //auditTrail.AddChange(GINTruckInformation.GIN, editedGin); GINTruckInformation.GIN.Copy((GINInfo)GINDataEditor.DataSource); } try { GINProcessWrapper.SaveGIN(GINTruckInformation.TruckId);//, auditTrail); GINProcessWrapper.GINGenerated(GINTruckInformation.TruckId); //GINProcessWrapper.CompleteWorkflowTask(GINTruckInformation.TransactionId); PageDataTransfer reportTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/ReportViewerForm.aspx"); reportTransfer.TransferData["TransactionId"] = GINTruckInformation.TransactionId; reportTransfer.TransferData["IsGINTransaction"] = true; reportTransfer.TransferData["RequestedReport"] = "rptGINReport"; reportTransfer.TransferData["ReturnPage"] = transferedData.GetTransferedData("ReturnPage"); reportTransfer.PersistToSession(); ScriptManager.RegisterStartupScript(this, this.GetType(), "ShowReport", "<script type=\"text/javascript\">" + string.Format("javascript:window.open(\"ReportViewerForm.aspx?id={0}\", \"_blank\",\"height=400px,width=600px,top=0,left=0,resizable=yes,scrollbars=yes\");", Guid.NewGuid()) + string.Format("location.href = '{0}';", transferedData.GetTransferedData("ReturnPage")) + "</script>", false); GINProcessWrapper.RemoveGINProcessInformation(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
void linkCommand_Command(object sender, CommandEventArgs e) { if (e.CommandName == "EditTruck") { GINDataEditor2.IsNew = false; var truckToEdit = from truck in ginProcess.GINProcessInformation.Trucks where truck.TruckId == new Guid((string)e.CommandArgument) select truck; GINDataEditor2.DataSource = truckToEdit.ElementAt(0); GINDataEditor2.DataBind(); mpeTruckDataEditorExtender.Show(); } else if (e.CommandName == "LoadTruck") { try { if (GINDataEditor2.DataSource != null) { ginProcess.SaveTruck((GINTruckInfo)GINDataEditor2.DataSource); } PageDataTransfer truckTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/TruckLoading.aspx"); truckTransfer.RemoveAllData(); truckTransfer.TransferData["TruckId"] = new Guid((string)e.CommandArgument); truckTransfer.TransferData["GINProcessId"] = ginProcess.GINProcessInformation.GINProcessId; truckTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.Path; truckTransfer.TransferData["WorkflowTask"] = transferedData.GetTransferedData("WorkflowTask"); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.RemoveAllData(); truckTransfer.Navigate(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } } else if (e.CommandName == "ScaleTruck") { try { if (GINDataEditor2.DataSource != null) { ginProcess.SaveTruck((GINTruckInfo)GINDataEditor2.DataSource); } PageDataTransfer truckTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/TruckScaling.aspx"); truckTransfer.TransferData["TruckId"] = new Guid((string)e.CommandArgument); truckTransfer.TransferData["GINProcessId"] = ginProcess.GINProcessInformation.GINProcessId; truckTransfer.TransferData["WorkflowTask"] = transferedData.GetTransferedData("WorkflowTask"); truckTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.Path; GINProcessWrapper.RemoveGINProcessInformation(); transferedData.RemoveAllData(); truckTransfer.Navigate(); } catch (Exception ex) { lblMessage.Text = ex.Message; } } else if (e.CommandName == "GenerateGIN") { try { if (GINDataEditor2.DataSource != null) { ginProcess.SaveTruck((GINTruckInfo)GINDataEditor2.DataSource); } PageDataTransfer truckTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/GenerateGIN.aspx"); truckTransfer.TransferData["TruckId"] = new Guid((string)e.CommandArgument); truckTransfer.TransferData["GINProcessId"] = ginProcess.GINProcessInformation.GINProcessId; truckTransfer.TransferData["WorkflowTask"] = transferedData.GetTransferedData("WorkflowTask"); truckTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.Path; GINProcessWrapper.RemoveGINProcessInformation(); transferedData.RemoveAllData(); truckTransfer.Navigate(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } } }