public override void PostSetWorkflowStatus() { if (WorkflowStatus == MyEnums.WorkflowStatus.Approved && TableId != null) { var dimBase = Session.GetObjectByKey <DimensionBase>(TableId.TableId);//Test if TableId has Dimension if (dimBase != null) { DimensionHeader = DimensionBase.FindOrCreateDimHeader(this); } } base.PostSetWorkflowStatus(); }
public static void InitDB(Session _session) { using (UnitOfWork uOW = new UnitOfWork()) { TableBase.TableBaseRowsBuilder(uOW); DimensionBase.TableBaseRowsBuilder(uOW); Country.BuildTableRows(uOW); Currency.BuildTableRows(uOW); Workflow.BuildTableRows(uOW); WorkflowStep.BuildTableRows(uOW); GLParms.BuildTableRows(uOW); SecurityAccessType.BuildTableRows(uOW); } }
public static void TableBaseRowsBuilder(UnitOfWork session) { List <int> DimList = GetDimList(); foreach (var item in DimList) { var tab = (TableBase.TableEnum)item; var dbTabRow = session.GetObjectByKey <DimensionBase>(item); if (dbTabRow == null) { dbTabRow = new DimensionBase(session) { TableId = item, DimensionPrefix = TableBase.DimPrefixEnum.GetTableDimPrefix(tab), DimensionSequence = GetDimSequence(tab) }; dbTabRow.Save(); } } session.CommitChanges(); }