static void RunRetrivalTest2() { ResourceSummary Input = new ResourceSummary(); IEnumerable <object> Result = null; ConsoleKeyInfo KeyInfo; do { try { PerformanceDbContext_NonVirtual DbContext = new PerformanceDbContext_NonVirtual(); var x = DbContext.ResourceSummaryDetails.CallStoredProc(Input); Result = x[0].ToArray(); foreach (ResourceSummaryNonVirtual each in Result) { Console.WriteLine(string.Format("{0}\t{1}\t{2}\t{3}", each.PersonId, each.PersonName, each.EmailAddress, each.CTC)); } } catch (Exception ex) { Console.WriteLine("Exception : {0}", ex.Message); } Console.WriteLine("Would you like to perform it again ? (Y/N)"); KeyInfo = Console.ReadKey(); }while (KeyInfo.Key == ConsoleKey.Y); }
private double GetNetChange(ResourceSummary res) { var net = res.CurrentAmount - res.LastAmount; var time = res.CurrentTime - res.LastTime; return(net / time); }
public void ScopeTestRetrival() { ResourceSummary Input = new ResourceSummary() { PersonName = "SQL++.NET LIB PERFORMANCE TEST", }; IEnumerable <ResourceSummary> Result = null; using (ConnectionScope scope = new ConnectionScope()) { SpResourceSummaryDetails Sp = new SpResourceSummaryDetails(); Stopwatch sw = new Stopwatch(); sw.Start(); Sp.Execute(Input, scope); Result = Sp.GetResult <ResourceSummary>(); sw.Stop(); Console.Write(string.Format("Record Retrived : {0} in time : {1}", Result != null?Result.Count():0, sw.Elapsed.TotalMilliseconds)); } //Assert.IsTrue(Result.Count > 0); }
public void MultipleInstanceTest() { ResourceSummary Input = new ResourceSummary() { PersonName = "SQL++.NET LIB PERFORMANCE TEST", Country = "INDIA", State = "GUJRAT", City = "BARODA", District = "UNSPECIFIED", Street = "1 SHANTI NAGAR STREET", HouseNo = "C8", Pin = Hash, MobileNo = "9051778445", HomePhoneNo = "9051778445", EmailAddress = "*****@*****.**", MothersName = "VISUAL STUDIO", FathersName = "PERFORMANCE TEST", Employer = "COP", EmployerCountry = "USA", EmployerCity = "BALA CYNWYD", EmployerState = "PENNSYLVANIA", EmployerDistrict = "PHILADELPHIA", EmployerPin = "19015", EmployerStreet = "1800 GREEN STREET", EmployerHouseNo = "F2", CTC = 100.56M, NET = 10000.65M, Gross = 10000.11M, MobileNo2 = Hash }; SpResourceSummary[] Multiple = new SpResourceSummary[10]; for (int i = 0; i < Multiple.Length; i++) { Multiple[i] = new SpResourceSummary(); } StringBuilder Log = new StringBuilder(); for (int i = 0; i < Multiple.Length; i++) { Input.CTC = Input.CTC + 1; Multiple[i].Execute(Input); Log.AppendLine(string.Format("Person ID : {0}", Input.PersonId)); } Console.Write(Log); Assert.IsTrue(Input.PersonId > 0); }
public void CF_ResourseSummaryRetrivalTest() { ResourceSummary Input = new ResourceSummary() { PersonName = "SQL++.NET LIB PERFORMANCE TEST", Country = "INDIA", State = "GUJRAT", City = "BARODA", District = "UNSPECIFIED", Street = "1 SHANTI NAGAR STREET", HouseNo = "C8", Pin = Hash, MobileNo = "9051778445", HomePhoneNo = "9051778445", EmailAddress = "*****@*****.**", MothersName = "VISUAL STUDIO", FathersName = "PERFORMANCE TEST", Employer = "COP", EmployerCountry = "USA", EmployerCity = "BALA CYNWYD", EmployerState = "PENNSYLVANIA", EmployerDistrict = "PHILADELPHIA", EmployerPin = "19015", EmployerStreet = "1800 GREEN STREET", EmployerHouseNo = "F2", CTC = 1000.56M, NET = 10000.65M, Gross = 10000.11M, MobileNo2 = Hash }; PerformanceDbContext_NonVirtual DbContext = new PerformanceDbContext_NonVirtual(); Stopwatch sw = new Stopwatch(); sw.Start(); var x = DbContext.ResourceSummaryDetails.CallStoredProc(Input); object[] xxx = x[0].ToArray(); sw.Stop(); Console.Write(string.Format("Record Retrived : {0} in time : {1}", xxx != null ? xxx.Length : 0, sw.Elapsed.TotalMilliseconds)); }
public void ScopeTestDefault() { ResourceSummary Input = new ResourceSummary() { PersonName = "SQL++.NET LIB PERFORMANCE TEST", Country = "INDIA", State = "GUJRAT", City = "BARODA", District = "UNSPECIFIED", Street = "1 SHANTI NAGAR STREET", HouseNo = "C8", Pin = Hash, MobileNo = "9051778445", HomePhoneNo = "9051778445", EmailAddress = "*****@*****.**", MothersName = "VISUAL STUDIO", FathersName = "PERFORMANCE TEST", Employer = "COP", EmployerCountry = "USA", EmployerCity = "BALA CYNWYD", EmployerState = "PENNSYLVANIA", EmployerDistrict = "PHILADELPHIA", EmployerPin = "19015", EmployerStreet = "1800 GREEN STREET", EmployerHouseNo = "F2", CTC = 1000.56M, NET = 10000.65M, Gross = 10000.11M, MobileNo2 = Hash }; using (ConnectionScope scope = new ConnectionScope()) { SpResourceSummary Sp = new SpResourceSummary(); for (int i = 0; i < 100; i++) { Sp.Execute(Input, scope); } } Console.Write(Input.PersonId); Assert.IsTrue(Input.PersonId > 0); }
/// <summary> /// Gets the assigned to where clause. /// </summary> /// <param name="sessionId">The session identifier.</param> /// <param name="fieldFilter">The field filter.</param> /// <returns> /// Assigned to WhereClause /// </returns> private static string GetAssignedToWhereClause(string sessionId, FieldFilter fieldFilter, BurnRetrievalOptions retrievalOptions) { string assignedToClause = " "; ResourceSummaryCollection reesourceSummaryCollection = null; if (fieldFilter.AssignedTo != null && !string.IsNullOrEmpty(fieldFilter.AssignedTo.Name)) { if (fieldFilter.AssignedTo.Name.Contains("Team")) { // Get Group Members ResourceService resourceService = new ResourceService(); ResourceIdentity groupresourceIdenity = new ResourceIdentity() { Id = fieldFilter.AssignedTo.Id, Name = fieldFilter.AssignedTo.Name }; reesourceSummaryCollection = resourceService.GetMembersOfGroup(sessionId, groupresourceIdenity, false); if (reesourceSummaryCollection != null && reesourceSummaryCollection.Count > 0) { assignedToClause = assignedToClause + string.Format("({0})", BuildResourceString(reesourceSummaryCollection)); } } else { // Individual resource we can use directly as below. assignedToClause = assignedToClause + string.Format("('{0}')", fieldFilter.AssignedTo.Name); reesourceSummaryCollection = new ResourceSummaryCollection(); ResourceSummary resourceSummary = new ResourceSummary(); resourceSummary.Identity = new ResourceIdentity(); resourceSummary.Identity.Name = fieldFilter.AssignedTo.Name; reesourceSummaryCollection.Add(resourceSummary); } PopulateTeamMembers(retrievalOptions, reesourceSummaryCollection); } return(assignedToClause); }
static void RunRetrivalTest1() { ResourceSummary Input = new ResourceSummary(); IEnumerable <ResourceSummary> Result = null; ConsoleKeyInfo KeyInfo; do { try { using (ConnectionScope scope = new ConnectionScope()) { SpResourceSummaryDetails Sp = new SpResourceSummaryDetails(); Sp.Execute(Input, scope); Result = Sp.GetResult <ResourceSummary>(); } foreach (ResourceSummary each in Result) { Console.WriteLine(string.Format("{0}\t{1}\t{2}\t{3}", each.PersonId, each.PersonName, each.EmailAddress, each.CTC)); } } catch (Exception ex) { Console.WriteLine("Exception : {0}", ex.Message); } Console.WriteLine("Would you like to perform it again ? (Y/N)"); KeyInfo = Console.ReadKey(); }while (KeyInfo.Key == ConsoleKey.Y); }