示例#1
0
        //--------------------------------------------------------------------------

        private void Initialise()
        {
            if (this.ScannedFormId > 0)
            {
                Facade.Form facForm = new Facade.Form();
                this.BookingForm = facForm.GetForScannedFormId(this.ScannedFormId);
            }

            int scanFormId = -1;

            // With job POD scanning
            if (this.OrderId > 0)
            {
                Facade.Form facForm = new Facade.Form();

                if (this.BookingForm == null)
                {
                    this.BookingForm = new Entities.Scan();
                }

                this.BookingForm.ScannedDateTime = DateTime.Today;
                this.BookingForm.FormTypeId      = eFormTypeId.BookingForm;
                this.BookingForm.ScannedFormPDF  = this.FileName;

                if (this.AppendOrReplace.Contains("A"))
                {
                    this.BookingForm.IsAppend = true;
                }
                else
                {
                    this.BookingForm.IsAppend = false;
                }

                // if this is not set then we don't know where to save the file locally so it must have been uploaded immediately.
                if (this.AppendOrReplace.Contains("U") || String.IsNullOrEmpty(Globals.Configuration.ScannedDocumentPath))
                {
                    this.BookingForm.IsUploaded = true;
                }
                else
                {
                    this.BookingForm.IsUploaded = false;
                }

                scanFormId = facForm.Create(this.BookingForm, ((Entities.CustomPrincipal)Page.User).UserName);

                if (scanFormId > 0)
                {
                    Orchestrator.Facade.IOrder facOrder = new Orchestrator.Facade.Order();
                    facOrder.UpdateBookingFormScannedFormId(this.OrderId, scanFormId, ((Entities.CustomPrincipal)Page.User).UserName);
                }
            }

            this.Close(this.ScannedFormId.ToString());
        }
示例#2
0
 protected void dgPODSearchResults_ItemCommand(object sender, DataGridCommandEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Facade.IPOD   facPOD    = new Facade.POD();
         Facade.IForm  facForm   = new Facade.Form();
         Entities.POD  podToView = facPOD.GetForPODId(int.Parse(e.Item.Cells[0].Text));
         Entities.Scan scan      = facForm.GetForScannedFormId(podToView.ScannedFormId);
         byte[]        scannedFormImage;
         scannedFormImage = Convert.FromBase64String(scan.ScannedFormImage);
         Response.Clear();
         Response.ContentType = "image/tiff";
         Response.AddHeader("Content-Disposition", "attachment; filename=" + "PODTicketNo" + e.Item.Cells[1].Text + ".tif");
         Response.OutputStream.Write(scannedFormImage, 0, scannedFormImage.Length);
         Response.End();
     }
 }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Facade.IForm  facForm = new Facade.Form();
            Entities.Scan scan    = facForm.GetForScannedFormId(scannedFormId);
            for (int i = 0; i < scan.PageCount; i++)
            {
                TabStripTab tab     = new TabStripTab();
                string      imgName = "_page" + ((int)(i + 1)).ToString() + ".jpg";
                tab.Look.ImageUrl         = imgName;
                tab.SelectedLook.ImageUrl = imgName;
                tab.ClientSideCommand     = "selectPage(" + i.ToString() + ");";
                ThumbnailsTabStrip.Tabs.Add(tab);
            }

            CurrentImage.Width  = Unit.Percentage(100);
            CurrentImage.Height = Unit.Percentage(100);
        }
示例#4
0
        public string ScanHasBeenUploadedToWithId(string URL, int scannedFormId)
        {
            var methodStatus = String.Empty;

            var facScanForm = new Facade.Form();
            var scan        = facScanForm.GetForScannedFormId(scannedFormId);

            if (scan == null)
            {
                // If scan is null try and use the old method based on file name.
                ScanHasBeenUploadedTo(URL);
                return(methodStatus);
            }

            scan.IsUploaded     = true;
            scan.ScannedFormPDF = URL;

            try
            {
                // update the IsUploaded flag on the scannedForm
                facScanForm.Update(scan, scan.CreateUserID);
            }
            catch (Exception ex)
            {
                throw new ApplicationException("ScanHasBeenUploadedTo - Update ScanForm failed", ex);
            }

            //If the scan is a POD email it
            if (scan.FormTypeId == eFormTypeId.POD)
            {
                //Email the POD to the client
                Facade.IPOD facPod = new Facade.POD();

                //Make the call to send the email async as it will
                //have to download the attachment
                MethodCall <string, int> asyncSendClientPod = facPod.SendClientPod;
                asyncSendClientPod.BeginInvoke(scan.ScannedFormId, r =>
                {
                    try { asyncSendClientPod.EndInvoke(r); }
                    catch (Exception ex) { WebUI.Global.UnhandledException(ex); }
                }, null);
            }

            return(methodStatus);
        }
