Exemple #1
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);
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #2
0
 private void DoLoadXrefData()
 {
     //fmCurrent.GetFileXRef().LoadByFileId(fmCurrent.CurrentFile.FileId);
     //fmCurrent.GetFileXRef().LoadByOtherFileId(fmCurrent.CurrentFile.FileId);
     foreach (atriumDB.FileXRefRow fxr in fmCurrent.DB.FileXRef)
     {
         if (fxr.LinkType == 1 && ((CheckBox)pnlXRefsContainer.Controls["chkXref" + fxr.Id]).Checked)
         {
             if (fxr.OtherFileId != fmCurrent.CurrentFile.FileId)
             {
                 fmCurrent.GetActivity().DeepLoadByFileId(fxr.OtherFileId);
                 fmCurrent.GetDocMng().GetDocument().LoadByFileId(fxr.OtherFileId);
                 //fmCurrent.GetDocMng().GetRecipient().LoadByFileId(fxr.OtherFileId);
             }
             else if (fxr.FileId != fmCurrent.CurrentFile.FileId)
             {
                 fmCurrent.GetActivity().DeepLoadByFileId(fxr.FileId);
                 fmCurrent.GetDocMng().GetDocument().LoadByFileId(fxr.FileId);
                 //fmCurrent.GetDocMng().GetRecipient().LoadByFileId(fxr.FileId);
             }
         }
     }
 }
Exemple #3
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;
                    }
                }
            }
        }
Exemple #4
0
        private void DisbAll(atriumDB.SRPRow drSrp, int docId)
        {
            bool encounteredError = false;
            int  lineNum          = 0;

            try
            {
                docDB.DocumentRow doc = myA.GetDocMng().GetDocument().Load(docId);

                // Create an instance of StreamReader to read from a file.
                // The using statement also closes the StreamReader.
                using (StringReader sr = new StringReader(doc.DocContentRow.ContentsAsText))
                {
                    String line;

                    // Read and display lines from the file until the end of
                    // the file is reached.

                    while ((line = sr.ReadLine()) != null && (line != ""))
                    {
                        lineNum++;
                        string[] elem = new string[7];
                        line.Split(new char[] { ',' }, 7).CopyTo(elem, 0);

                        string   officeFileNo = elem[0].Replace("\"", "");
                        DateTime activityDate = DateTime.Parse(elem[1].Replace("\"", ""));
                        DateTime disbDate     = DateTime.Parse(elem[2].Replace("\"", ""));
                        string   disbTypeCode = elem[3].Replace("\"", "");
                        string   comment      = elem[6] == null ? "" : elem[6].Substring(1, elem[6].Length - 2);

                        if (elem[4] == null && elem[5] == null)
                        {
                            WriteErrorLog(officeFileNo, activityDate, disbTypeCode, disbDate, Resources.BothTaxableDisbursementAndNonTaxableDisbursementCannotBeBlank);
                            encounteredError = true;
                        }
                        else
                        {
                            decimal taxableDisb    = elem[4] == null ? 0 : Convert.ToDecimal(elem[4]);
                            decimal nonTaxableDisb = elem[5] == null ? 0 : Convert.ToDecimal(elem[5]);

                            CodesDB.DisbursementTypeRow disbTypeR = myA.AtMng.CodeDB.DisbursementType.FindByDisbursementType(disbTypeCode);
                            if (disbTypeR == null)
                            {
                            }
                            else if (disbTypeR.IsBulk)
                            {
                                DisbBulkRow(officeFileNo, disbDate, disbTypeR, taxableDisb, nonTaxableDisb, comment, ref encounteredError, drSrp.OfficeID, drSrp.SRPDate);
                            }
                            else
                            {
                                DisbDetailRow(officeFileNo, activityDate, disbDate, disbTypeR, taxableDisb, nonTaxableDisb, comment, ref encounteredError, drSrp.OfficeID, drSrp.SRPDate);
                            }
                        }
                    } // end of while loop
                }
            }
            catch (Exception e)
            {
                // Let the user know what went wrong.
                WriteErrorLog(Resources.LineNumber + lineNum.ToString() + " - " + e.Message);
                System.Diagnostics.Debug.WriteLine(e.ToString());
                throw e;
            }
            DisbUpdate(encounteredError);

            WriteErrorLog(lineNum.ToString() + Resources.DisbursementRecordsImportedSuccessfully);
        }
Exemple #5
0
        protected override void AfterChange(DataColumn dc, DataRow row)
        {
            atriumDB.ActivityBFRow dr = (atriumDB.ActivityBFRow)row;
            switch (dc.ColumnName)
            {
            case ActivityFields.Completed:
                //if (dr.Completed && dr.isMail && dr.isRead == false)
                //JLL: 2018-07-19 removed ismail flag. mark as read whenever it's completed.
                if (dr.Completed && dr.isRead == false)
                {
                    dr.isRead = true;
                }

                if (dr.Completed)
                {
                    dr.CompletedByID = this.myA.AtMng.WorkingAsOfficer.OfficerId;
                    dr.CompletedDate = DateTime.Now;
                }
                else
                {
                    dr.SetCompletedByIDNull();
                    dr.SetCompletedDateNull();
                }

                dr.EndEdit();
                break;

            case "BFType":
                switch (dr.BFType)
                {
                //case 1: //Office BFs
                //    dr.SetBFOfficerIDNull();
                //    dr.SetRoleCodeNull();
                //    dr.ForOfficeId = myA.AtMng.OfficeLoggedOn.OfficeId;
                //    break;

                case 2:         //Direct - wipe out Role; update ForOfficeId to LoggedOnOffice
                    dr.BFOfficerID = myA.AtMng.WorkingAsOfficer.OfficerId;
                    dr.SetRoleCodeNull();
                    //dr.ForOfficeId = myA.AtMng.OfficeLoggedOn.OfficeId;
                    break;

                case 7:         //Roles
                    dr.SetBFOfficerIDNull();
                    dr.SetRoleCodeNull();
                    //dr.ForOfficeId = myA.AtMng.OfficeLoggedOn.OfficeId;
                    break;

                case 8:         //Recipient
                    //JLL: 2009/07/27 Handling of proper diarizing without FILE - e.g. LA09.04
                    if (dr.ActivityRow.IsDocIdNull())
                    {
                        throw new Exception("Workflow is not configured properly.  Please contact an administrator.  \n\nError: Cannot use BF Type Recipient without a document");
                    }
                    else
                    {
                        docDB.DocumentRow docr = myA.GetDocMng().DB.Document.FindByDocId(dr.ActivityRow.DocId);
                        //if (docr.GetRecipientRows().Length == 0)
                        //    myA.GetDocMng().GetRecipient().LoadByDocId(docr.DocId);
                        bool notfound = true;
                        foreach (docDB.RecipientRow rr in docr.GetRecipientRows())
                        {
                            if (rr.Type == "1")
                            {
                                if (!rr.IsOfficerIdNull())
                                {
                                    dr.BFOfficerID = rr.OfficerId;
                                    notfound       = false;
                                }
                            }
                        }
                        if (notfound)
                        {
                            throw new Exception("Workflow is not configured properly.  Please contact an administrator.  \n\nError: Cannot use BF Type Recipient without an officer as the document \"To\" recipient");
                        }
                    }
                    break;
                }
                break;
            }
        }