Exemple #1
0
        private void VerifyAction_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            Marbid.Module.BusinessObjects.LibrarianSystem.Document doc = (Marbid.Module.BusinessObjects.LibrarianSystem.Document)View.CurrentObject;
            doc.IsVerified = true;
            doc.VerifiedBy = View.ObjectSpace.GetObjectByKey <Employee>(SecuritySystem.CurrentUserId);
            doc.VerifyDate = DateTime.Now;

            if (View is DetailView && ((DetailView)View).ViewEditMode == ViewEditMode.View)
            {
                View.ObjectSpace.CommitChanges();
            }
        }
Exemple #2
0
        private void ExtractTextFromPDFAction_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            Marbid.Module.BusinessObjects.LibrarianSystem.Document doc = (Marbid.Module.BusinessObjects.LibrarianSystem.Document)View.CurrentObject;
            if (doc.Attachment != null)
            {
                using (MemoryStream ms = new MemoryStream())
                {
                    doc.Attachment.SaveToStream(ms);
                    using (PdfHandling handling = new PdfHandling(ms))
                    {
                        doc.Excerpt = handling.DocumentText;
                    }
                }
            }

            if (View is DetailView && ((DetailView)View).ViewEditMode == ViewEditMode.View)
            {
                View.ObjectSpace.CommitChanges();
            }
        }