示例#5
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            userFullName = ((Entities.CustomPrincipal)Page.User).UserName;

            if (!IsLocal && Request.QueryString["ScannedFormID"] != null)
            {
                txtFileName.Text = "";
                Facade.IForm facForm = new Facade.Form();
                scannedFormId = int.Parse(Request.QueryString["ScannedFormId"]);
                Entities.Scan scan = facForm.GetForScannedFormId(scannedFormId);
                txtFirstFormPageID.Text = Request.QueryString["PageNumber"];
                txtTotalPages.Text      = scan.PageCount.ToString();
            }
            else
            {
                txtTotalPages.Text = Request.QueryString["TotalPages"];
                txtFileName.Text   = Request.QueryString["FileName"];
            }
        }
示例#6
0
        //--------------------------------------------------------------------------

        private void Initialise()
        {
            if (this.ScannedFormId > 0)
            {
                Facade.Form facForm = new Facade.Form();
                this.Manifest = facForm.GetForScannedFormId(this.ScannedFormId);
            }

            int scanFormId = -1;

            // With job POD scanning
            if (this.ManifestId > 0)
            {
                Facade.Form facForm = new Facade.Form();

                if (this.Manifest == null)
                {
                    this.Manifest = new Entities.Scan();
                }

                this.Manifest.ScannedDateTime = DateTime.Today;
                this.Manifest.FormTypeId      = eFormTypeId.Manifest;

                if (String.IsNullOrEmpty(this.FileName))
                {
                    this.Manifest.ScannedFormPDF = Orchestrator.Globals.Constants.NO_DOCUMENT_AVAILABLE;
                }
                else
                {
                    this.Manifest.ScannedFormPDF = this.FileName;
                }

                if (this.AppendOrReplace.Contains("A"))
                {
                    this.Manifest.IsAppend = true;
                }
                else
                {
                    this.Manifest.IsAppend = false;
                }

                // if this is not set then we don't know where to save the file locally so it must have been uploaded immediately.
                if (this.AppendOrReplace.Contains("U") || String.IsNullOrEmpty(Globals.Configuration.ScannedDocumentPath))
                {
                    this.Manifest.IsUploaded = true;
                }
                else
                {
                    this.Manifest.IsUploaded = false;
                }

                scanFormId = facForm.Create(this.Manifest, ((Entities.CustomPrincipal)Page.User).UserName);

                if (scanFormId > 0)
                {
                    this.Manifest.ScannedFormId = scanFormId;

                    // Update manifest record here
                    Orchestrator.Facade.ResourceManifest facResourceManifest =
                        new Orchestrator.Facade.ResourceManifest();

                    facResourceManifest.UpdateResourceManifestScan(this.ManifestId, scanFormId, ((Entities.CustomPrincipal)Page.User).UserName);
                }
            }

            this.Close(this.ScannedFormId.ToString());
        }
