public void Refresh() { myFM.GetProcess().PreRefresh(); myFM.GetProcessContext().PreRefresh(); myFM.GetActivity().PreRefresh(); myFM.GetActivityBF().PreRefresh(); myFM.GetActivityTime().PreRefresh(); myFM.GetDisbursement().PreRefresh(); myFM.GetActivity().DeepLoadByFileId(myFM.CurrentFile.FileId); }
protected override void AfterAdd(DataRow ddr) { string ObjectName = this.myActivityTimeDT.TableName; atriumDB.ActivityTimeRow dr = (atriumDB.ActivityTimeRow)ddr; ActivityConfig.ActivityCodeRow arc = myA.GetActivity().GetACSeriesRow(dr.ActivityRow).ActivityCodeRow; dr.ActivityTimeId = this.myA.AtMng.PKIDGet(ObjectName, 10); dr.Taxed = false; dr.Final = false; dr.Posted = true; dr.FileId = dr.ActivityRow.FileId; if (!arc.IsDefaultHoursNull() && dr.IsHoursNull()) { dr.Hours = Math.Round(arc.DefaultHours, 1); } else { dr.Hours = 0; } // JLL: 2009-12-21 officeid should default to workingAs office and not activity row's officeid dr.OfficeId = myA.AtMng.WorkingAsOfficer.OfficeId; //dr.ActivityRow.OfficeId; dr.OfficerId = myA.AtMng.WorkingAsOfficer.OfficerId; // JLL: 2009-12-21 changed to now as per PS request if (dr.ActivityRow.RowState == DataRowState.Added) { dr.StartTime = dr.ActivityRow.ActivityDate; } else { dr.StartTime = DateTime.Now; } CalcFees(dr); }
private void AutoCompleteBFs(atriumDB.ActivityRow newAC, ActivityConfig.ACSeriesRow acsr) { stackLimit++; if (stackLimit < 9) { //if (acsr.GetACDependencyRowsByPreviousSteps().Length == 0) if (myA.AtMng.acMng.DB.ACDependency.Select("LinkType in (0,4,8,9) and NextStepId=" + acsr.ACSeriesId.ToString()).Length == 0) { ActivityConfig.ACSeriesRow acss = null; //check to see if we are a sub-series? if (newAC.ACSeriesId == acsr.ACSeriesId) { //use this when we are starting to follow the thread back acss = myA.GetActivity().FindParentStepForAutoComplete(newAC); } else { //we have popped into a process without hitting a step //this used to cause a stack overflow //use the acsr to find a parent that has been done //problem is that the process might have multiple references //throw new AtriumException("Workflow is trying to connect through a sub-process without recording a step"); //do it anyways so we can handle nr and questions in same series acss = myA.GetActivity().FindParentStepForAutoComplete(newAC); } if (acss != null && acsr.ACSeriesId != acss.ACSeriesId) { AutoCompleteBFs(newAC, acss); } } // else // { //loop through previous steps and determine what this one completes foreach (ActivityConfig.ACDependencyRow acdr in acsr.GetACDependencyRowsByPreviousSteps()) { if ((StepType)acdr.ACSeriesRowByNextSteps.StepType == StepType.Decision | (StepType)acdr.ACSeriesRowByNextSteps.StepType == StepType.Merge | (StepType)acdr.ACSeriesRowByNextSteps.StepType == StepType.NonRecorded)// | (StepType)acdr.ACSeriesRowByNextSteps.StepType == StepType.Branch | (StepType)acdr.ACSeriesRowByNextSteps.StepType == StepType.Merge) { //don't recurse over obsolete links if (acdr.LinkType != (int)ConnectorType.Obsolete) { AutoCompleteBFs(newAC, acdr.ACSeriesRowByNextSteps); } } else if (!acdr.IsNextStepIdNull() & !acdr.IsACBFIdNull()) { //find bf and complete foreach (atriumDB.ActivityBFRow abr in this.myA.DB.ActivityBF.Select("Completed=0 and fileid=" + newAC.FileId.ToString())) { //changed on april 27 2009 //if ((!abr.IsACDepIdNull() && abr.ACDepId == acxdr.ACDependencyId) | abr.ActivityRow.ACSeriesId==acdr.CurrentStepId) bool standardTest = (!abr.IsACDepIdNull() && abr.ACDepId == acdr.ACDependencyId); bool versionTest = (!abr.IsACDepIdNull() && !acdr.IsOldACDepIdNull() && abr.ACDepId == acdr.OldACDepId); bool oldversionTest = false; if (!standardTest & !versionTest & abr.ActivityRow != null) { oldversionTest = (abr.ActivityRow.ACSeriesId == acdr.CurrentStepId && !abr.IsBFCodeNull() && abr.BFCode == acdr.ACBFRow.BFCode && acdr.NextStepId == newAC.ACSeriesId); } // JLL commented out my fix as per TFS 3943 //oldversionTest = (abr.ActivityRow != null && abr.ActivityRow.ACSeriesId == acdr.CurrentStepId && !abr.IsBFCodeNull() && abr.BFCode == acdr.ACBFRow.BFCode && acdr.NextStepId == newAC.ACSeriesId); if (standardTest || versionTest || oldversionTest) { //don't complete yourself! if (newAC.ActivityId != abr.ActivityId) { AllowEdit = true; //must be in same process or parent process if (newAC.ProcessRow.Thread.StartsWith(abr.ActivityRow.ProcessRow.Thread)) { abr.Completed = true; } else if (abr.ActivityRow.ProcessRow.Thread.StartsWith(newAC.ProcessRow.Thread)) //or child process! { abr.Completed = true; } else if (myA.AtMng.acMng.DB.Series.FindBySeriesId(abr.ActivityRow.ProcessRow.SeriesId).SingleInstancePerFile || myA.AtMng.acMng.DB.Series.FindBySeriesId(abr.ActivityRow.ProcessRow.SeriesId).OncePerFile) { abr.Completed = true; } else if (myA.GetActivity().AboutSameAccount(newAC, abr.ActivityRow)) //there is a relationship between associated objects { abr.Completed = true; } else if (acdr.ACBFRow.AllowManualComplete & acdr.LinkType == (int)ConnectorType.BFOnly)//phase 1 for CLAS! { abr.Completed = true; } AllowEdit = false; } } } } //else if (!acdr.IsNextStepIdNull() & acdr.LinkType==(int)ConnectorType.Transfer & acdr.IsACBFIdNull()) //{ // if (!newAC.IsPreviousActivityIdNull()) // { // atriumDB.ActivityRow preva = myA.DB.Activity.FindByActivityId(newAC.PreviousActivityId); // //don't kill your own process // if(newAC.ProcessId!=preva.ProcessId) // myA.GetActivityBF().CompleteAllOnProcess(preva.ProcessRow,newAC.ProcessId); // } //} } } // } stackLimit--; }
internal ActivityBP(FileManager fm) { myFM = fm; myFM.GetActivity().DeepLoadByFileId(fm.CurrentFile.FileId); }
/// <summary> /// Moves a process to another file /// </summary> /// <param name="pr">process to move</param> /// <param name="toFile">Target file</param> private void Move(atriumDB.ProcessRow pr, int toFileId, atriumDB.ActivityRow splitOn) { FileManager toFM = myA.AtMng.GetFile(toFileId); //need to check permissions on target file if (!toFM.GetProcess().CanAdd(toFM.CurrentFile)) { throw new AtriumException(Properties.Resources.YouNeedAddProcessPermissionOnTheDestinationFile); } CheckMove(pr); //this needs to be here myA.GetActivity().LoadByProcessId(pr.ProcessId); //sort activities by thread atriumDB.ActivityRow[] ars = (atriumDB.ActivityRow[])myA.DB.Activity.Select("processid=" + pr.ProcessId.ToString(), "ConversationIndex"); atriumDB.ProcessRow newPr = null; int oldFileid = pr.FileId; bool moveProc = false; if (splitOn != null && ars.Length > 1 && ars[0].ActivityId != splitOn.ActivityId) { //create new process for split thread newPr = (atriumDB.ProcessRow)Add(myA.CurrentFile); newPr.Active = pr.Active; //newPr.CurrentStep = pr.CurrentStep; newPr.NameE = pr.NameE; newPr.NameF = pr.NameF; newPr.SeriesId = pr.SeriesId; //newPr.Thread = pr.Thread; } else { pr.FileId = toFileId; pr.Thread = pr.ProcessId.ToString(); moveProc = true; foreach (atriumDB.ProcessContextRow pcr in pr.GetProcessContextRows()) { pcr.FileId = toFileId; } } //move all activties on process foreach (atriumDB.ActivityRow par in pr.GetActivityRows()) { if (splitOn == null || par.ConversationIndex.CompareTo(splitOn.ConversationIndex) >= 0) { myA.GetActivity()._Move(par, toFileId); if (newPr != null) { par.ProcessId = newPr.ProcessId; } } } if (moveProc) { FileManager fmOld = myA.AtMng.GetFile(oldFileid); atriumDB.ProcessRow prOld = fmOld.DB.Process.FindByProcessId(pr.ProcessId); if (prOld != null) { prOld.Delete(); prOld.AcceptChanges(); } } }
public void LoadTOC() { pnlDockTop.Height = defaultTopHeight; if (fmCurrent.DB.FileXRef.Select("LinkType=0 and fileid=" + fmCurrent.CurrentFileId.ToString()).Length > 0) { pnlBrowseFiles.Enabled = true; } else { pnlBrowseFiles.Enabled = false; } if (fmCurrent.DB.FileXRef.Select("LinkType=1").Length > 0 || fmCurrent.DB.FileXRef.Select("LinkType=2 and fileid=" + fmCurrent.CurrentFileId).Length > 0) { pnlXRefs.Enabled = true; } else { pnlXRefs.Enabled = false; } SetTooltipsForLinks(); SetFileStatusColor(fmCurrent.CurrentFile.StatusCode); officeDB.OfficeRow orOwnerOffice = null; try { orOwnerOffice = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.OwnerOfficeId).CurrentOffice; lnkJumpToOwnerFile.Tag = orOwnerOffice.OfficeFileId; lnkJumpToOwnerFile.Enabled = (orOwnerOffice.OfficeFileId != fileId); } catch (Exception xoo) { lnkJumpToOwnerFile.Enabled = false; } officeDB.OfficeRow orLeadOffice = null; if (!fmCurrent.CurrentFile.IsLeadOfficeIdNull()) { try { orLeadOffice = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.LeadOfficeId).CurrentOffice; lnkJumpToLeadFile.Visible = true; lnkJumpToLeadFile.Tag = orLeadOffice.OfficeFileId; lnkJumpToLeadFile.Enabled = (orLeadOffice.OfficeFileId != fileId); } catch (Exception xlo) { lnkJumpToLeadFile.Enabled = false; } } else { lnkJumpToLeadFile.Visible = false; } if (!fmCurrent.CurrentFile.IsFullFileNumberNull()) { lblFullNumberValue.Text = fmCurrent.CurrentFile.FullFileNumber; } else { lblFullNumberValue.Text = ""; } lblFilenameValue.Text = fmCurrent.CurrentFile.Name; atriumDB.ActivityRow ar = fmCurrent.GetActivity().GetCurrentCaseStatus(DateTime.Today.AddDays(100)); int csId = 0; if (ar != null) { csId = ar.CaseStatusId; lblStatusDateValue.Text = ar.ActivityDate.ToString("yyyy/MM/dd"); } else { lblStatusDateValue.Text = "N/A"; } // WI 75873 DataRow drProgram = null; if (programId > 0) { DataTable dt = Atmng.GetFile().Codes("Dim2"); DataRow[] dr = dt.Select("ProgramId = " + programId.ToString()); drProgram = dr[0]; appDB.ddLookupRow dlr = (appDB.ddLookupRow)Atmng.DB.ddLookup.Select("LookupName='Dim2'")[0]; lblProgram.Text = dlr["Description" + Atmng.AppMan.Language].ToString(); } else { lblProgram.Visible = false; lblProgramValue.Visible = false; pnlDockTop.Height -= defaultRowHeight; } // -- End // WI 75873 //Shared Folder START lblSharedFolder.Visible = false; lnkSharedFolder.Visible = false; string sharedPath = string.Empty; if (programId == 3) { sharedPath = Atmng.GetSetting(AppStringSetting.DataExchangeNetworkPath) + fmCurrent.CurrentFile.FullFileNumber.Replace("-", @"\"); } else if (programId == 2) { sharedPath = Atmng.GetSetting(AppStringSetting.ISDataExchangeNetworkPath) + fmCurrent.CurrentFile.FullFileNumber.Replace("-", @"\"); } if (sharedPath != string.Empty && System.IO.Directory.Exists(sharedPath)) { lnkSharedFolder.Text = sharedPath; lblSharedFolder.Visible = true; lnkSharedFolder.Visible = true; } else { pnlDockTop.Height -= defaultRowHeight; } //Shared Folder END lblTypeValue.Text = fmCurrent.AtMng.CodeDB.FileType.FindByFileTypeCode(fmCurrent.CurrentFile.FileType)["FileTypeDesc" + Atmng.AppMan.languageCamel].ToString(); lblStatusValue.Text = fmCurrent.AtMng.CodeDB.Status.FindByStatusCode(fmCurrent.CurrentFile.StatusCode)["StatusDesc" + Atmng.AppMan.languageCamel].ToString(); lblCaseStatusValue.Text = fmCurrent.AtMng.CodeDB.CaseStatus.FindByCaseStatusId(csId)["CaseStatusDesc" + Atmng.AppMan.languageCamel].ToString(); if (drProgram != null) { lblProgramValue.Text = (string)drProgram["ProgramDescription" + Atmng.AppMan.languageCamel].ToString(); } if (orOwnerOffice != null) { setOfficeTooltip(lnkJumpToOwnerFile, orOwnerOffice); } if (orLeadOffice != null) { setOfficeTooltip(lnkJumpToLeadFile, orLeadOffice); } //CLAS if (fmCurrent.GetCLASMng() != null && !fmCurrent.CurrentFile.IsOpponentIDNull()) { lmDatasets.CLAS.DebtorRow orDB = fmCurrent.GetCLASMng().GetDebtor().FindLoad(fmCurrent.CurrentFile.OpponentID); if (!orDB.IsNull("SIN")) { lblSINValue.Text = atriumBE.DebtorBE.FormattedSIN(orDB.SIN); } else { lblSINValue.Text = ""; } lnkSINLabel.Visible = true; lblSINValue.Visible = true; if (!fmCurrent.CurrentFile.IsLeadParalegalIDNull()) { lmDatasets.officeDB.OfficerRow orPL = fmCurrent.AtMng.GetOffice(fmCurrent.CurrentFile.OwnerOfficeId).GetOfficer().FindLoad(fmCurrent.CurrentFile.LeadParalegalID); lblParaLegalValue.Text = orPL.LastName + ", " + orPL.FirstName + " (" + orPL.OfficerCode + ")"; lblParalegal.Visible = true; lblParaLegalValue.Visible = true; } else { lblParaLegalValue.Text = ""; lblParalegal.Visible = false; lblParaLegalValue.Visible = false; } } else { //no CLAS; hide row lnkSINLabel.Visible = false; lblSINValue.Visible = false; lblParalegal.Visible = false; lblParaLegalValue.Visible = false; pnlDockTop.Height -= defaultRowHeight; } ParentFile.uiPanel0.Text = fmCurrent.CurrentFile.Name; ucBrowse1.FileContextMenu.UsedInTreeView = false; if (fmCurrent.CurrentFile.FileStructXml != null) { tvContents.Nodes.Clear(); System.Xml.XmlDocument xdToc = new System.Xml.XmlDocument(); xdToc.InnerXml = fmCurrent.CurrentFile.FileStructXml; LoadTOCNode(tvContents.Nodes, xdToc.DocumentElement); tvContents.ExpandAll(); tvContents.Nodes[0].EnsureVisible(); } }