示例#1
0
        private void PickupDocs(SST.DocTransferRow dtr)
        {
            string dir = GetDocDumpShare(dtr) + @"\" + dtr.InSubFolder;

            docDB.DocumentRow dr = myA.FM.GetDocMng().DB.Document.FindByDocId(dtr.CoverDocId);

            foreach (string f in System.IO.Directory.GetFiles(dir))
            {
                docDB.DocumentRow newDoc = (docDB.DocumentRow)myA.FM.GetDocMng().GetDocument().Add(myA.FM.CurrentFile, f);
                //string tmp = f.Substring(f.LastIndexOf("\\") + 1);
                newDoc.efSubject    = System.IO.Path.GetFileNameWithoutExtension(f);// tmp.Remove(tmp.LastIndexOf("."));
                newDoc.PopDocViewer = true;
                newDoc.SetColumnError("PageCount", "Page count is a required field");


                //newDoc.efType = "ATT";
                newDoc.SetefTypeNull();

                newDoc.IsDraft = false;
                // 2013-06-12 JLL: update to use isDraft only
                //newDoc.DocContentRow.ReadOnly = true;
                atriumBE.AttachmentBE          d   = myA.FM.GetDocMng().GetAttachment();
                lmDatasets.docDB.AttachmentRow att = (lmDatasets.docDB.AttachmentRow)d.Add(dr);
                att.AttachmentId = newDoc.DocId;
            }

            dtr.PickupOK = true;
        }
示例#2
0
        private void WriteErrorLog(string errorMsg)
        {
            if (errorLog == null)
            {
                //create error log doc
                errorLog = (docDB.DocumentRow)myA.GetDocMng().GetDocument().Add(myA.CurrentFile);
                myA.GetDocMng().GetDocContent().Add(errorLog);
                errorLog.IsDraft                      = true;
                errorLog.DocContentRow.Ext            = ".txt";
                errorLog.efSubject                    = DocumentBE.VerifySubjectLength(Resources.DisbursementImportErrorLog);
                errorLog.DocContentRow.ContentsAsText = Resources.DisbErrorHeader + Environment.NewLine;
            }
            //StreamWriter sr;

            //if (!File.Exists(filePath))
            //    sr = File.CreateText(filePath);
            //else
            //    sr = new StreamWriter(filePath, true);

            //sr.WriteLine (errorMsg);
            //sr.Close();

            errorLog.DocContentRow.ContentsAsText += errorMsg + Environment.NewLine;

            BusinessProcess bp = myA.GetDocMng().GetBP();

            bp.AddForUpdate(myA.GetDocMng().GetDocContent());
            bp.AddForUpdate(myA.GetDocMng().GetDocument());
            bp.Update();
        }
