Exemple #1
0
        public DocContentBE GetDocContent()
        {
            if (myDocContent == null)
            {
                myDocContent = new DocContentBE(this);
            }

            return(myDocContent);
        }
Exemple #2
0
        private void DumpDocs(SST.DocDumpRow ddr)
        {
            SST.DocTransferRow drDocTran = myA.DB.DocTransfer[0];

            ActivityBP abp = myA.FM.CurrentActivityProcess;

            if (abp.CurrentACE != null)
            {
                drDocTran = (SST.DocTransferRow)abp.CurrentACE.relTables["DocTransfer0"][0].Row;
            }

            string dir = myA.GetDocTransfer().GetDocDumpShare(drDocTran) + @"\" + drDocTran.OutSubFolder;

            DocContentBE dcBE = myA.FM.GetDocMng().GetDocContent();
            DocumentBE   dBE  = myA.FM.GetDocMng().GetDocument();

            if (ddr.Dump)
            {
                docDB.DocumentRow dr = myA.FM.GetDocMng().DB.Document.FindByDocId(ddr.DocId);
                if (dr.DocContentRow == null)
                {
                    dcBE.Load(dr.DocRefId, dr.CurrentVersion);
                }

                string fileName = dcBE.GetTempFileName(dr, dir);

                //dcBE.WriteDoc(dBE.Print(dr), false, fileName);
                try
                {
                    dcBE.WriteDoc(dBE.Print(dr), false, fileName);
                    dr.SentToShareFolder = 2;
                }
                catch (Exception x)
                {
                    dr.SentToShareFolder = 3;

                    ddr.SetColumnError("Dump", String.Format(Properties.Resources.DocDumpFailed + " " + x.Message, dr.Name));  //setting this error will prevent saving the records
                    myA.AtMng.LogError(x);
                    //myA.FM.RaiseWarning(WarningLevel.Display,String.Format( Properties.Resources.DocDumpFailed,fileName), "ATRIUM");
                }
                dr.DocDumpDate     = DateTime.Now;
                dr.DocDumpFullPath = fileName;
                dr.DocDumpUser     = myA.AtMng.OfficerLoggedOn.UserName;
            }
        }