Search Results

Search found 48 results on 2 pages for 'sanders'.

Page 2/2 | < Previous Page | 1 2 

  • About unit testing a function in the zend framework and unit testing in general

    - by sanders
    Hello people, I am diving into the world of unit testing. And i am sort of lost. I learned today that unit testing is testing if a function works. I wanted to test the following function: public function getEventById($id) { return $this->getResource('Event')->getEventById($id); } So i wanted to test this function as follows: public function test_Event_Get_Event_By_Id_Returns_Event_Item() { $p = $this->_model->getEventById(42); $this->assertEquals(42, EventManager_Resource_Event_Item_Interface); $this->assertType('EventManager_Resource_Event_Item_Interface', $p); } But then I got the error: 1) EventTest::test_Event_Get_Event_By_Id_Returns_Event_Item Zend_Db_Table_Exception: No adapter found for EventManager_Resource_Event /home/user/Public/ZendFramework-1.10.1/library/SF/Model/Abstract.php:101 /var/www/nrka2/application/modules/eventManager/models/Event.php:25 But then someone told me that i am currently unit testing and not doing an integration test. So i figured that i have to test the function getEventById on a different way. But I don't understand how. What this function does it just cals a resource and returns the event by id.

    Read the article

  • F# Powerpack's Metadata doesn't recognize FSharp.Core as an F# library

    - by Nathan Sanders
    Here's my test code to isolate the problem: open Microsoft.FSharp.Metadata [<EntryPoint>] let main args = let core = FSharpAssembly.FromFile @"C:\Program Files\FSharp-2.0.0.0\\bin\FSharp.Core.dll" let core2 = FSharpAssembly.FSharpLibrary let core3 = System.AppDomain.CurrentDomain.GetAssemblies() |> Seq.find (fun a -> a.FullName.Contains "Core") |> FSharpAssembly.FromAssembly core.Entities |> Seq.iter (printfn "%A") 0 All three lets should give me the same FSharpAssembly. Instead, all 3 throw an exception that FSharp.Core is not an F# assembly (details below, re-formatted for readability). Two more clues: Using the core3 method, I get the same error for the test F# assembly itself I don't get the error at FSI after doing #r "@C:\Program Files...\FSharp.Powerpack.Metadata.dll". Any ideas? I'm using Visual Studio 2008, F# 2.0 and F# Powerpack 2.0.0.0 (May 20, 2010) release on an oldish XP VM, I think it's updated to SP3 though. (I got the error this morning with Powerpack 1.9.9.9, so I upgraded to 2.0.0.0. I thought that if 1.9.9.9 doesn't recognise F#'s 2.0.0.0's assemblies, then maybe bugfixes in Powerpack 2.0.0.0 would help.) Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.FSharp.Metadata.AssemblyLoader' threw an exception. ---> System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-PowerPack-Metadata>.$Metadata' threw an exception. ---> System.ArgumentException: could not produce an FSharpAssembly object for the assembly 'FSharp.Core' because this is not an F# assembly Parameter name: name at Microsoft.FSharp.Metadata.AssemblyLoader.Add(String name,Assembly assembly) at <StartupCode$FSharp-PowerPack-Metadata>.$Metadata..cctor() --- End of inner exception stack trace --- at Microsoft.FSharp.Metadata.AssemblyLoader..cctor() --- End of inner exception stack trace --- at Microsoft.FSharp.Metadata.AssemblyLoader.Get(Assembly assembly) at Microsoft.FSharp.Metadata.FSharpAssembly.FromAssembly(Assembly assembly) at Program.main(String[] args) in C:\Documents an...\FSMetadataTest\Program.fs:line 11 Press any key to continue . . .

    Read the article

  • Parsec: backtracking not working

    - by Nathan Sanders
    I am trying to parse F# type syntax. I started writing an [F]Parsec grammar and ran into problems, so I simplified the grammar down to this: type ::= identifier | type -> type identifier ::= [A-Za-z0-9.`]+ After running into problems with FParsec, I switched to Parsec, since I have a full chapter of a book dedicated to explaining it. My code for this grammar is typeP = choice [identP, arrowP] identP = do id <- many1 (digit <|> letter <|> char '.' <|> char '`') -- more complicated code here later return id arrowP = do domain <- typeP string "->" range <- typeP return $ "("++domain++" -> "++range++")" run = parse (do t <- typeP eof return t) "F# type syntax" The problem is that Parsec doesn't backtrack by default, so > run "int" Right "int" -- works! > run "int->int" Left "F# type syntax" unexpected "-" expecting digit, letter, ".", "`" or end of input -- doesn't work! The first thing I tried was to reorder typeP: typeP = choice [arrowP, identP] But this just stack overflows because the grammar is left-recursive--typeP never gets to trying identP because it keeps trying arrowP over and over. Next I tried try in various places, for example: typeP = choice [try identP, arrowP] But nothing I do seems to change the basic behaviours of (1) stack overflow or (2) non-recognition of "-" following an identifier. My mistake is probably obvious to anybody who has successfully written a Parsec grammar. Can somebody point it out?

    Read the article

  • Magento Connect getting a 404

    - by sanders
    Hello Everyone I am using magento 1.4.0.1 I want to install new features using magento connect but whenever I go to System magento Connect magento Connect manager I get a 404 I have read that it could have to do with rights. But the rights of which folders? Thanks very much.

    Read the article

  • MySql BulkCopy/Insert from DataReader

    - by Sky Sanders
    I am loading a bunch of rows into MySql in C#. In MS Sql I can feed a DataReader to SqlBulkCopy, but the MySqlBulkCopy only presents itself as a bootstrap for a load from file. So, my current solution is using a prepared command in a transacted loop. Is there a faster way to accomplish bulk loading of MySql using a DataReader source?

    Read the article

  • Why is Gmail not showing my text/html alternative?

    - by Stijn Sanders
    I'm creating an outgoing e-mail message (TIdMessage) with add two TIdText objects, one with ContentType:='text/plain' and one ContentType:='text/html', and also a TIdAttachment object. This seems to work for Outlook, which shows the HTML content, but for some odd reason, GMail keeps showing me the text/plain version by default. I've tried adding the text/html version first, I've tried adding '; charset=iso-8859-1' to the content type string, but I can't seem to find what else is different with other e-mails that GMail is showing the HTML from rightaway.

    Read the article

  • TTCPServer limited to 10 connections?

    - by Stijn Sanders
    I've created a TCP server NT-Service in Delphi 6, I've tried Indy components, Ararat Synapse components, and am now trying just plain old TTcpServer to see which would perform best while using the least resources. I'm surprised to see that the live instance of the service (running on Windows Server) is still limited to 10 connections! Any new connections are forcibly disconnected. Have I missed something? Do I need to set a property or override a method of TCustomTcpServer?

    Read the article

  • jquery fade popupwindow

    - by sanders
    Hello, I am using the popupwindow plugin for jquery to show a form in a popupwindow. How can I close this window after submitting? This is the link I am talking about. I can open a link in a pupup window. But after submitting I want it to open in its parent window.

    Read the article

  • Storing an object to use in multiple classes

    - by Aaron Sanders
    I am wondering the best way to store an object in memory that is used in a lot of classes throughout an application. Let me set up my problem for you: We have multiple databases, 1 per customer. We also have a master table and each row is detailed information about the databases such as database name, server IP it's located and a few config settings. I have an application that loops through those multiple databases and runs some updates on them. The settings I mentioned above are updated each loop iteration into memory. The application then runs through series of processes that include multiple classes using this data. The data never changes during the processes, only during the loop iteration. The variables are related to a customer, so I have them stored in a customer class. I suppose I could make all of the members shared or should I use a singleton for the customer class? I've never actually used a singleton, only read they are good in this type of situation. Are there better solutions to this type of scenario? Also, I could have plans for this application to be multithreaded later. Sorry if this is confusing. If you have questions, let me know and I will answer them. Thanks for your help.

    Read the article

  • CSS: semi-transparent background, but not text

    - by Stijn Sanders
    Is there a way in CSS to make the background of an element semi-transparent, but still have the text of the element non-transparent? (Without separating the text and background in two elements positioned over eachother.) I've tried <p style="position:absolute;background-color:green;filter:alpha(opacity=60);opacity:.6;"><span style="color:white;filter:alpha(opacity=100);opacity:1;">Hello world</span></p> But it looks like child elements are subjected to the opacity of their parent(s), so 'opacity:1' is still drawn as 'opacity:.6' from the parent.

    Read the article

  • Setting selected item in custom Zend_Form_Element

    - by sanders
    Hello Everyone, I have created my own little form element for inputting time's. Since I need this on a few places in my application, i decided to create a seperate element for it. Here is the code so fa: class EventManager_Form_Element_Time extends Zend_Form_Element { public function init() { parent::init(); $this->addDecorator('ViewScript', array( 'viewScript' => 'time.phtml' )); $this->addValidator(new Zend_Validate_Regex('/^[0-9]+:[0-9]+:[0-9]+$/')); } public function setValue($value) { if(is_array($value)) { @list($hours, $minutes, $seconds) = $value; $value = sprintf('%s:%s:%s', $hours, $minutes, $seconds); } return parent::setValue($value); } } The corresponding view script, which I have created is: <?php @list($hours, $minutes, $seconds) = explode(':', $this->element->getValue()); ?> <dt> <?= $this->formLabel($this->element->getName(), $this->element->getLabel()); ?> </dt> <dd> <select id="<?= $this->element->getName();?>"> <option value="00">00</option> <option value="01">01</option> <option value="02">02</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> </select> <select id="<?= $this->element->getName();?>"> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> <input id="<?= $this->element->getName(); ?>" type="hidden" name="<?= $this->element->getName(); ?>[]" value="00" /> <?php if(count($this->element->getMessages()) > 0): ?> <?= $this->formErrors($this->element->getMessages()); ?> <?php endif; ?> </dd> My problem is that sometimes i want to set a default selected value to my selecboxes when I populate my form. The question is how? Is there anyone that could help me out with this? Thanks.

    Read the article

  • c# create an arbitrary length generic parameter string e.g. ?,?,?

    - by Sky Sanders
    I know I am forgetting to remember how to do this and it is late. I want to, in an elegant manner, build a placeholder list for a munged sql command. Have a command with an arbitrary number of parameters, need to build ?,?,? Did I mention that it was a wet brain fart? this is what came out: Regex.Replace(new string('?', _command.Parameters.Count), @"\?\?", @"\?,\?"); You are welcome to make me feel like more of an idiot if you just remember me what I am forgetting. ;-)

    Read the article

  • F# Higher-order property accessors

    - by Nathan Sanders
    I just upgraded my prototyping tuple to a record. Someday it may become a real class. In the meantime, I want to translate code like this: type Example = int * int let examples = [(1,2); (3,4); (5,6)] let field1s = Seq.map (fst >> printfn "%d") examples to this: type Example = { Field1 : int Field2 : int Description : string } let examples = [{Field1 = 1; Field2 = 2; Description = "foo"} {Field1 = 3; Field2 = 4; Description = "bar"} {Field1 = 5; Field2 = 6; Description = "baz"}] let field1s = Seq.map Description examples The problem is that I expected to get a function Description : Example -> string when I declared the Example record, but I don't. I've poked around a little and tried properties on classes, but that doesn't work either. Am I just missing something in the documentation or will I have to write higher-order accessors manually? (That's the workaround I'm using now.)

    Read the article

  • Does F# documentation have a way to search for functions by their types?

    - by Nathan Sanders
    Say I want to know if F# has a library function of type ('T -> bool) -> 'T list -> int ie, something that counts how many items of a list that a function returns true for. (or returns the index of the first item that returns true) I used to use the big list at the MSR site for F# before the documentation on MSDN was ready. I could just search the page for the above text because the types were listed. But now the MSDN documentation only lists types on the individual pages--the module page is a mush of descriptive text. Google kinda-sorta works, but it can't help with // compatible interfaces ('T -> bool) -> Seq<'T> -> int // argument-swaps Seq<'T> -> ('T -> bool) -> int // type-variable names ('a -> bool) -> Seq<'a> -> int // wrappers ('a -> bool) -> 'a list -> option<int> // uncurried versions ('T -> bool) * 'T list -> int // .NET generic syntax ('T -> bool) -> List<'T> -> int // methods List<'T> member : ('T -> bool) -> int Haskell has a standalone program for this called Hoogle. Does F# have an equivalent, like Fing or something?

    Read the article

  • Why is CoRegisterClassObject creating two extra threads?

    - by Stijn Sanders
    I'm trying to fix a problem that only recently happens on a number of machine's on a VPN. They each run a client application I wrote that exposes a COM automation object. For some strange reason I haven't been able to discover yet, one thread in the application takes up all of the available CPU time, slowing other operation on the machine. In observing the application's strange behaviour, I've noticed it's the third thread started, and if I debug on my machine I notice the first call to CoRegisterClassObject created two extra threads. If the second of these two threads is the one that gets into an infinite loop, I'm not at all shure how to fix this. Where could I check next about what's wrong? Could it have started by one of the recent patches rolled out by Microsoft this last 'patch tuesday'? I had a go with ProcessExplorer to extract a stack trace of the thread: ntoskrnl.exe!ExReleaseResourceLite+0x1a3 ntoskrnl.exe!PsGetContextThread+0x329 WLDAP32.dll!Ordinal325+0x1231 WLDAP32.dll!Ordinal325+0x129e WLDAP32.dll!Ordinal325+0x1178 ntdll.dll!LdrInitializeThunk+0x24 ntdll.dll!LdrShutdownThread+0xe9 kernel32.dll!ExitThread+0x3e kernel32.dll!FreeLibraryAndExitThread+0x1e ole32.dll!StringFromGUID2+0x65d kernel32.dll!GetModuleFileNameA+0x1ba

    Read the article

  • Get current Apache version string for display

    - by Stijn Sanders
    I'm writing an Apache module and want to get a string with the Apache name version and other details. Much like what gets added to outgoing headers, e.g.: Server: Apache/2.2.13 (Win32) I've tried code like this: apr_table_get(request_rec->headers_out,"Server") But that doesn't seem to work. Is there an API call I haven't found or am I doomed to get version resource data from httpd.exe?

    Read the article

  • Leading zeroes in php

    - by sanders
    Hello, I would like to present a list from 0 to 59 of with the numbers 0 to 9 have a leading zero. This is my code but it doesn't work so far. Any idea's? for($i=0; $i<60; $i++){ if($i< 10){ sprintf("%0d",$i); } array_push($this->minutes,$i); }

    Read the article

  • New Content: Partner News and Workforce Management Special Report

    - by user462779
    Two new bits of content available on Profit Online: Oracle partner Edgewater Ranzal worked with customer High Sierra Energy to integrate Oracle Hyperion Enterprise Performance Management solutions with Oracle E-Business Suite and simplify an increasingly complex financial reporting system. "They needed to eliminate the older processes where 80% of the time was spent on collecting data and only 20% on analyzing the data.” --Bob Sanders, business development manager, Edgewater Ranzal. In a special report about Workforce Management, Profit wraps up a collection of recent content on the subject and looks at Oracle's recent agreement to acquire SelectMinds. “By adding SelectMinds to Oracle’s Talent Management Cloud, Oracle can help customers with a complete talent management solution, enabling streamlined recruiting practices, more quality referrals, faster employee on-boarding, and better performance.” --Thomas Kurian, Executive Vice President, Oracle Development More updates to come as we continue to add content to Profit Online on a regular basis. Thanks for reading!

    Read the article

  • Enjoy the 22nd 2012 Ig Nobel Awards Ceremony [Video]

    - by Jason Fitzpatrick
    Last night was the 22nd Ig Nobel award ceremony. If you weren’t there to experience the festivities first hand, don’t despair–you can watch the entire ceremony here. If you’re unfamiliar with the Ig Nobel awards Improbable Research, the group behind the awards, is happy to explain: The Ig Nobel Prizes honor achievements that first make people laugh, and then make them think. The prizes are intended to celebrate the unusual, honor the imaginative — and spur people’s interest in science, medicine, and technology. Every year, in a gala ceremony in Harvard’s Sanders Theatre, 1200 splendidly eccentric spectators watch the winners step forward to accept their Prizes. These are physically handed out by genuinely bemused genuine Nobel laureates. Check out the above video to see the awards ceremony (jump to around the 50:00 mark to skip the setup phase) or hit up the link below to read about the 2012 winners. The 2012 Ig Nobel Prize Winners How To Create a Customized Windows 7 Installation Disc With Integrated Updates How to Get Pro Features in Windows Home Versions with Third Party Tools HTG Explains: Is ReadyBoost Worth Using?

    Read the article

  • DB2Command ExecuteNonQuery Insert multiple rows problem

    - by DB2 Nubie
    I'm attempting to insert multiple rows into a DB2 database using C# code like this: string query = "INSERT INTO TESTDB2.RG_Table (V,E,L,N,Q,B,S,P) values" + "('lkjlkj', 'iouoiu', '2009-03-27 12:01:19', 'nnne', 'sdfdf', NULL, NULL, NULL)," + "('lkjlk2', 'iuoiu2', '2009-03-27 12:01:19', 'nnne2', 'sddf2', NULL, NULL, NULL)"; DB2Command cmd = new DB2Command(query, this.transactionConnection, this.transaction); cmd.ExecuteNonQuery(); If I stop building the query string after the first set of values is included it executes without an error. Attempting to load multiple values using this method results in the following error: Upload error : ERROR [42601] [IBM][DB2] SQL0104N An unexpected token "," was found following "". Expected tokens may include: "". SQLSTATE =42601 The SQL syntax matches that which I have read elsewhere, such as http://stackoverflow.com/questions/452859/inserting-multiple-rows-in-a-single-sql-query and IBM's documentation gives this example: cmd = conn.CreateCommand(); cmd.Transaction = trans; cmd.CommandText = "INSERT INTO company_a VALUES(5275, 'Sanders', 20, 'Mgr', 15, 18357.50), " + "(5265, 'Pernal', 20, 'Sales', NULL, 18171.25), " + "(5791, 'O''Brien', 38, 'Sales', 9, 18006.00)"; cmd.ExecuteNonQuery(); Can anyone explain what could account for this?

    Read the article

  • Can't connect in C# and google spreadsheet api

    - by RockySanders99
    Trying to access google spreadsheets using their api. following their example, the code doesnt work, and its not obvious why. All I'm trying to do is to connect, and I keep getting back the same error. This is with their code set as of 4/15/10. Can anyone offer any suggestion on what I'm doing wrong? CodE: using System; using Google.GData.Client; using Google.GData.Extensions; using Google.GData.Spreadsheets; namespace google_spreadsheet { class Program { static void Main(string[] args) { SpreadsheetsService myService = new SpreadsheetsService("MySpreadsheet" ); myService.setUserCredentials("[email protected]", "xxxxxxx"); string token1 = myService.QueryClientLoginToken(); Console.WriteLine("token is {0}", token1); Console.ReadLine(); SpreadsheetQuery query = new SpreadsheetQuery(); SpreadsheetFeed feed = myService.Query(query); Console.WriteLine("list"); foreach (SpreadsheetEntry entry in feed.Entries) { Console.WriteLine("Value: {0}", entry.Title.Text); When I run this, it keeps erroring out at the myService.Query statement, with the following error: Google.GData.Client.GDataRequestException was unhandled Message=Execution of request failed: http://spreadsheets.google.com/feeds/spreadsheets/private/full Source=Google.GData.Client ResponseString=<HTML> <HEAD> <TITLE>Not Found</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Not Found</H1> <H2>Error 404</H2> </BODY> </HTML> StackTrace: at Google.GData.Client.GDataRequest.Execute() at Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter) at Google.GData.Client.GDataGAuthRequest.Execute() at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince, String etag, Int64& contentLength) at Google.GData.Client.Service.Query(Uri queryUri, DateTime ifModifiedSince) at Google.GData.Client.Service.Query(FeedQuery feedQuery) at Google.GData.Spreadsheets.SpreadsheetsService.Query(SpreadsheetQuery feedQuery) at google_spreadsheet.Program.Main(String[] args) in C:\Development Items\VS Projects\VS2008\google_spreadsheet\google_spreadsheet\Program.cs:line 21 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.Net.WebException Message=The remote server returned an error: (404) Not Found. Source=System StackTrace: at System.Net.HttpWebRequest.GetResponse() at Google.GData.Client.GDataRequest.Execute() InnerException: Yet, I can take the url http://spreadsheets.google.com/feeds/spreadsheets/private/full and manually type it in with my username/password, and it works fine. Any suggestions? thanks rocky sanders

    Read the article

  • creating objects in list

    - by prince23
    List myList = new List { new Users{ Name="Kumar", Gender="M", Age=75, Parent="All"}, new Users{ Name="Suresh",Gender="M", Age=50, Parent="Kumar"}, new Users{ Name="Bennette", Gender="F",Age=45, Parent="Kumar"}, new Users{ Name="kian", Gender="M",Age=20, Parent="Suresh"}, new Users{ Name="Nathani", Gender="M",Age=15, Parent="Suresh"}, new Users{ Name="Peter", Gender="M",Age=90, Parent="All"}, new Users{ Name="Mica", Age=56, Gender="M",Parent="Peter"}, new Users{ Name="Linderman", Gender="M",Age=51, Parent="Peter"}, new Users{ Name="john", Age=25, Gender="M",Parent="Mica"}, new Users{ Name="tom", Gender="M",Age=21, Parent="Mica"}, new Users{ Name="Ando", Age=64, Gender="M",Parent="All"}, new Users{ Name="Maya", Age=24, Gender="M",Parent="Ando"}, new Users{ Name="Niki Sanders", Gender="F",Age=2, Parent="Maya"}, new Users{ Name="Angela Patrelli", Gender="F",Age=3, Parent="Maya"}, }; now i need to format the data like here i need to check the parent based on the parent i will be creating objects under the parent objects now { Name="Kumar", Gender="M", Age=75, Parent="All" } this is the top level as a property Parent ="all" now under parent object kumar here we again create a new object to store these information under object(kumar who is the parent) new Users{ Name="Suresh",Gender="M", Age=50, Parent="Kumar"}, new Users{ Name="Bennette", Gender="F",Age=45, Parent="Kumar"}, what i need to do here is i need to check the parent based on the parent create further objects under it ex: i need to achive like this. looking for the syntax how i can do it. public class SampleProjectData { public static ObservableCollection<Product> GetSampleData() { DateTime dtS = DateTime.Now; ObservableCollection<Product> teams = new ObservableCollection<Product>(); teams.Add(new Product() { PDName = "Product1", OverallStartTime = dtS, OverallEndTime = dtS + TimeSpan.FromDays(3), }); Project emp = new Project() { PName = "Project1", OverallStartTime = dtS + TimeSpan.FromDays(1), OverallEndTime = dtS + TimeSpan.FromDays(6) }; emp.Tasks.Add(new Task() { StartTime = dtS, EndTime = dtS + TimeSpan.FromDays(2), TaskName = "John's Task 3" }); emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(3), EndTime = dtS + TimeSpan.FromDays(4), TaskName = "John's Task 2" }); teams[0].Projects.Add(emp); emp = new Project() { PName = "Project2", OverallStartTime = dtS + TimeSpan.FromDays(1.5), OverallEndTime = dtS + TimeSpan.FromDays(5.5) }; emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(1), EndTime = dtS + TimeSpan.FromDays(4), TaskName = "Victor's Task" }); teams[0].Projects.Add(emp); emp = new Project() { PName = "Project3", OverallStartTime = dtS + TimeSpan.FromDays(2), OverallEndTime = dtS + TimeSpan.FromDays(5) }; emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(1), EndTime = dtS + TimeSpan.FromDays(4), TaskName = "Jason's Task 1" }); emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(7), EndTime = dtS + TimeSpan.FromDays(9), TaskName = "Jason's Task 2" }); teams[0].Projects.Add(emp); teams.Add(new Product() { PDName = "Product2", OverallStartTime = dtS, OverallEndTime = dtS + TimeSpan.FromDays(3) }); emp = new Project() { PName = "Project4", OverallStartTime = dtS + TimeSpan.FromDays(0.5), OverallEndTime = dtS + TimeSpan.FromDays(3.5) }; emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(1.5), EndTime = dtS + TimeSpan.FromDays(4), TaskName = "Vicky's Task" }); teams[1].Projects.Add(emp); emp = new Project() { PName = "Project5", OverallStartTime = dtS + TimeSpan.FromDays(2), OverallEndTime = dtS + TimeSpan.FromDays(6) }; emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(2.2), EndTime = dtS + TimeSpan.FromDays(3.8), TaskName = "Oleg's Task 1" }); emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(5), EndTime = dtS + TimeSpan.FromDays(6), TaskName = "Oleg's Task 2" }); emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(8), EndTime = dtS + TimeSpan.FromDays(9.6), TaskName = "Oleg's Task 3" }); teams[1].Projects.Add(emp); emp = new Project() { PName = "Project6", OverallStartTime = dtS + TimeSpan.FromDays(2.5), OverallEndTime = dtS + TimeSpan.FromDays(4.5) }; emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(0.8), EndTime = dtS + TimeSpan.FromDays(2), TaskName = "Kim's Task" }); teams[1].Projects.Add(emp); teams.Add(new Product() { PDName = "Product3", OverallStartTime = dtS, OverallEndTime = dtS + TimeSpan.FromDays(3) }); emp = new Project() { PName = "Project7", OverallStartTime = dtS + TimeSpan.FromDays(5), OverallEndTime = dtS + TimeSpan.FromDays(7.5) }; emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(1.5), EndTime = dtS + TimeSpan.FromDays(4), TaskName = "Balaji's Task 1" }); emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(5), EndTime = dtS + TimeSpan.FromDays(8), TaskName = "Balaji's Task 2" }); teams[2].Projects.Add(emp); emp = new Project() { PName = "Project8", OverallStartTime = dtS + TimeSpan.FromDays(3), OverallEndTime = dtS + TimeSpan.FromDays(6.3) }; emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(1.75), EndTime = dtS + TimeSpan.FromDays(2.25), TaskName = "Li's Task" }); teams[2].Projects.Add(emp); emp = new Project() { PName = "Project9", OverallStartTime = dtS + TimeSpan.FromDays(2), OverallEndTime = dtS + TimeSpan.FromDays(6) }; emp.Tasks.Add(new Task() { StartTime = dtS + TimeSpan.FromDays(2), EndTime = dtS + TimeSpan.FromDays(3), TaskName = "Stacy's Task" }); teams[2].Projects.Add(emp); return teams; } } above is an sample data where i am grouping them with static data in the same way i need **to for teh data which is cmg from DB and i need to store them list** all these three data are comig from different services. and i am storing them in a list now i have three tables data Product , Project, Task. all the data are coming from webservies. i have created three list where i am storing the data in list. List<Project>objpro= new List<Project>(); List<Product>objproduct= new List<Product>(); LIst<Task>objTask= new List<Task>(); **now what i need to do is i need to do the mapping between these tables. if you see above. i have object of Product under Product i have added object of Project and then under project object i have added task object.** now from the above data which is stored in the list i need to do the same mapping between class. and group the data. public class Product : INotifyPropertyChanged { public Product() { this.Projects = new ObservableCollection<Project>(); } public string PDName { get; set; } public ObservableCollection<Project> Projects { get; set; } private DateTime _st; public DateTime OverallStartTime { get { return _st; } set { if (this._st != value) { TimeSpan dur = this._et - this._st; this._st = value; this.OnPropertyChanged("OverallStartTime"); this.OverallEndTime = value + dur; } } } private DateTime _et; public DateTime OverallEndTime { get { return _et; } set { if (this._et != value) { this._et = value; this.OnPropertyChanged("OverallEndTime"); } } } #region INotifyPropertyChanged Members protected void OnPropertyChanged(string name) { if (this.PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(name)); } public event PropertyChangedEventHandler PropertyChanged; #endregion } public class Project : INotifyPropertyChanged { public Project() { this.Tasks = new ObservableCollection<Task>(); } public string PName { get; set; } public ObservableCollection<Task> Tasks { get; set; } DateTime _st; public DateTime OverallStartTime { get { return _st; } set { if (this._st != value) { TimeSpan dur = this._et - this._st; this._st = value; this.OnPropertyChanged("OverallStartTime"); this.OverallEndTime = value + dur; } } } DateTime _et; public DateTime OverallEndTime { get { return _et; } set { if (this._et != value) { this._et = value; this.OnPropertyChanged("OverallEndTime"); } } } #region INotifyPropertyChanged Members protected void OnPropertyChanged(string name) { if (this.PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(name)); } public event PropertyChangedEventHandler PropertyChanged; #endregion } public class Task : INotifyPropertyChanged { public string TaskName { get; set; } DateTime _st; public DateTime StartTime { get { return _st; } set { if (this._st != value) { TimeSpan dur = this._et - this._st; this._st = value; this.OnPropertyChanged("StartTime"); this.EndTime = value + dur; } } } private DateTime _et; public DateTime EndTime { get { return _et; } set { if (this._et != value) { this._et = value; this.OnPropertyChanged("EndTime"); } } } #region INotifyPropertyChanged Members protected void OnPropertyChanged(string name) { if (this.PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(name)); } public event PropertyChangedEventHandler PropertyChanged; #endregion } hope my question is clear

    Read the article

< Previous Page | 1 2