示例#3
0
        private int UploadFile()
        {
            try
            {
                if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    string f = this.openFileDialog1.FileName;

                    docDB.DocumentRow newDoc = (docDB.DocumentRow)FM.GetDocMng().GetDocument().Add(FM.CurrentFile, f);

                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetDocMng().GetDocContent());
                    bp.AddForUpdate(FM.GetDocMng().GetDocument());

                    bp.Update();

                    return(newDoc.DocId);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
示例#4
0
        private void Clone()
        {
            if (CurrentRow() == null)
            {
                MessageBox.Show("No current template on binding source.");
                return;
            }

            appDB.TemplateRow trCurrent = CurrentRow();
            appDB.TemplateRow trCopy    = (appDB.TemplateRow)AtMng.GetTemplate().Add(null);
            trCopy.LetterName    = trCurrent.LetterName + "COPY";
            trCopy.LetterDescEng = "(Copy of) " + trCurrent.LetterDescEng;
            trCopy.LetterDescFre = "(Copie de) " + trCurrent.LetterDescFre;

            docDB.DocumentRow   docCurrent        = AtMng.GetTemplate().GetTemplateDoc(trCurrent);
            docDB.DocContentRow docContentCurrent = docCurrent.DocContentRow;

            docDB.DocumentRow   docCopy        = AtMng.GetTemplate().GetTemplateDoc(trCopy);
            docDB.DocContentRow docContentCopy = docCopy.DocContentRow;

            docCopy.CommMode  = docCurrent.CommMode;
            docCopy.efSubject = docCurrent.efSubject;
            docCopy.efType    = docCurrent.efType;

            docContentCopy.Contents = docContentCurrent.Contents;
            docContentCopy.Ext      = docContentCurrent.Ext;

            CurrentDocRow = docCopy;
            templateBindingSource.Position = templateBindingSource.Find("TemplateId", trCopy.TemplateId);
        }
示例#5
0
        public void OutOfOfficeReply(atriumDB.ActivityRow activity)
        {
            if (myFM.AtMng.GetSetting(AppBoolSetting.useOutOfOfficeFunctionality))
            {
                if (activity.Communication)
                {
                    docDB.DocumentRow    docr   = myFM.GetDocMng().DB.Document.FindByDocId(activity.DocId);
                    docDB.RecipientRow[] recips = docr.GetRecipientRows();
                    officeDB.OfficerRow  officerRow;
                    foreach (docDB.RecipientRow rr in recips)
                    {
                        if (rr.Type != "0" && !rr.IsOfficerIdNull())
                        {
                            //check to see if they are out of the office
                            //always load in case person just set their out off office flag
                            officerRow = (officeDB.OfficerRow)myFM.AtMng.OfficeMng.GetOfficer().Load(rr.OfficerId);

                            //jll 2018-04-24 - if recipient is external, this check should never happen.
                            if (officerRow != null && officerRow.OutOfOffice)
                            {
                                if (DateTime.Now >= officerRow.OutOfOfficeStartDate && DateTime.Now <= officerRow.OutOfOfficeEndDate)
                                {
                                    // do out of office activity
                                    ActivityConfig.ACSeriesRow acsr = myFM.AtMng.acMng.DB.ACSeries.FindByACSeriesId(myFM.AtMng.GetSetting(AppIntSetting.OutOfOfficeNotification));
                                    CurrentACE = null;
                                    AutoAC(activity, acsr, officerRow.OfficerId, ACEngine.RevType.OutOfOffice, false);
                                }
                            }
                        }
                    }
                }
            }
        }
示例#6
0
        protected override void BeforeUpdate(DataRow dr)
        {
            this.BeforeChange(dr.Table.Columns["Subject"], dr);
            this.BeforeChange(dr.Table.Columns["RequestDate"], dr);
            this.BeforeChange(dr.Table.Columns["Number"], dr);

            Advisory.OpinionRow or = (Advisory.OpinionRow)dr;



            if (!or.IsCompletedDateNull() && !or.IsDocIdNull())
            {
                //mark opinion read-only
                docDB.DocumentRow odoc = myA.FM.GetDocMng().DB.Document.FindByDocId(or.DocId);
                if (odoc == null)
                {
                    odoc = myA.FM.GetDocMng().GetDocument().Load(or.DocId);
                }

                // 2013-06-12 JLL: update to use isDraft only
                odoc.IsDraft = false;

                //docDB.DocContentRow odcc = myA.FM.GetDocMng().DB.DocContent.FindByDocId(or.DocId);
                //if (odcc == null)
                //    odcc = myA.FM.GetDocMng().GetDocContent().Load(or.DocId);
                //if (!odcc.ReadOnly)
                //    odcc.ReadOnly = true;
            }
        }
示例#7
0
        private void autoSaveBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            try
            {
                if (CurrentRow() != null)
                {
                    ACEState aces = ACEStateDictionnary[CurrentRow().ActivityId];
                    atriumDB dsA  = new atriumDB();
                    dsA.Merge(ACEState.GetDSFromACE(aces, myFM.GetBEMngrForTable("EFile").MyDS.DataSetName));

                    docDB dsD = new docDB();
                    dsD.Merge(ACEState.GetDSFromACE(aces, myFM.GetBEMngrForTable("Document").MyDS.DataSetName));
                    SetRowChangeUI(false);

                    if (dsA.Activity.FindByActivityId(aces.ActivityId).IsDocIdNull())
                    {
                        ucDocView1.NoAssociatedDocument(LawMate.Properties.Resources.NoDocument);
                        //ucDoc1.NoAssociatedDocument(LawMate.Properties.Resources.NoDocument);
                    }
                    else
                    {
                        myFM.GetDocMng().isMerging = true;
                        myFM.GetDocMng().DB.Merge(dsD);
                        myFM.GetDocMng().isMerging = false;
                        docDB.DocumentRow dr       = myFM.GetDocMng().DB.Document.FindByDocId(dsA.Activity.FindByActivityId(aces.ActivityId).DocId);

                        DataView dvDoc = new DataView(dr.Table, "DocId=" + dr.DocId.ToString(), "", DataViewRowState.CurrentRows);

                        //ucDoc1.Datasource = dvDoc;
                        //ucDoc1.PreviewAsync();

                        ucDocView1.Datasource = dvDoc;
                        ucDocView1.PreviewAsync();

                        if (CurrentRow().RowError.Length > 0)
                        {
                            pnlCannotResume.DockStyle = Janus.Windows.UI.Dock.PanelDockStyle.Top;
                            pnlCannotResume.Closed    = false;
                            cmdResume.Enabled         = Janus.Windows.UI.InheritableBoolean.False;
                            pnlAutoSave.DockStyle     = Janus.Windows.UI.Dock.PanelDockStyle.Top;
                            label1.Text = CurrentRow().RowError;
                        }
                        else
                        {
                            pnlCannotResume.Closed    = true;
                            pnlCannotResume.DockStyle = Janus.Windows.UI.Dock.PanelDockStyle.Fill;
                            label1.Text = "";
                        }
                    }
                }
                else
                {
                    SetRowChangeUI(true);
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
示例#8
0
        public int ConfirmManage(int fileId)
        {
            CLAS.CashBlotterRow drCB = (CLAS.CashBlotterRow)GetCurrentRow()[0];
            int docId;

            System.Collections.Hashtable hashTable = new System.Collections.Hashtable();
            hashTable["fileid"]        = fileId;
            hashTable["cashblotterid"] = drCB.CashBlotterID;

            drCB.BeginEdit();
            FileManager fm = myA.AtMng.GetFile(fileId);

            if (drCB.IsFirstConfirmNull())
            {
                drCB.FirstConfirm = this.myA.AtMng.WorkingAsOfficer.OfficerId;
                docDB.DocumentRow drnew = this.myA.AtMng.GetTemplate().GenLetter(fm, "5119D", hashTable);
                docId = drnew.DocId;
            }
            else
            {
                drCB.SecondConfirm = this.myA.AtMng.WorkingAsOfficer.OfficerId;
                drCB.RemittedDate  = DateTime.Now;
                //this.myA.CreateRelatedActivity("020", DateTime.Now, "", drCB);
                Add(myA.FM.CurrentFile);
                docDB.DocumentRow drnew = this.myA.AtMng.GetTemplate().GenLetter(fm, "5119O", hashTable);
                docId = drnew.DocId;
            }
            drCB.EndEdit();

            return(docId);
        }
示例#9
0
        private void HookupNewOpinionDoc(bool ForOpinion)
        {
            if (ForOpinion)
            {
                OpenDocDialog.SetDocFilter("opinion=1");
            }

            OpenDocDialog.AllowBrowseFiles = false;
            OpenDocDialog.FindFile(FM.CurrentFileId);

            DialogResult dRes = OpenDocDialog.ShowDialog(FileForm());

            OpenDocDialog.SetDocFilter("");
            OpenDocDialog.AllowBrowseFiles = true;
            if (dRes == DialogResult.OK && OpenDocDialog.SelectedDocument != null)
            {
                docDB.DocumentRow newOpnDoc = OpenDocDialog.SelectedDocument;
                if (ForOpinion)
                {
                    CurrentRow().DocId = newOpnDoc.DocId;
                }
                else
                {
                    CurrentRow().RequestDocId = newOpnDoc.DocId;
                }
                LoadDocs(CurrentRow());
            }
        }
示例#10
0
 public void AddRecipToMessage(docDB.RecipientRow r, docDB.DocumentRow d, RecipType rtype)
 {
     try
     {
         docDB.RecipientRow newr = (docDB.RecipientRow)Add(d);
         DoNotResolve = true;
         newr.Type    = ((int)rtype).ToString();
         if (!r.IsOfficeIdNull())
         {
             newr.OfficeId = r.OfficeId;
         }
         if (!r.IsOfficerIdNull())
         {
             newr.OfficerId = r.OfficerId;
         }
         if (!r.IsAddressNull())
         {
             newr.Address = r.Address;
         }
         if (!r.IsNameNull())
         {
             newr.Name = r.Name;
         }
     }
     catch (Exception x)
     {
     }
     DoNotResolve = false;
 }
示例#11
0
        private void Delete()
        {
            try
            {
                if (UIHelper.ConfirmDelete())
                {
                    docDB.DocumentRow dr = AtMng.GetTemplate().GetTemplateDoc(CurrentRow());

                    CurrentRow().Delete();
                    if (dr != null)
                    {
                        dr.Delete();
                    }

                    this.templateBindingSource.EndEdit();
                    atLogic.BusinessProcess bp = AtMng.GetBP();
                    bp.AddForUpdate(AtMng.GetTemplate());
                    bp.AddForUpdate(myDM.GetDocContent());
                    bp.AddForUpdate(myDM.GetDocument());

                    bp.Update();
                }
            }
            catch (Exception x)
            {
                throw new Exception("Transaction Rolled Back", x);
            }
        }
示例#12
0
        public string GetTempFileName(docDB.DocumentRow ddr)
        {
            //create temp folder for viewing docs
            string fld = GetTempPath(ddr);

            return(GetTempFileName(ddr, fld));
        }
示例#13
0
        public void SyncActivity(DataTable dt)
        {
            IsSyncing        = true;
            myA.FM.isMerging = true;
            myA.isMerging    = true;

            //syncup the fields on activity
            //myA.FM.DB.Activity.BeginLoadData();
            foreach (atriumDB.ActivityRow ar in myA.FM.DB.Activity)
            {
                if (!ar.IsDocIdNull())
                {
                    DataRowState initialState = ar.RowState;

                    // docDB.RecipientDataTable recipdt = (docDB.RecipientDataTable)dt;
                    if (dt.Select("DocID=" + ar.DocId.ToString()).Length > 0)
                    {
                        docDB.ToRow[]   tos  = (docDB.ToRow[])myA.DB.To.Select("Docid=" + ar.DocId.ToString());
                        docDB.FromRow[] from = (docDB.FromRow[])myA.DB.From.Select("Docid=" + ar.DocId.ToString());


                        if (from.Length == 1)
                        {
                            ar.From = from[0].Name;
                        }
                        ar.To = " ";
                        foreach (docDB.ToRow to in tos)
                        {
                            ar.To += to.Name + ", ";
                        }
                    }
                    docDB.DocumentRow dr = myA.DB.Document.FindByDocId(ar.DocId);
                    if (dr != null)
                    {
                        ar.efSubject     = dr.efSubject;
                        ar.HasAttachment = myA.DB.Attachment.Select("MsgId=" + ar.DocId.ToString()).Length > 0;
                        DataRowState intDocState = dr.RowState;
                        if (ar.FailedToSend)
                        {
                            dr.FailedToSend = true;
                            if (intDocState == DataRowState.Unchanged)
                            {
                                dr.AcceptChanges();
                            }
                        }
                    }
                    if (initialState == DataRowState.Unchanged && ar.RowState != DataRowState.Unchanged)
                    {
                        ar.AcceptChanges();
                    }
                }
            }
            // myA.FM.DB.Activity.EndLoadData();
            IsSyncing        = false;
            myA.FM.isMerging = false;
            myA.isMerging    = false;
        }
示例#14
0
 public void MultiSelect(DocManager dm, docDB.DocumentRow dr)
 {
     multiSelect          = true;
     multiDoc             = dr;
     pnlBF.Closed         = false;
     pnlAuthor.Closed     = true;
     pnlRecipients.Closed = true;
     buttonOK.Enabled     = false;
     ucRecipientTextBox1.Init(dm, dr);
 }
示例#15
0
 public void StartCopy()
 {
     docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)documentBindingSource.Current).Row;
     //ucDocPreview1.WriteTempFile(dr.DocContentRow);
     ucDocView1.WriteTempFile(dr);
     System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
     //sc.Add(ucDocPreview1.TempFile);
     sc.Add(ucDocView1.TempFile);
     Clipboard.SetFileDropList(sc);
 }
示例#16
0
 private void ucRecordList1_ColumnButtonClicked(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e)
 {
     try
     {
         docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)this.documentBindingSource.Current).Row;
         MainForm.OpenFile(dr.FileId);
     }
     catch (Exception x)
     {
         UIHelper.HandleUIException(x);
     }
 }
