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 static void RedirectToNewProvisioningPlanPage(Domain.Profile pProfile, HttpResponse pResponse) { if (pProfile == null || pResponse == null) { return; } pResponse.Redirect(NEW_PROVISIONING_PLAN_PAGE_URL); }
public static void RedirectToAdvancedSummaryPage(Domain.Profile pProfile, HttpResponse pResponse) { if (pProfile == null || pResponse == null) { return; } pResponse.Redirect(ADVANCED_SUMMARY_PAGE_URL); }
public static void RedirectToAdvancedConfigurationActionsPage(Domain.Profile pProfile, HttpResponse pResponse) { if (pProfile == null || pResponse == null) { return; } pResponse.Redirect(ADVANCED_CONFIGURATION_ACTIONS_PAGE_URL); }
public static void RedirectToCustomerObjectsPage(Domain.Profile pProfile, HttpResponse pResponse) { if (pProfile == null || pResponse == null) { return; } pResponse.Redirect(CUSTOMER_OBJECTS_PAGE_URL); }
private string CreateFilenameString(Domain.Profile pProfile) { if (pProfile == null) { return(null); } return(string.Format("attachment; filename={0}.{1}", pProfile.FileName, EXTENSION)); }
public static void RedirectToApplicationStacksPage(Domain.Profile pProfile, HttpResponse pResponse) { if (pProfile == null || pResponse == null) { return; } pResponse.Redirect(APPLICATION_STACKS_PAGE_URL); }
public static void RedirectToProvisioningPlanExtrasPage(Domain.Profile pProfile, HttpResponse pResponse) { if (pProfile == null || pResponse == null) { return; } pResponse.Redirect(PROVISIONING_PLAN_EXTRAS_PAGE_URL); }
public static void RedirectToDomainNameResolutionPage(Domain.Profile pProfile, HttpResponse pResponse) { if (pProfile == null || pResponse == null) { return; } pResponse.Redirect(DOMAIN_NAME_RESOLUTION_PAGE_URL); }
public static void RedirectToDocumentPage(Domain.Profile pProfile, HttpResponse pResponse, string pBackPage) { if (pProfile == null || pResponse == null) { return; } string url = string.Format("{0}?{1}={2}", DOCUMENT_PAGE_URL, BACK_TO_PARAMETER, pBackPage); pResponse.Redirect(url); }
public static List <PlanAction> Get(Domain.Profile Profile) { #if DEBUG_ME System.Diagnostics.Debug.WriteLine("Get()", DEBUG_CATEGORY); #endif return(( from a in Profile.ActiveProvisioningPlan.PlanActions where a.Order >= 0 select a ).ToList <PlanAction>()); }
public void XsltTransform_Test() { string xslt = IOHelper.ReadText(XsltPath); Domain.Profile profile = CreateTestProfile(); string html = XmlHelper.Transform(xslt, profile.Xml); Debug.WriteLine(profile.Xml); Debug.WriteLine(""); Debug.WriteLine(html); }
public static void RedirectToITICPage(Domain.Profile pProfile, HttpResponse pResponse) { if (pProfile == null || pResponse == null) { return; } //if (pProfile.StructureVersion.Major == 0) // pResponse.Redirect(ITIC_0_PAGE_URL); //else // ; pResponse.Redirect(ITIC_PAGE_URL); }
private string CreateFilename(Domain.Profile pProfile) { if (pProfile == null) { return(null); } string result = Path.Combine(this.Request.PhysicalApplicationPath, PROFILES_FOLDER); result = Path.Combine(result, string.Format("{0}.{1}", this.CurrentProfile.FileName, EXTENSION)); return(result); }
public static void RedirectToPlatformStacksPage(Domain.Profile pProfile, HttpResponse pResponse) { if (pProfile == null || pResponse == null) { return; } //if (pProfile.StructureVersion.Major == 0) // pResponse.Redirect(PLATFORM_STACKS_0_PAGE_URL); //else // ; pResponse.Redirect(PLATFORM_STACKS_PAGE_URL); }
public ReturnInfo UpdateLeave(ProfileInputDto entity) { ReturnInfo RInfo = new ReturnInfo(); StringBuilder sb = new StringBuilder(); string ValidateInfo = Helper.ValidateProfileInputDto(entity); sb.Append(ValidateInfo); if (string.IsNullOrEmpty(ValidateInfo)) { Domain.Profile lv = _profileRepository.GetByID(entity.ProfileNo).FirstOrDefault(); if (lv != null) { try { lv.EmpName = entity.EmpName; lv.EmpIDNo = entity.EmpIDNo; lv.EmpTelNo = entity.EmpTelNo; lv.RelationVal = entity.RelationVal; lv.IsDimissioned = entity.IsDimissioned; lv.UpdateTime = DateTime.Now; lv.Updator = entity.Updator; _unitOfWork.RegisterDirty(lv); bool result = _unitOfWork.Commit(); RInfo.IsSuccess = result; RInfo.ErrorInfo = sb.ToString(); return(RInfo); } catch (Exception ex) { _unitOfWork.RegisterClean(lv); _unitOfWork.Rollback(); sb.Append(ex.Message); RInfo.IsSuccess = false; RInfo.ErrorInfo = sb.ToString(); return(RInfo); } } else { RInfo.IsSuccess = false; RInfo.ErrorInfo = "未找到该档案!"; return(RInfo); } } else { RInfo.IsSuccess = false; RInfo.ErrorInfo = sb.ToString(); return(RInfo); } }
public static Domain.Profile PopulateProfile(HttpSessionState pSession) { if (pSession == null) { return(null); } Domain.Profile result = new Domain.Profile(); result.ProvisioningPlans = new List <ProvisioningPlan> { new ProvisioningPlan() }; result.ActiveProvisioningPlan = result.ProvisioningPlans[0]; PopulateDefaults(result); pSession[PROFILE_SESSION_KEY] = result; return(result); }
private Domain.Profile GenerateProfile( string firebaseId, string displayName, string notes) { var profile = new Domain.Profile { DisplayName = displayName, Notes = notes, IsActive = true }; profile.AddTimestamp(firebaseId, true); var memberProfileRelationship = new MemberProfileRelationship { MemberId = _memberDataService.GetByFirebaseId(firebaseId).Id }; profile.MemberProfileRelationships.Add(memberProfileRelationship); return(profile); }
public static void UpdateDatacentreSuffix(Domain.Profile Profile, string ParametersString, string MaxRetries, string ContinueOnError, string Order) { #if DEBUG_ME System.Diagnostics.Debug.WriteLine( string.Format("UpdateDatacentreSuffix(ps:{0}, mr:{1}, coe:{2}, o:{3})", ParametersString, MaxRetries, ContinueOnError, Order), DEBUG_CATEGORY); #endif int maxRetries = 0; try { maxRetries = Convert.ToInt32(MaxRetries); } catch { return; } int order = 0; try { order = Convert.ToInt32(Order); } catch { return; } List <PlanAction> planActions = Profile.ActiveProvisioningPlan.PlanActions; PlanAction action = planActions.First((i) => i.ParametersString == ParametersString); action.MaxRetries = maxRetries; action.ContinueOnError = ContinueOnError; action.Order = order; planActions.Sort(PlanAction.CompareByOrder); Profile.ActiveProvisioningPlan.PlanActions = planActions; }
public void CreateXml_Test() { Domain.Profile profile = CreateTestProfile(); Debug.WriteLine(profile.Xml); }
private Domain.Profile CreateTestProfile() { Domain.Profile result = new Domain.Profile(); result.ProvisioningPlans = new List <ProvisioningPlan> { new ProvisioningPlan() }; result.ActiveProvisioningPlan = result.ProvisioningPlans[0]; // ITIC InfrastructureLookup inf = new InfrastructureLookup("III", "Test Infrastructure"); CapabilityLookup cap = new CapabilityLookup("SSS", "Test Capability"); LogicalSystemGroupLookup lsg = new LogicalSystemGroupLookup("LSG8", "Test LSG"); result.ITICCode = new ITIC(inf, cap, lsg); // Platform Stack FilterLookup mjf = new FilterLookup("MjF"); FilterLookup mnf = new FilterLookup("MiF"); StackLookup ps = new StackLookup("WIN_x86_2008R_64_2.7.0_GREEN_SK", "Test Windows 2008 64bit Build 2.7.0", "Test descr"); result.ActiveProvisioningPlan.PlatformStack = new PlatformStack(mjf, mnf, new FilterLookup("64bit"), new FilterLookup("2.7.0"), ps); // Application Stacks mjf = new FilterLookup("MjF2"); mnf = new FilterLookup("MiF2"); ps = new StackLookup("TEST_APP_STACK", "Test 2", "Test descr 2"); result.ActiveProvisioningPlan.ApplicationStacks.Add(new Stack(mjf, mnf, ps)); mjf = new FilterLookup("MjF3"); mnf = new FilterLookup("MiF3"); ps = new StackLookup("TEST_APP_STACK_3", "Test 3", "Test descr 3"); result.ActiveProvisioningPlan.ApplicationStacks.Add(new Stack(mjf, mnf, ps)); // Provisioning Plan Extras PlanActionLookup p = new PlanActionLookup() { Code = "CODE1", Name = "NAME1", Description = "DESc1", IsSelected = true }; result.ActiveProvisioningPlan.InitialWorkflows.Add(p); p = new PlanActionLookup() { Code = "CODE2", Name = "NAME2", Description = "DESc2", IsSelected = true }; result.ActiveProvisioningPlan.CommonPlanActions.Add(p); p = new PlanActionLookup() { Code = "CODE3", Name = "NAME3", Description = "DESc3", IsSelected = true }; result.ActiveProvisioningPlan.FinalWorkflows.Add(p); // Post Configuration Actions PlanActionLookup pca = new PlanActionLookup() { Code = "PCA1", Name = "PCA1_NAME1", Description = "PCA1_DESc1", IsSelected = true, IsTextBox = true, DefaultValue = "TEST VALUE" }; result.ActiveProvisioningPlan.AdvancedConfigurationActions.Add(pca); return(result); }
private IEnumerable <Domain.Member> GetOwners(Domain.Profile profile) { return(profile.MemberProfileRelationships.Select(mp => mp.Member)); }
public static void Delete(Domain.Profile Profile, string ParametersString) { Profile.ActiveProvisioningPlan.PlanActions.Remove( Profile.ActiveProvisioningPlan.PlanActions.First(p => p.ParametersString == ParametersString)); }