private bool DocumentIsLatest(ACEState aceState, appDB.AutoSaveRow autoSaveRow) { atriumDB dsA = new atriumDB(); dsA.Merge(ACEState.GetDSFromACE(aceState, myFM.GetBEMngrForTable("EFile").MyDS.DataSetName)); docDB dsD = new docDB(); dsD.Merge(ACEState.GetDSFromACE(aceState, myFM.GetBEMngrForTable("Document").MyDS.DataSetName)); int docid = dsA.Activity.FindByActivityId(aceState.ActivityId).DocId; if (!myFM.GetDocMng().GetDocContent().IsLatest(dsD.DocContent.FindByDocId(docid))) { autoSaveRow.RowError = LawMate.Properties.Resources.DocumentPartOfSuspendedActivityHasBeenModified; return(false); } return(true); }
private void LoadAutoSaveDT() { ACEStateDictionnary = new Dictionary <int, ACEState>(); AutoSaveDT = new appDB.AutoSaveDataTable(); AutoSaveDT.BeginLoadData(); foreach (ACEState itm in AtMng.SuspendedAcs) { //itm.Doc_DB.FileFormat.Merge(myFM.GetDocMng().DB.FileFormat); appDB.AutoSaveRow autoSaveRow = AutoSaveDT.NewAutoSaveRow(); ActivityConfig.ACSeriesRow[] acsr = (ActivityConfig.ACSeriesRow[])AtMng.acMng.DB.ACSeries.Select("acseriesid=" + itm.AcSeriesId); ACEStateDictionnary.Add(itm.ActivityId, itm); if (acsr.Length == 1) { autoSaveRow.StepCode = acsr[0].StepCode; autoSaveRow.ActivityNameEng = acsr[0].ActivityNameEng; } else { autoSaveRow.StepCode = LawMate.Properties.Resources.INVALIDACTIVITY; autoSaveRow.ActivityNameEng = LawMate.Properties.Resources.INVALIDACTIVITY; autoSaveRow.RowError = LawMate.Properties.Resources.CannotResumeThisActivity; } autoSaveRow.ActivityId = itm.ActivityId; atriumDB dsA = new atriumDB(); dsA.Merge(ACEState.GetDSFromACE(itm, myFM.GetBEMngrForTable("EFile").MyDS.DataSetName)); autoSaveRow.SaveDate = dsA.Activity.FindByActivityId(itm.ActivityId).ActivityEntryDate; if (!dsA.Activity.FindByActivityId(itm.ActivityId).IsDocIdNull()) { DocumentIsLatest(itm, autoSaveRow); } atriumDB.EFileRow efr = dsA.EFile.FindByFileId(itm.FileId); if (efr == null) { try { efr = AtMng.GetFile(itm.FileId).CurrentFile; } catch (Exception x) { efr = null; } } if (efr == null) { autoSaveRow.FileName = LawMate.Properties.Resources.DELETEDFILE; autoSaveRow.FullFileNumber = LawMate.Properties.Resources.DELETEDFILE; autoSaveRow.RowError = LawMate.Properties.Resources.CannotResumeThisActivity; } else { autoSaveRow.FileName = efr.NameE; autoSaveRow.FullFileNumber = efr.FullFileNumber; } AutoSaveDT.AddAutoSaveRow(autoSaveRow); } AutoSaveDT.EndLoadData(); }