public void ShouldHaveSLAConfigurationInfo() { var sla = new SLAConfiguration((NameValueCollection)ConfigurationManager.GetSection( "Apollo.AIM.SNAP/Workflow.SLA")); Console.WriteLine(sla.AccessTeamAckInMinute); Console.WriteLine(sla.AccessTeamCreateWorkflowInDays); Console.WriteLine(sla.ManagerApprovalInDays); Console.WriteLine(sla.TeamApprovalInDays); Console.WriteLine(sla.TechnicalApprovalInDays); }
private static DateTime getDueDate(ActorApprovalType approvalType, WorkflowState fr, WorkflowState to) { int day = 1; DateTime due; SLAConfiguration slaCfg = new SLAConfiguration((NameValueCollection)ConfigurationManager.GetSection( "Apollo.AIM.SNAP/Workflow.SLA")); switch (approvalType) { case ActorApprovalType.Manager: day = System.Convert.ToInt16(slaCfg.ManagerApprovalInDays); break; case ActorApprovalType.Team_Approver: day = System.Convert.ToInt16(slaCfg.TeamApprovalInDays); break; case ActorApprovalType.Technical_Approver: day = System.Convert.ToInt16(slaCfg.TechnicalApprovalInDays); break; case ActorApprovalType.Workflow_Admin: if (to == WorkflowState.Workflow_Created) // same as the due day for technical approval since workflow admin depend on it day = System.Convert.ToInt16(slaCfg.TechnicalApprovalInDays); break; } using (var db = new SNAPDatabaseDataContext()) { due = db.udf_get_next_business_day(DateTime.Now, day) ?? DateTime.Now.AddDays(-1); } return due; }