示例#17
0
        private void PreviewVersion()
        {
            docDB.DocumentRow dr = myVirtualDM.GetDocument().Load(myActualDR.DocId);
            myVirtualDM.GetDocContent().Load(dr.DocRefId, CurrentRow().Version);
            ucDocViewVerHistory.Init(myVirtualDM);
            //ucDocViewVerHistory.ReturnFocusTo = this.grexVersionHistory;
            DataView dvDoc = new DataView(dr.Table, "DocId=" + dr.DocId.ToString(), "", DataViewRowState.CurrentRows);

            ucDocViewVerHistory.Datasource = dvDoc;
            ucDocViewVerHistory.Preview();
            ucDocViewVerHistory.Visible = true;
        }
示例#18
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     try
     {
         selectedDocument = null;
         this.Close();
     }
     catch (Exception x)
     {
         UIHelper.HandleUIException(x);
     }
 }
示例#19
0
        private void CheckIn()
        {
            docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)documentBindingSource.Current).Row;

            //ucDocPreview1.Clear();
            ucDocView1.Clear();
            myDM.GetDocument().Checkin(dr);
            CheckoutToggle(dr);

            //ucDocPreview1.Preview();
            ucDocView1.Preview();
        }
示例#20
0
 private void documentBindingSource_CurrentChanged(object sender, EventArgs e)
 {
     try
     {
         docDB.DocumentRow dr = CurrentRowDocument();
         ApplyDocSecurity(dr);
     }
     catch (Exception x)
     {
         UIHelper.HandleUIException(x);
     }
 }
