private static void PopulateDefaults(Domain.Profile pProfile) { if (pProfile == null) { return; } ICollection <PlanActionLookup> planActions = new List <PlanActionLookup>(); List <GlobalPropertyLookup> globalProperties = new List <GlobalPropertyLookup>(); ICollection <PlanActionLookup> initialWorkflows = new List <PlanActionLookup>(); ICollection <PlanActionLookup> commonPlanActions = new List <PlanActionLookup>(); ICollection <PlanActionLookup> finalWorkflows = new List <PlanActionLookup>(); using (DataTransactionBase dt = new OracleDataTransaction(Configuration.StacksConnectionString)) { ProvisioningPlanExtraGateway ppGateway = new ProvisioningPlanExtraGateway(dt.Transaction); ppGateway.Load(planActions); ppGateway.Load(initialWorkflows, commonPlanActions, finalWorkflows); GlobalPropertyGateway gpGateway = new GlobalPropertyGateway(dt.Transaction); gpGateway.Load(globalProperties); } pProfile.ActiveProvisioningPlan.AdvancedConfigurationActions.Clear(); foreach (PlanActionLookup item in (from g in planActions where g.IsSelected select g)) { pProfile.ActiveProvisioningPlan.AdvancedConfigurationActions.Add(item); } pProfile.ProvisioningPlans[0].Properties = globalProperties; pProfile.ActiveProvisioningPlan.InitialWorkflows = initialWorkflows; pProfile.ActiveProvisioningPlan.CommonPlanActions = commonPlanActions; pProfile.ActiveProvisioningPlan.FinalWorkflows = finalWorkflows; }
public void LoadProvisioningPlanExtras_Test() { ICollection <PlanActionLookup> initialWorkflows = new List <PlanActionLookup>(); ICollection <PlanActionLookup> commonPlanActions = new List <PlanActionLookup>(); ICollection <PlanActionLookup> finalWorkflows = new List <PlanActionLookup>(); using (DataTransactionBase dt = new OracleDataTransaction(Configuration.StacksConnectionString)) { ProvisioningPlanExtraGateway gateway = new ProvisioningPlanExtraGateway(dt.Transaction); gateway.Load(initialWorkflows, commonPlanActions, finalWorkflows); } Assert.IsNotNull(initialWorkflows); Assert.IsTrue(initialWorkflows.Count > 0); Debug.WriteLine("initialWorkflows:{0}", initialWorkflows.Count); Assert.IsNotNull(commonPlanActions); Assert.IsTrue(commonPlanActions.Count > 0); Debug.WriteLine("commonPlanActions:{0}", commonPlanActions.Count); Assert.IsNotNull(finalWorkflows); Assert.IsTrue(finalWorkflows.Count > 0); Debug.WriteLine("finalWorkflows:{0}", finalWorkflows.Count); Assert.AreEqual(initialWorkflows.Count, initialWorkflows.Count((item) => item.IsLoaded)); Assert.AreEqual(commonPlanActions.Count, commonPlanActions.Count((item) => item.IsLoaded)); Assert.AreEqual(finalWorkflows.Count, finalWorkflows.Count((item) => item.IsLoaded)); }
public void LoadPostConfigurationActions_Test() { ICollection <PlanActionLookup> items = new List <PlanActionLookup>(); using (DataTransactionBase dt = new OracleDataTransaction(Configuration.StacksConnectionString)) { ProvisioningPlanExtraGateway gateway = new ProvisioningPlanExtraGateway(dt.Transaction); gateway.Load(items); } Assert.IsNotNull(items); Assert.IsTrue(items.Count > 0); Debug.WriteLine("Post Configuration Actions:{0}", items.Count); Assert.AreEqual(items.Count, items.Count((item) => item.IsLoaded)); }
protected void Page_Init(object sender, EventArgs e) { _initialWorkflows = new List <PlanActionLookup>(); _commonPlanActions = new List <PlanActionLookup>(); _finalWorkflows = new List <PlanActionLookup>(); try { using (DataTransactionBase dt = new OracleDataTransaction(Configuration.StacksConnectionString)) { ProvisioningPlanExtraGateway gateway = new ProvisioningPlanExtraGateway(dt.Transaction); gateway.Load(_initialWorkflows, _commonPlanActions, _finalWorkflows); } } catch (Exception ex) { _exception = ex; } }
protected void Page_Init(object sender, EventArgs e) { if (!this.IsPostBack) { _items = new List <PlanActionLookup>(); try { using (DataTransactionBase dt = new OracleDataTransaction(Configuration.StacksConnectionString)) { ProvisioningPlanExtraGateway gateway = new ProvisioningPlanExtraGateway(dt.Transaction); gateway.Load(_items); } } catch (Exception ex) { _exception = ex; } } }