<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Retrieving and Updating Next Invoice #</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Retrieving and Updating Next Invoice #</description>
  <pubDate>Tue, 12 May 2026 23:31:22 -700</pubDate>
  <lastBuildDate>Thu, 25 Nov 2010 19:22:18 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2323</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Retrieving and Updating Next Invoice # : I figured it out. Thanks to Ward&amp;#039;s...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9250#9250</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 25-Nov-2010 at 7:22pm<br /><br />I figured it out. Thanks to Ward's Bad Golfer application.<DIV>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> coop = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Coroutine</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Start(() =&gt; CreateNewJobHistory(ssn));</P><P></P></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Thu, 25 Nov 2010 19:22:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9250#9250</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : New problem arose I moved the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9243#9243</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 24-Nov-2010 at 5:25pm<br /><br />New problem arose I moved the coroutine caller to a repository. From the ViewModel I pass the coroutine method the ssn of the current member, but I get a compile error on the line in red, the&nbsp;Coroutine.Start call. How can I pass a&nbsp;parameter to the&nbsp;coroutine iterator method?&nbsp;<DIV>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//Coroutine caller</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>void</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> CreateJobHistory(</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>string</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> ssn)</P><P>{</P><P></FONT></FONT><FONT color=#ff0000><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> coop = </FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>Coroutine</FONT></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT color=#ff0000>.Start(CreateNewJobHistory(ssn));</FONT></P><P>coop.Completed += (sender, args) =&gt;</P><P>{</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (args.CompletedSuccessfully)</P><P>{</P><P></FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> newJob = coop.Result </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>as</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</P><P>}</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>else</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>{</P><P>}</P><P>};</P><P>}</P></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Wed, 24 Nov 2010 17:25:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9243#9243</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : I think that I figured it out....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9231#9231</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 24-Nov-2010 at 12:41am<br /><br />I think that I figured it out. I will play around with it and post if I can't get it to work.<DIV></DIV>]]>
   </description>
   <pubDate>Wed, 24 Nov 2010 00:41:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9231#9231</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : It never reaches the breakpoint.  Here...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9228#9228</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 6:34pm<br /><br />It never reaches the breakpoint.<DIV>&nbsp;</DIV><DIV>Here is a silly thought. I am developing on a machine running Windows 7 64 bit and running the app in OOB. I know that 64 bit IE does not support Silverlight could there be problems also with OOB and 64 bit?</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 18:34:14 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9228#9228</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : Have you tried letting it run...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9227#9227</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 6:08pm<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">Have you tried letting it run and wait until it creates the new JobHistory?<div><br></div><div>Reading your post again, it sounds like what you're describing is a normal operation.</div><div><br></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">"when it executes the executeAsynce method and I step through the code it fails to fetch a row from the LocalInfos table before it hits the first yield return and the it exits the Coroutine iterator method and returns back to the calling coroutine method."</span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">when the first yield return is hit, execution is being stopped temporarily in the CreateJobHistory routine and will only resume when the previous ExecuteAsync is completed. You saw that it exits the Coroutine iterator method back to the calling coroutine method. This is because the coroutine itself is an async operation. So the whole operation isn't done yet. At this point, the line Manager.LocalInfos.ExecuteAsync() is still getting the LocalInfos and hasn't come back yet.</span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">Try putting your breakpoint at this line and see if it reaches it.</span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas">int</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">&nbsp;nextRefNo = localInfos.NextJobHistRef;</font></font></span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div></div>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 18:08:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9227#9227</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : same thing with another table...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9225#9225</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 5:19pm<br /><br /><P>same thing with another table that at least 50 rows in it. It's almost like it hasn't had time to retrieve the rows by the time it reaches the yield return statement. Does it make a difference that I am using the development server and am not using the BOS in my development machine?</P><DIV></DIV>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 17:19:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9225#9225</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : Hmm, that&amp;#039;s strange. This...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9224#9224</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 5:07pm<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">Hmm, that's strange. This is a straightforward query. Could you try another query with a different entity?</div>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 17:07:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9224#9224</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # :  private void CreateNewJobHistoryCoRoutine() { var...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9222#9222</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 4:49pm<br /><br /><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>private</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>void</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> CreateNewJobHistoryCoRoutine()</P><P>{</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> coop = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Coroutine</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Start(CreateJobHistory);</P><P>coop.Completed += (sender, args) =&gt;</P><P>{</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (args.CompletedSuccessfully)</P><P>{</P><P>newJob = coop.Result </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>as</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>// Order newOrder = coop.Result as Order;</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//// Output += newOrder.ShipName + Environment.NewLine;</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>}</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>else</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>{</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//Error handler here</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>// Output += "New Order creation failed: " + Environment.NewLine;</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>}</P><P>};</P><P>}</P><P>　</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//Coroutine Iterator</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>private</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>IEnumerable</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>INotifyCompleted</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt; CreateJobHistory()</P><P>{</P><P></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT color=#ff0000 size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT color=#ff0000> localInfoOp = Mgr.LocalInfos.ExecuteAsync() //fails to yield any rows, table has 1 row in it.&nbsp;</P><DIV></FONT></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>yield</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>return</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> localInfoOp;</DIV><P>　</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//Get first LocalInfo.NextJobHistRef and increment by 1</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>LocalInfo</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> localInfos = localInfoOp.Results.First&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>LocalInfo</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;();</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>int</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> nextRefNo = localInfos.NextJobHistRef;</P><P>localInfos.NextJobHistRef = nextRefNo + 1;</P><P>　</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//Create a new JobHistory</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> newJob = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Create(Mgr, CurrentMember.SocSecNo, nextRefNo);</P><P>　</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//Create changedEntities and add first LocalInfo to it.</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>List</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Entity</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt; changedEntities = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>List</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Entity</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;();</P><P>changedEntities.Add(localInfos);</P><P>　</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//Save Async</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> saveOp = Mgr.SaveChangesAsync(changedEntities);</P><P>saveOp.Completed += (sender, args) =&gt;</P><P>{</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (args.CompletedSuccessfully)</P><P>{</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>// var savedOrder = args.Entities&#091;0&#093; as Order;</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>// Output += "Save is successful: " + savedOrder.ShipName + Environment.NewLine;</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>}</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>else</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>{</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//Output += "Save failed" + Environment.NewLine;</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>}</P><P>};</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>yield</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>return</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Coroutine</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Return(newJob);</P><P></P><P>} </P></FONT></FONT>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 16:49:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9222#9222</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : Could you paste your code here...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9221#9221</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 4:44pm<br /><br />Could you paste your code here and highlight where it fails?]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 16:44:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9221#9221</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : I fixed up the new code that you...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9220#9220</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 4:33pm<br /><br />I fixed up the new code that you gave me and it compiles&nbsp;fine but the problem is that when it executes the executeAsynce method and I step through the code it fails to fetch a row from the LocalInfos table before it hits the first yield return and the it exits the Coroutine iterator method and returns back to the calling coroutine method.<DIV></DIV>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 16:33:29 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9220#9220</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : BillG,I actually just wrote and...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9219#9219</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 4:10pm<br /><br />BillG,<div><br></div><div>I actually just wrote and tested that code snippet.</div><div><br></div><div>In case you haven't heard, we are creating a new section in our Wiki called the Cookbook. The Cookbook contains short code snippet to teach users how to use DF. Please see below for more info.</div><div><br></div><div><a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/Cookbook" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/Cookbook</a></div>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 16:10:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9219#9219</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : Where did you get this code snippet?...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9218#9218</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 4:03pm<br /><br /><P>Where did you get this code snippet? Is it available with the download. If there a place to find all code snippets?</P><DIV></DIV>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 16:03:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9218#9218</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : smi-mark,Yes, that sounds like...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9217#9217</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 3:21pm<br /><br /><div>smi-mark,</div><div><br></div>Yes, that sounds like that would work as well.]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 15:21:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9217#9217</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : I haven&amp;#039;t really looked at...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9215#9215</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=449" rel="nofollow">smi-mark</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 3:06pm<br /><br />I haven't really looked at the other solutions, but couldn't you do something like this:<br><br>Create Invoice object<br>Pass new invoice object to a function that makes the async retrieval code, updates the object, and then calls the update code?<br><br>This way you create and return your invoice object immediately, and the invoice Id is assigned when the async call returns<br>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 15:06:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9215#9215</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : Oops, my apologies Bill. Here&amp;#039;s...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9213#9213</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 23-Nov-2010 at 12:39pm<br /><br />Oops, my apologies Bill. Here's a new code snippet using the NorthwindIB database. It has a similar concept to what you're trying to do.<div><br></div><div><div>//Coroutine caller</div><div>&nbsp;&nbsp; &nbsp;private void BatchingMultipleAsynchronousTasksWithCoroutines() {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;var coop = Coroutine.Start(CreateAnOrderUsingAnotherOrder);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;coop.Completed += (sender, args) =&gt; {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (args.CompletedSuccessfully) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Order newOrder = coop.Result as Order;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Output += newOrder.ShipName + Environment.NewLine;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;} else {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//Error handler here</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Output += "New Order creation failed: " + Environment.NewLine;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp;};</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;//Coroutine Iterator</div><div>&nbsp;&nbsp; &nbsp;private IEnumerable&lt;INotifyCompleted&gt; CreateAnOrderUsingAnotherOrder() {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;//Query for all Orders and suspend return calls</div><div>&nbsp;&nbsp; &nbsp; &nbsp;var orderOp = _mainMgr.Orders.ExecuteAsync();</div><div>&nbsp;&nbsp; &nbsp; &nbsp;yield return orderOp;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;//Get first Order property, modify it and create a new order using this modified property</div><div>&nbsp;&nbsp; &nbsp; &nbsp;List&lt;Order&gt; orders = new List&lt;Order&gt;(orderOp.Results);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;string newShipName = orders&#091;0&#093;.ShipName + "xxx";</div><div>&nbsp;&nbsp; &nbsp; &nbsp;orders&#091;0&#093;.ShipName = "Vins et alcools Chevalier" + DateTime.Now.Millisecond.ToString();</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;//Create a new Order</div><div>&nbsp;&nbsp; &nbsp; &nbsp;Order newOrder = new Order();</div><div>&nbsp;&nbsp; &nbsp; &nbsp;newOrder.ShipName = newShipName;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;//Create changedEntities and add first Order to it</div><div>&nbsp;&nbsp; &nbsp; &nbsp;List&lt;Entity&gt; changedEntities = new List&lt;Entity&gt;();</div><div>&nbsp;&nbsp; &nbsp; &nbsp;changedEntities.Add(orders&#091;0&#093;);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;//Save async</div><div>&nbsp;&nbsp; &nbsp; &nbsp;var saveOp = _mainMgr.SaveChangesAsync(changedEntities);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;saveOp.Completed += (sender, args) =&gt; {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (args.CompletedSuccessfully) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var savedOrder = args.Entities&#091;0&#093; as Order;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Output += "Save is successful: " + savedOrder.ShipName + Environment.NewLine;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;} else {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Output += "Save failed" + Environment.NewLine;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp;};</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;//Finally return the newly created Order</div><div>&nbsp;&nbsp; &nbsp; &nbsp;yield return Coroutine.Return(newOrder);</div><div>&nbsp;&nbsp; &nbsp;}</div></div>]]>
   </description>
   <pubDate>Tue, 23 Nov 2010 12:39:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9213#9213</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : I put in the new code but I can&amp;#039;t...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9207#9207</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 22-Nov-2010 at 7:46pm<br /><br />I put in the new code but I can't compile it because of the following errors:<DIV>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>private</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> GetNewJobHistory() {</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> coop = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Coroutine</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Start(CreateJobHistory);</P><P>coop.Completed += (sender, args) =&gt;{</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>if</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (args.CompletedSuccessfully){</P><P></FONT></FONT><FONT color=#ff0000><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>return</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> coop.Result </FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>as</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><FONT color=#ff0000>;</P><DIV>Error&nbsp;1&nbsp;Cannot convert lambda expression to delegate type 'System.EventHandler&lt;IdeaBlade.EntityModel.CoroutineCompletedEventArgs&gt;' because some of the return types in the block are not implicitly convertible to the delegate return type&nbsp;C:\Software Development\VS2010\LaborWare2011\LaborWare2011\ViewModels\MemberViewModel.cs&nbsp;566&nbsp;21&nbsp;LaborWare2011<BR></DIV><DIV>Error&nbsp;2&nbsp;Since 'System.EventHandler&lt;IdeaBlade.EntityModel.CoroutineCompletedEventArgs&gt;' returns void, a return keyword must not be followed by an object expression&nbsp;C:\Software Development\VS2010\LaborWare2011\LaborWare2011\ViewModels\MemberViewModel.cs&nbsp;566&nbsp;21&nbsp;LaborWare2011<BR></DIV></FONT><DIV>}</DIV><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>else</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>{</P><P></FONT></FONT><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas><FONT color=#008000 size=2 face=C&#111;nsolas>//Error handler here</P></FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P>}</P><P>};</P><P>}</P></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Mon, 22 Nov 2010 19:46:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9207#9207</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : Hi Bill;You&amp;#039;re maybe right....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9205#9205</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 22-Nov-2010 at 5:47pm<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; "><div>Hi Bill;</div><div><br></div><div>You're maybe right. I think this is how you would implement something similar to what you want to do using Coroutine.</div><div><br></div><div>//Coroutine caller</div><div><br></div><div>private JobHistory GetNewJobHistory() {</div><div><br></div><div>&nbsp;var coop = Coroutine.Start(CreateJobHistory);</div><div>&nbsp;coop.Completed += (sender, args) =&gt; {</div><div>&nbsp;&nbsp;&nbsp;</div><div>&nbsp;&nbsp; &nbsp;if (args.CompletedSuccessfully) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; return coop.Result as JobHistory;</div><div>&nbsp;&nbsp; &nbsp;} else {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; //Error handler here</div><div>&nbsp;&nbsp; &nbsp;}</div><div>&nbsp;}</div><div>}</div><div><br></div><div>//Coroutine Iterator</div><div>private IEnumerable&lt;INotifyCompleted&gt; CreateJobHistory() {</div><div><br></div><div>&nbsp;&nbsp;//Query for all LocalInfo and suspend return calls</div><div>&nbsp;&nbsp;var localInfoOp = Mgr.LocalInfos.ExecuteAsync();</div><div>&nbsp;&nbsp;yield return localInfoOp;</div><div><br></div><div>&nbsp;&nbsp;//Get first LocalInfo.NextJobHistRef and increment by 1</div><div>&nbsp;&nbsp;List&lt;LocalInfo&gt; localInfos = localInfoOp.Results;</div><div>&nbsp;&nbsp;int nextRefNo = localInfos&#091;0&#093;.NextJobHistRef;</div><div>&nbsp;&nbsp;localInfos&#091;0&#093;.NextJobHistRef = nextRefNo + 1;</div><div><br></div><div>&nbsp;&nbsp;//Create a new JobHistory</div><div>&nbsp;&nbsp;JobHistory job = JobHistory.Create(Mgr, CurrentMember.SocSecNo, nextRefNo);</div><div><br></div><div>&nbsp;&nbsp;//Create changedEntities and add first LocalInfo to it.</div><div>&nbsp;&nbsp;List&lt;Entity&gt; changedEntities = new List&lt;Entity&gt;();</div><div>&nbsp;&nbsp;changedEntities.Add(localInfos&#091;0&#093;);</div><div><br></div><div>&nbsp;&nbsp;//Save Async</div><div>&nbsp;&nbsp;Mgr.SaveChangesAsync(changedEntities);</div><div><br></div><div>&nbsp;&nbsp;//Finally return the newly created JobHistory</div><div>&nbsp;&nbsp;yield return Coroutine.Return(job);</div><div>}</div></div>]]>
   </description>
   <pubDate>Mon, 22 Nov 2010 17:47:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9205#9205</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : would the solution to this problem...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9195#9195</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 22-Nov-2010 at 11:10am<br /><br />would the solution to this problem be to use Coroutines?<DIV></DIV>]]>
   </description>
   <pubDate>Mon, 22 Nov 2010 11:10:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9195#9195</guid>
  </item> 
  <item>
   <title>Retrieving and Updating Next Invoice # : I have a table that has a field...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9183#9183</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 2323<br /><strong>Posted:</strong> 21-Nov-2010 at 4:41pm<br /><br />I have a table that has a field called NextInvoiceNo. I need to read in the table, grab the NextInvoiceNo update it by 1 and write it back to the table immediately so that the next user can grab the next number. Unfortunately the following does not work because of the Asynchronou call. How can I fix this code to make it work properly?<DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> CreateJobHistory()</P><P>{</P><P></FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> job = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>();</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>int</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> refNo = GetNextRefNo();</P><P>job = </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>JobHistory</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.Create(Mgr, CurrentMember.SocSecNo, refNo);</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>return</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> job;</P><P>}</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>public</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>int</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> GetNextRefNo()</P><P>{</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>int</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> nextRefNo = 0;</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> query = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>from</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>LocalInfo</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>in</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> Mgr.LocalInfos</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>select</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> LocalInfo;</P><P>Mgr.ExecuteQueryAsync&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>LocalInfo</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;((</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>IEntityQuery</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>LocalInfo</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;)query,</P><P>(op) =&gt;</P><P>{</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> results = op.Results;</P><P></FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>LocalInfo</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> local = results.FirstOrDefault&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>LocalInfo</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;();</P><P>nextRefNo = local.NextJobHistRef;</P><P>local.NextJobHistRef = nextRefNo + 1;</P><P></FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>List</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Entity</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt; changedEntities = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>new</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> </FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>List</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&lt;</FONT></FONT><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas><FONT color=#2b91af size=2 face=C&#111;nsolas>Entity</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>&gt;();</P><P>changedEntities.Add(local);</P><P>Mgr.SaveChangesAsync(changedEntities);</P><P>});</P><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>return</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> nextRefNo;</P></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Sun, 21 Nov 2010 16:41:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2323&amp;PID=9183#9183</guid>
  </item> 
 </channel>
</rss>