protected void btnAddTruck_Click(object sender, EventArgs e) { bool bPunClosed = (ginProcess.GINProcessInformation.RemainingWeight <= 0); if (bPunClosed) { GINProcessWrapper.ClosePun(); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); } else { DriverDataEditor.IsNew = true; TruckDataEditor.IsNew = true; TrailerDataEditor.IsNew = true; TruckRegistrationInfo truckRegistration = new TruckRegistrationInfo() { GINTruck = ginProcess.GetBlankTruck() }; DriverDataEditor.DataSource = truckRegistration.GINTruck; DriverDataEditor.DataBind(); TruckDataEditor.DataSource = truckRegistration.Truck; TruckDataEditor.DataBind(); TrailerDataEditor.DataSource = truckRegistration.Trailer; TrailerDataEditor.DataBind(); mpeTruckDataEditorExtender.Show(); } }
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); } }
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); } }
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"; } }
protected void btnOpen_Command(object sender, CommandEventArgs e) { XmlDocument document = new XmlDocument(); document.LoadXml(xdsGINProcessSource.Data); XmlNode statusNode = document.DocumentElement.SelectSingleNode(string.Format("/Catalog/GINProcess[@Id=\"{0}\"]/@Status", e.CommandArgument)); int status = int.Parse(((XmlAttribute)statusNode).Value); if (e.CommandName == "VerifyAgent") { PageDataTransfer confirmationTransfer = new PageDataTransfer(Request.ApplicationPath + "/VerifyGINAvailability.aspx"); confirmationTransfer.RemoveAllData(); GINProcessWrapper.RemoveGINProcessInformation(); confirmationTransfer.TransferData.Add("GINProcessId", new Guid(e.CommandArgument.ToString())); confirmationTransfer.TransferData.Add("ReturnPage", HttpContext.Current.Request.Path); confirmationTransfer.Navigate(); } else if (e.CommandName == "RegisterTruck") { PageDataTransfer confirmationTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/TruckRegistration.aspx"); confirmationTransfer.RemoveAllData(); GINProcessWrapper.RemoveGINProcessInformation(); confirmationTransfer.TransferData["GINProcessId"] = new Guid(e.CommandArgument.ToString()); confirmationTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.Path; confirmationTransfer.Navigate(); } }
protected void btnReject_Click(object sender, EventArgs e) { try { GINProcessWrapper.RejectGINEditRequest(); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
void TruckDataEditor_Ok(object sender, EventArgs e) { try { //AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.TruckRegistration); //GINTruckInfo original = new GINTruckInfo(); //original.Copy(GINTruckInformation); //auditTrail.AddChange(original, TruckDataEditor.DataSource); GINTruckInformation.Copy((GINTruckInfo)TruckDataEditor.DataSource); GINProcessWrapper.SaveTruckInformation(GINTruckInformation.TruckId);//, auditTrail); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
protected void btnOk_Click(object sender, EventArgs e) { try { //AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.TruckWeighing); TruckWeightInfo originalWeight = new TruckWeightInfo(); originalWeight.Copy(GINTruckInformation.Weight); GINTruckInformation.Weight.Copy((TruckWeightInfo)TruckWeightEditor.DataSource); //auditTrail.AddChange(originalWeight, GINTruckInformation.Weight); GINProcessWrapper.SaveScaling(GINTruckInformation.TruckId);//, auditTrail); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
void GINDataEditor_Ok(object sender, EventArgs e) { try { if (GINDataEditor.DataSource != null) { GINInfo originalGIN = new GINInfo(); originalGIN.Copy(GINTruckInformation.GIN); GINTruckInformation.GIN.Copy(((LeavingTruck)GINDataEditor.DataSource).GIN); GINProcessWrapper.TruckLeftCompound(GINTruckInformation.TruckId); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); } } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
protected void btnConfirm_Click(object sender, EventArgs e) { try { PUNAcknowledgementInformation acknowledgement = (PUNAcknowledgementInformation)PUNADataEditor.DataSource; PUNAcknowledgementInformation originalAcknowledgement = ginProcess.GINProcessInformation.PUNAcknowledgement; //AuditTrailWrapper auditTrail = new AuditTrailWrapper("Inverntory Verification", // new object[][]{new object[]{originalAcknowledgement, acknowledgement}}); GINProcessWrapper.SaveAvailabilityVerification(acknowledgement);//, auditTrail); GINProcessWrapper.CompleteAvailabilityVerification(); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); } catch (Exception ex) { Utility.LogException(ex); errorDisplayer.ShowErrorMessage(ex.Message); } }
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 btnSave_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.RemoveGINProcessInformation(); transferedData.Return(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
protected void btnOk_Click(object sender, EventArgs e) { try { //AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.TruckLoading); if (TruckLoadEditor.DataSource != null) { TruckLoadInfo originalLoad = new TruckLoadInfo(); originalLoad.Copy(GINTruckInformation.Load); GINTruckInformation.Load.Copy((TruckLoadInfo)TruckLoadEditor.DataSource); //auditTrail.AddChange(originalLoad, GINTruckInformation.Load); } GINProcessWrapper.SaveLoading(GINTruckInformation.TruckId);//, auditTrail); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
protected void btnConfirm_Click(object sender, EventArgs e) { //AuditTrailWrapper auditTrail = new AuditTrailWrapper(AuditTrailWrapper.GINAcceptance); 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.GINSigned(GINTruckInformation.TruckId); //GINProcessWrapper.CompleteWorkflowTask(GINTruckInformation.TransactionId); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
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); } }
public static void InitiateTask(string msg, string transactionId) { WorkflowTaskType workflowTask = (WorkflowTaskType)Enum.Parse(typeof(WorkflowTaskType), msg); if (workflowTask == WorkflowTaskType.VerifyPUN) { PageDataTransfer confirmationTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/PickupNoticeAcknowledged.aspx"); confirmationTransfer.RemoveAllData(); GINProcessWrapper.RemoveGINProcessInformation(); confirmationTransfer.TransferData["TransactionId"] = transactionId; confirmationTransfer.TransferData["IsGINTransaction"] = false; confirmationTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.ApplicationPath + "/ListInbox.aspx"; confirmationTransfer.Navigate(); } else if (workflowTask == WorkflowTaskType.ConfirmInventory) { PageDataTransfer confirmationTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/VerifyGINAvailability.aspx"); confirmationTransfer.RemoveAllData(); GINProcessWrapper.RemoveGINProcessInformation(); confirmationTransfer.TransferData["TransactionId"] = transactionId; confirmationTransfer.TransferData["IsGINTransaction"] = false; confirmationTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.ApplicationPath + "/ListInbox.aspx"; confirmationTransfer.Navigate(); } else if (workflowTask == WorkflowTaskType.RegisterTrucks) { PageDataTransfer confirmationTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/TruckRegistration.aspx"); confirmationTransfer.RemoveAllData(); GINProcessWrapper.RemoveGINProcessInformation(); confirmationTransfer.TransferData["TransactionId"] = transactionId; confirmationTransfer.TransferData["IsGINTransaction"] = false; confirmationTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.ApplicationPath + "/ListInbox.aspx"; confirmationTransfer.Navigate(); } else if (workflowTask == WorkflowTaskType.ApproveGINEditingRequest) { PageDataTransfer agerTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/ApproveGINEditRequest.aspx"); agerTransfer.RemoveAllData(); GINEditingRequest ger = GINProcessBLL.GetGINEditingRequest(transactionId); agerTransfer.TransferData["GINEditingRequest"] = ger; agerTransfer.TransferData["TransactionId"] = ger.OldTransactionId; agerTransfer.TransferData["IsGINTransaction"] = true; agerTransfer.TransferData["WorkflowTask"] = workflowTask; agerTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.ApplicationPath + "/ListInbox.aspx"; agerTransfer.Navigate(); } else if ((workflowTask == WorkflowTaskType.GINPreWeighTruck) || (workflowTask == WorkflowTaskType.LoadTruck) || (workflowTask == WorkflowTaskType.GINPostWeighTruck) || (workflowTask == WorkflowTaskType.GenerateGIN) || (workflowTask == WorkflowTaskType.RecordClientResponse) || (workflowTask == WorkflowTaskType.ApproveGIN) || (workflowTask == WorkflowTaskType.LeftCompound)) { PageDataTransfer loadDataTransfer = null; switch (workflowTask) { case WorkflowTaskType.GINPreWeighTruck: loadDataTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/TruckLoading.aspx"); break; case WorkflowTaskType.LoadTruck: loadDataTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/TruckLoading.aspx"); break; case WorkflowTaskType.GINPostWeighTruck: loadDataTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/TruckScaling.aspx"); break; case WorkflowTaskType.GenerateGIN: loadDataTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/TruckScaling.aspx"); break; case WorkflowTaskType.RecordClientResponse: loadDataTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/ClientAcknowledgeGIN.aspx"); break; case WorkflowTaskType.ApproveGIN: loadDataTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/ApproveGIN.aspx"); break; case WorkflowTaskType.LeftCompound: loadDataTransfer = new PageDataTransfer(HttpContext.Current.Request.ApplicationPath + "/TruckLeftCompound.aspx"); break; } loadDataTransfer.RemoveAllData(); GINProcessWrapper.RemoveGINProcessInformation(); loadDataTransfer.TransferData["TransactionId"] = transactionId; loadDataTransfer.TransferData["IsGINTransaction"] = true; loadDataTransfer.TransferData["WorkflowTask"] = workflowTask; loadDataTransfer.TransferData["ReturnPage"] = HttpContext.Current.Request.ApplicationPath + "/ListInbox.aspx"; loadDataTransfer.Navigate(); } }
protected void btnCancelEdit_Click(object sender, EventArgs e) { GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); }
void PUNADataEditor_Cancel(object sender, EventArgs e) { GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); }
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); } } }