void StackDataEditor_Ok(object sender, EventArgs e) { if (((TruckStackWrapper)StackDataEditor.DataSource).StackId == Guid.Empty) { errorDisplayer.ShowErrorMessage("Stack is required"); } else if (StackDataEditor.IsNew) { ginProcess.AddStack(GINTruckInformation.Load.TruckId, ((TruckStackWrapper)StackDataEditor.DataSource).TSInfo); StackGridViewer.DataBind(); TruckLoadEditor.DataSource = GINTruckInformation.Load; TruckLoadEditor.DataBind(); StackDataEditor.IsNew = false; } else { var editedStack = from stack in GINTruckInformation.Load.Stacks where stack.TruckStackId == ((TruckStackWrapper)StackDataEditor.DataSource).TruckStackId select stack; if (editedStack.Count() > 0) { editedStack.ElementAt(0).Copy(((TruckStackWrapper)StackDataEditor.DataSource).TSInfo); StackGridViewer.DataBind(); TruckLoadEditor.DataSource = GINTruckInformation.Load; TruckLoadEditor.DataBind(); } } mpeStackDataEditorExtender.Hide(); }
void AddedBagsDataEditor_Ok(object sender, EventArgs e) { if (((ReturnedBagsWrapper)AddedBagsDataEditor.DataSource).StackId == Guid.Empty) { errorDisplayer.ShowErrorMessage("Stack is required"); } else if (AddedBagsDataEditor.IsNew) { ginProcess.AddReturnedBags(GINTruckInformation.Weight.TruckId, ((ReturnedBagsWrapper)AddedBagsDataEditor.DataSource).RBInfo); AddedBagsGridViewer.DataBind(); AddedBagsDataEditor.IsNew = false; } else { var editedAddedBags = from addedBags in GINTruckInformation.Weight.AddedBags where addedBags.ReturnedBagsId == ((ReturnedBagsWrapper)AddedBagsDataEditor.DataSource).ReturnedBagsId select addedBags; if (editedAddedBags.Count() > 0) { editedAddedBags.ElementAt(0).Copy(((ReturnedBagsWrapper)AddedBagsDataEditor.DataSource).RBInfo); AddedBagsGridViewer.DataBind(); } } mpeAddedBagsDataEditorExtender.Hide(); }
void InspectorDataEditor_Ok(object sender, EventArgs e) { try { if (((PhysicalCountInspectorInfo)InspectorDataEditor.DataSource).UserId == Guid.Empty) { errorDisplayer.ShowErrorMessage("Inspector is required"); } else if (InspectorDataEditor.IsNew) { inventoryService.AddInspector(physicalCountInformation, (PhysicalCountInspectorInfo)InspectorDataEditor.DataSource); InspectorGridViewer.DataBind(); InspectorDataEditor.IsNew = false; } else { var editedInspector = from inspector in PhysicalCountInformation.Inspectors where inspector.Id == ((PhysicalCountInspectorInfo)InspectorDataEditor.DataSource).Id select inspector; if (editedInspector.Count() > 0) { editedInspector.ElementAt(0).Copy((PhysicalCountInspectorInfo)InspectorDataEditor.DataSource); InspectorGridViewer.DataBind(); } } btnCancel.Text = " Cancel "; mpeInspectorDataEditorExtender.Hide(); } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } }
protected void btnApprove_Click(object sender, EventArgs e) { try { GINProcessWrapper.ApproveGINEditRequest(); GINProcessWrapper.RemoveGINProcessInformation(); transferedData.Return(); } catch (Exception ex) { 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); } }
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); } }
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); } }
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); } }
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 TruckDataEditor_Ok(object sender, EventArgs e) { try { GINTruckInfo ginTruck = (GINTruckInfo)DriverDataEditor.DataSource; TruckInfo mainTruck = (TruckInfo)TruckDataEditor.DataSource; TruckInfo trailer = (TruckInfo)TrailerDataEditor.DataSource; if (mainTruck.IsNew && (mainTruck.PlateNo != string.Empty)) { if (!new TruckRegisterBLL() { Id = mainTruck.TruckId, IsTrailer = false, Status = TruckStatus.Active, TrackingNo = string.Empty, TruckModelYearId = mainTruck.TruckModelYearId, TruckNumber = mainTruck.PlateNo }.Add()) { ; } //throw new Exception("Unable to register truck"); } if (trailer.IsNew && (trailer.PlateNo != string.Empty)) { if (!new TruckRegisterBLL() { Id = trailer.TruckId, IsTrailer = true, Status = TruckStatus.Active, TrackingNo = string.Empty, TruckModelYearId = trailer.TruckModelYearId, TruckNumber = trailer.PlateNo }.Add()) { ; } // throw new Exception("Unable to register trailer"); } ginTruck.MainTruckId = mainTruck.TruckId; ginTruck.TrailerId = trailer.TruckId; ginTruck.PlateNo = mainTruck.PlateNo; ginTruck.TrailerNo = trailer.PlateNo; if (TruckDataEditor.IsNew) { ginProcess.AddTruck(ginTruck); TruckGridViewer.DataSource = ginProcess.GINProcessInformation.RegisteredTrucks; TruckGridViewer.DataBind(); updatePanel.Update(); } else { var editedTruck = from truck in ginProcess.GINProcessInformation.Trucks where truck.TruckId == ginTruck.TruckId select truck; if (editedTruck.Count() > 0) { editedTruck.ElementAt(0).Copy(ginTruck); TruckGridViewer.DataSource = ginProcess.GINProcessInformation.RegisteredTrucks; TruckGridViewer.DataBind(); updatePanel.Update(); } } } catch (Exception ex) { errorDisplayer.ShowErrorMessage(ex.Message); } mpeTruckDataEditorExtender.Hide(); }
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); } } }