private void CreateAC(int fileId, int acseriesId, DateTime acDate, string ctxTable, int ctxId) { ActivityConfig.ACSeriesRow acsr = myA.acMng.DB.ACSeries.FindByACSeriesId(acseriesId); FileManager fm = myA.GetFile(fileId); ActivityBP abp = fm.InitActivityProcess(); abp.CreateAC(acseriesId, acDate, ctxTable, ctxId, 0, ACEngine.RevType.Nothing); }
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; } }
public ActivityBP InitActivityProcess() { if (CurrentFile.RowState != DataRowState.Added) { LoadAll(false); } if (rfbp == null) { rfbp = new ActivityBP(this); lastActivityRefresh = DateTime.Now; } else { int delay = -AtMng.GetSetting(AppIntSetting.ActivityReloadInterval); if (DateTime.Now.AddSeconds(delay).CompareTo(lastActivityRefresh) > 0) { GetActivity().DeepLoadByFileId(CurrentFileId); lastActivityRefresh = DateTime.Now; } } return(rfbp); }
private void uiButton1_Click(object sender, EventArgs e) { try { //launch Wizard passing ACSeries, ABP? NextStep ns = null; if (ebStepCode.Tag != null) { ns = (NextStep)ebStepCode.Tag; } if (ns != null) { ACEngine test = new ACEngine(fm); test.TestForSteps(ns.acs.ACSeriesId); if (!test.HasAnyRel & (!test.HasDoc | uiCheckBox1.Checked)) { atriumBE.ActivityBP abp = fm.InitActivityProcess(); if (test.HasDoc) { abp.SkipDoc = uiCheckBox1.Checked; } abp.CreateAC(ns.acs.ACSeriesId, calActivityDate.Value, null, 0, 0, ACEngine.RevType.Nothing); abp.SkipDoc = false; calActivityDate.Value = DateTime.Today; ebStepCode.Text = ""; ebNSType.Text = ""; Init(fm, ffns); ffns.MoreInfo("activity", abp.LastActivityId.Value); ffns.fileToc.LoadTOC(); } else { bool docIsSkipped = false; if (uiCheckBox1.Checked) { docIsSkipped = true; } ebStepCode.Text = ""; ebNSType.Text = ""; ffns.ReadOnly = true; if (ns.prevAc != null) { facwr = new fACWizard(fm, (ACEngine.Step)ns.acs.InitialStep, ns.acs.ACSeriesId, ns.prevAc.ActivityId, docIsSkipped); } else { facwr = new fACWizard(fm, (ACEngine.Step)ns.acs.InitialStep, ns.acs.ACSeriesId, docIsSkipped); } facwr.setAcDate(calActivityDate.Value, ns); facwr.Show(); calActivityDate.Value = DateTime.Today; DoSkipCheck(null); ffns.HookupWizClose(facwr); ffns.fileToc.LoadTOC(); } } else { MessageBox.Show(Properties.Resources.QuickACSelectAValidCode); } } catch (Exception x) { UIHelper.HandleUIException(x); } }