示例#21
0
 private void ucRecordList1_RowDoubleClicked(object sender, Janus.Windows.GridEX.RowActionEventArgs e)
 {
     try
     {
         docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)this.documentBindingSource.Current).Row;
         fFile             f  = MainForm.OpenFile(dr.FileId);
         f.MoreInfo("document", dr.DocId);
     }
     catch (Exception x)
     {
         UIHelper.HandleUIException(x);
     }
 }
示例#22
0
        public void ApplyDocSecurity(DataRow dr)
        {
            if (FileForm() != null && FileForm().ReadOnly)
            {
                return;
            }

            if (dr != null)
            {
                docDB.DocumentRow cbr = (docDB.DocumentRow)dr;
                UIHelper.EnableControls(documentBindingSource, FM.GetDocMng().GetDocument().CanEdit(cbr));
            }
        }
示例#23
0
        private void CheckOut()
        {
            docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)documentBindingSource.Current).Row;

            string checkOutFile = myDM.GetDocument().Checkout(dr);

            //ucDocPreview1.NoDoc(LawMate.Properties.Resources.TheDocumentIsCheckedOut);
            ucDocView1.HideContent(LawMate.Properties.Resources.TheDocumentIsCheckedOut);
            CheckoutToggle(dr);

            //UIHelper.LaunchNative(checkOutFile, ucDocPreview1, "");
            UIHelper.LaunchNativeN(checkOutFile, ucDocView1, "");
        }