示例#7
0
        void btnNext_Click(object sender, EventArgs e)
        {
            if (this.ScannedFormId > 0)
            {
                Facade.Form facForm = new Facade.Form();
                this.DehireReceipt = facForm.GetForScannedFormId(this.ScannedFormId);
            }

            int scanFormId = -1;

            // With job POD scanning
            if (this.OrderId > 0)
            {
                Facade.Form           facForm          = new Facade.Form();
                Facade.IDeHireReceipt facDehireReceipt = new Facade.CollectDrop();

                string userID = ((Entities.CustomPrincipal)Page.User).UserName;

                if (this.DehireReceipt == null)
                {
                    this.DehireReceipt = new Entities.Scan();
                }

                this.DehireReceipt.ScannedDateTime = DateTime.Today;
                this.DehireReceipt.FormTypeId      = eFormTypeId.DehireReceipt;
                this.DehireReceipt.ScannedFormPDF  = this.FileName;

                // N = No document available
                if (this.AppendOrReplace.Contains("N"))
                {
                    if (this.DehireReceipt.ScannedFormId == 0)
                    {
                        this.DehireReceipt.ScannedFormPDF = Orchestrator.Globals.Constants.NO_DOCUMENT_AVAILABLE;
                    }
                }
                else
                {
                    this.DehireReceipt.ScannedFormPDF = this.FileName;
                }

                if (this.AppendOrReplace.Contains("A"))
                {
                    this.DehireReceipt.IsAppend = true;
                }
                else
                {
                    this.DehireReceipt.IsAppend = false;
                }

                // if this is not set then we don't know where to save the file locally so it must have been uploaded immediately.
                if (this.AppendOrReplace.Contains("U") || String.IsNullOrEmpty(Globals.Configuration.ScannedDocumentPath))
                {
                    this.DehireReceipt.IsUploaded = true;
                }
                else
                {
                    this.DehireReceipt.IsUploaded = false;
                }

                // Update the receipt number,
                facDehireReceipt.UpdateReceiptNumber(DehireReceiptId, txtDehireReceiptNumber.Text, userID);
                // Create the scanned form.
                scanFormId = facForm.Create(this.DehireReceipt, userID);

                if (scanFormId > 0)
                {
                    facDehireReceipt.UpdateScannedForm(DehireReceiptId, scanFormId, userID);
                }
            }

            this.Close(this.ScannedFormId.ToString());
        }
        //--------------------------------------------------------------------------

        private void Initialise()
        {
            Facade.Form facForm = new Facade.Form();

            if (this.ScannedFormId > 0)
            {
                this.ScannedForm = facForm.GetForScannedFormId(this.ScannedFormId);
            }
            else
            {
                this.ScannedForm = new Entities.Scan();
            }

            this.ScannedForm.ScannedDateTime = DateTime.Today;
            this.ScannedForm.FormTypeId      = (eFormTypeId)this.ScannedFormTypeId;
            this.ScannedForm.ScannedFormPDF  = this.FileName;

            if (this.AppendOrReplace.Contains("A"))
            {
                this.ScannedForm.IsAppend = true;
            }
            else
            {
                this.ScannedForm.IsAppend = false;
            }

            // if this is not set then we don't know where to save the file locally so it must have been uploaded immediately.
            if (this.AppendOrReplace.Contains("U") || String.IsNullOrEmpty(Globals.Configuration.ScannedDocumentPath))
            {
                this.ScannedForm.IsUploaded = true;
            }
            else
            {
                this.ScannedForm.IsUploaded = false;
            }

            //Creates a new scanned form and references the previous scanned form if necessary
            int scanFormId = facForm.Create(this.ScannedForm, ((Entities.CustomPrincipal)Page.User).UserName);

            if (scanFormId > 0)
            {
                EF.OrganisationDocument orgDoc = null;

                if (this.OrganisationDocumentId > 0)
                {
                    orgDoc = DataContext.OrganisationDocuments.First(od => od.OrganisationDocumentId == this.OrganisationDocumentId);
                }
                else
                {
                    orgDoc             = new EF.OrganisationDocument();
                    orgDoc.Description = DataContext.FormTypes.First(ft => ft.FormTypeId == this.ScannedFormTypeId).Description;
                    orgDoc.OrganisationReference.EntityKey = EF.DataContext.CreateKey("OrganisationSet", "IdentityId", this.OrganisationIdentityId);
                    this.DataContext.AddToOrganisationDocuments(orgDoc);
                }

                orgDoc.ScannedFormReference.EntityKey = EF.DataContext.CreateKey("ScannedForms", "ScannedFormID", scanFormId);
                this.DataContext.SaveChanges();
            }


            this.Close(this.ScannedFormId.ToString());
        }