示例#24
0
        private void PreviewCurrentDoc()
        {
            docDB.DocumentRow dr = CurrentRow();
            if (dr != null & ok2Preview)
            {
                //ucDoc1.Datasource = new DataView(dr.Table, "Docid=" + dr.DocId.ToString(), "", DataViewRowState.CurrentRows);
                ucDocView1.Datasource = new DataView(dr.Table, "Docid=" + dr.DocId.ToString(), "", DataViewRowState.CurrentRows);

                if (IsFullTextSearch && !pnlPreview.Closed && dr.FileFormatRow != null && dr.FileFormatRow.AllowSearch)
                {
                    FullTextDocLoading = true;
                    {
                        if (dr.ext.ToUpper() == ".PDF")
                        {
                            uiStatusBar1.Visible = true;
                            cmdFirstHit.Enabled  = Janus.Windows.UI.InheritableBoolean.False;
                            cmdNextHit.Enabled   = Janus.Windows.UI.InheritableBoolean.False;
                            cmdPrevHit.Enabled   = Janus.Windows.UI.InheritableBoolean.False;
                            cmdLastHit.Enabled   = Janus.Windows.UI.InheritableBoolean.False;
                        }
                        else
                        {
                            uiStatusBar1.Visible = false;
                            cmdFirstHit.Enabled  = Janus.Windows.UI.InheritableBoolean.True;
                            cmdNextHit.Enabled   = Janus.Windows.UI.InheritableBoolean.True;
                            cmdPrevHit.Enabled   = Janus.Windows.UI.InheritableBoolean.True;
                            cmdLastHit.Enabled   = Janus.Windows.UI.InheritableBoolean.True;
                        }
                    }
                    if (!cmdToggleHighlight.IsChecked)
                    {
                        cmdToggleHighlight.IsChecked = true;
                    }

                    //string summaryText = ucDoc1.PreviewHitHighlight(FullText);
                    string summaryText = ucDocView1.PreviewHitHighlight(FullText);
                    if (summaryText != "")
                    {
                        ucWB1.WriteContent(summaryText);
                    }
                    //lblSelectedHitPosition.Text = "1";
                }
                else if (!pnlPreview.Closed)
                {
                    ucDocView1.PreviewAsync();
                }
                //ucDoc1.PreviewAsync();
            }
        }
示例#25
0
        private void documentGridEX_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
        {
            try
            {
                if (e.Row.DataRow == null)
                {
                    return;
                }
                docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)e.Row.DataRow).Row;
                if (dr == null)
                {
                    return;
                }

                if (!dr.IsSizeNull())
                {
                    e.Row.Cells["Size"].Text = String.Format("{0} kb", dr.Size / 1024);
                }

                if (!dr.IsSentToShareFolderNull())
                {
                    if (dr.SentToShareFolder == 2)
                    {
                        e.Row.Cells["SentToShareFolder"].Image = Properties.Resources.SentToShareSuccess;
                    }
                    else if (dr.SentToShareFolder == 3)
                    {
                        e.Row.Cells["SentToShareFolder"].Image = Properties.Resources.SentToShareFail;
                    }
                }

                if (myDM == null || myDM.FM.IsVirtualFM || dr.IsNull("FileId"))
                {
                    return;
                }

                //JLL: When Selecting Add Doc/Record/Send from ucRecords action, dr.fileid is null, making below statement fail
                if (dr.FileId != myDM.FM.CurrentFile.FileId)
                {
                    Janus.Windows.GridEX.GridEXFormatStyle fmt = new Janus.Windows.GridEX.GridEXFormatStyle();
                    fmt.BackColor  = Color.LightYellow;
                    e.Row.RowStyle = fmt;
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
示例#26
0
        public string WriteTempFile(docDB.DocumentRow ddr, bool CreateAsReadOnly)
        {
            if (!ddr.IsCheckedOutDateNull() && ddr.CheckedOutBy == myA.AtMng.OfficerLoggedOn.OfficerId)
            {
                if (System.IO.File.Exists(ddr.CheckedOutPath))
                {
                    return(ddr.CheckedOutPath);
                }
            }

            string temp = GetTempFileName(ddr);

            WriteDoc(ddr.DocContentRow, CreateAsReadOnly, temp);
            return(temp);
        }
示例#27
0
 private void CheckoutToggle(docDB.DocumentRow cbr)
 {
     if (cbr.IsCheckedOutByNull())
     {
         tsCheckout.Enabled     = Janus.Windows.UI.InheritableBoolean.True;
         tsCheckin.Enabled      = Janus.Windows.UI.InheritableBoolean.False;
         tsUndoCheckout.Enabled = Janus.Windows.UI.InheritableBoolean.False;
     }
     else
     {
         tsCheckout.Enabled     = Janus.Windows.UI.InheritableBoolean.False;
         tsCheckin.Enabled      = Janus.Windows.UI.InheritableBoolean.True;
         tsUndoCheckout.Enabled = Janus.Windows.UI.InheritableBoolean.True;
     }
 }
示例#28
0
        private void HookupDocToTemplate()
        {
            fBrowseDocs fBrowseDoc = new fBrowseDocs(AtMng);

            fBrowseDoc.FindFile(myFM.CurrentFile.FileId);
            DialogResult dRes = fBrowseDoc.ShowDialog(this);

            if (dRes == DialogResult.OK && fBrowseDoc.SelectedDocument != null)
            {
                docDB.DocumentRow docToLink = fBrowseDoc.SelectedDocument;
                CurrentRow().DocID = docToLink.DocId;
                Save();
                templateBindingSource.Position = templateBindingSource.Find("TemplateId", CurrentRow().TemplateId);
            }
        }
示例#29
0
        private void CreateAppealDocs(int fileAppealedId)
        {
            if (copyOnce)
            {
                return;
            }
            copyOnce = true;

            FileManager fmOrig = myA.AtMng.GetFile(fileAppealedId);

            //need to add all copied docs as attachments on intial DC doc
            docDB.DocumentRow newDC = (docDB.DocumentRow)myA.FM.CurrentActivityProcess.CurrentACE.relTables["Document0"][0].Row;// (docDB.DocumentRow)myA.FM.GetDocMng().DB.Document[0];
            foreach (docDB.DocumentRow dr in fmOrig.GetDocMng().DB.Document)
            {
                //only bring over P1 and P2 doctypemajor documents
                if (!dr.IsDocTypeMajorCodeNull())
                {
                    switch (dr.DocTypeMajorCode.ToUpper())
                    {
                    case "P1":
                    case "P2":
                        docDB.DocumentRow newdr = (docDB.DocumentRow)myA.FM.GetDocMng().GetDocument().Add(myA.FM.CurrentFile);
                        int docid = newdr.DocId;
                        myA.FM.GetDocMng().isMerging = true;
                        ACManager.ImportRow(newdr, dr);
                        newdr.FileId = myA.FM.CurrentFileId;
                        newdr.DocId  = docid;
                        //newdr.SourceDivision = dr.SourceDivision;
                        newdr.SetCheckedOutByNull();
                        newdr.SetCheckedOutDateNull();
                        newdr.SetCheckedOutPathNull();
                        if (newdr.efType == "GDEC" || newdr.efType == "ADEC")
                        {
                            newdr.efType = "ODEC";
                        }

                        myA.FM.GetDocMng().isMerging = false;

                        docDB.AttachmentRow attr = (docDB.AttachmentRow)myA.FM.GetDocMng().GetAttachment().Add(newDC);
                        attr.AttachmentId = newdr.DocId;
                        break;

                    default:
                        break;
                    }
                }
            }
        }
示例#30
0
        public override void ApplySecurity(DataRow dr)
        {
            if (FileForm() != null && FileForm().ReadOnly)
            {
                //ucDocPreview1.ReadOnly(true);
                ucDocView1.ReadOnly(true);
                return;
            }

            docDB.DocumentRow cbr = (docDB.DocumentRow)dr;

            if (cbr == null)
            {
                return;
            }
            //problem here is that doccontent does not load until preview async finsihes
            //need to implement a canedit that just takes the docid
            bool canEditDC = myDM.GetDocContent().CanEdit(cbr.DocContentRow);

            UIHelper.EnableControls(documentBindingSource, myDM.GetDocument().CanEdit(cbr));
            UIHelper.EnableCommandBarCommand(tsDelete2, myDM.GetDocument().CanDelete(cbr));

            if (cbr.isElectronic)
            {
                if (canEditDC)
                {
                    CheckoutToggle(cbr);
                    cmdRevise.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                }
                else
                {
                    tsCheckout.Enabled     = Janus.Windows.UI.InheritableBoolean.False;
                    tsCheckin.Enabled      = Janus.Windows.UI.InheritableBoolean.False;
                    tsUndoCheckout.Enabled = Janus.Windows.UI.InheritableBoolean.False;


                    cmdRevise.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                }
            }
            else
            {
                tsCheckin.Enabled      = Janus.Windows.UI.InheritableBoolean.False;
                tsCheckout.Enabled     = Janus.Windows.UI.InheritableBoolean.False;
                tsUndoCheckout.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                cmdRevise.Enabled      = Janus.Windows.UI.InheritableBoolean.False;
            }
        }