Problem execution in silverlight application

Hi,
I develop a module to delete a production order which is composed of a number of product (entry in the stock).
for that I have to delete the products that constitute the production order (delete entry and save as output) and record movement in the stock table => (in this case I have to recalculate the amount in stock qteStock = qteStock-qteEntree)
when I have a different product removal work properly. The problem arises when I have the same product that is several times the production order, the amount will be wrong in the stock.
foreach (var item in Entrees)
MonContext ctx = MonContext();
Sortie sortie = new Sortie();
sortie.IDArticle = item.IDArticle;
sortie.DateSortie = System.DateTime.Now;
sortie.QteUnitePrimaire = item.QteUnitePrimaire;
//add in table sortie
ctx.Sorties.Add(sortie);
ctx.SubmitChanges();
//add in table stock
Stock stock = new Stock();
stock.idEntreeSortie = sortie.IDSortie;
stock.DateEntreeSortie = DateTime.Now;
stock.IsSortie = true;
stock.IsEntree = false;
stock.IDArticle =item.IDArticle;
stock.qteStock= ctx.GetQuantiteInStock(item.IDArticle) - sortie.QteUnitePrimaire ;
ctx.Stocks.Add(stock);
ctx.SubmitChanges();
to recover the amount in stock in service class
public double? GetQuantiteInStock(int idArticle)
double? qteEntree = this.ObjectContext.Entree.Where(p => p.IDArticle == idArticle).Select(e => e.QteUnitePrimaire).Sum();
double? qteSortie = this.ObjectContext.Sortie.Where(p => p.IDArticle == idArticle).Select(e => e.QteUnitePrimaire).Sum();
return qteEntree-qteSortie;
So my problem is that when I execute my program and when I delete a production order
which contains ArticleID 40 2 times with the amount in the first entry is 3 and the second entry is 5 knowing that the initial amount in the stock is 20. I would have after the suppression of the production order when deleting the first input (qteStock
= 17) and after striking out the second input (qteStock = 15) then it must be recalculated part of 17 so it must be 12
according to my analysis to the execution I see that the program does not perform the operation requested for each item separately (ie it performs the addition output, calculating the qteStock and records in the Stock table before the first item go to the
second ..)
But it performs the addition in the output table for all then continues execution item
it is mainly a sequencing problem
I tried to use a BackgroundWorker to block the execution but without success, still the same problem (it skips the steps)
someone can propose ideas to get around this

The explanation lost me, I'm afraid.
I'm not sure that matters though.
You have to delete a couple of entries then get a total.
The call to
ObjectContext.SaveChanges();
Is on your web server and presumably called by some asynchronous web service ( because this is Silverlight ).
Even if it isn't Silverlight make it work this way anyhow.
Get the result back with a callback you provide when you make that call.
When you get that you can be confident the records are gone.
Then make your calculation call.
Hope that helps.
Technet articles: Uneventful MVVM;
All my Technet Articles

Similar Messages

  • I installed Lion and now seem to have problems with Microsoft Silverlight and other plug ins and applications.  I haven't ever used time machine to back up (my bad I know).  Is there a way to go back to snow leopard with messing up all my files and my set

    I installed Lion and now seem to have problems with Microsoft Silverlight and other plug ins and applications.  I haven't ever used time machine to back up (my bad I know).  Is there a way to go back to snow leopard with messing up all my files and my set?

    Are you using the latest version of Silverkeeper? - v.2.0.2 is stated to be compatible with Snow Leopard.
    http://www.lacie.com/silverkeeper/
    If it's messing things up you could try asking LaCie Support for assistance.

  • How can i deploy a silverlight application when it contains an aspx page (And Aspx page content is a DevExpress Scheduler)

    I have a silverlight application. It has containing many navigation pages in it. One of this pages is containing an .aspx page and i have used devexpress scheduler on there. It is working perfect on development machine but on production machine when client
    logged and navigate to the scheduler page there is a message top of the page saying
    webbrowser is enabled only for out-of-browser applications running with elevated permissions in Internet Explorer.
    And i have found something like that
    https://msdn.microsoft.com/en-us/library/gg192793(v=vs.95)
    But I think my problem is not that in my project properties i always checked the require permission checkbox. i couldnt understand this behavior and how can i solve. I tryed to use .pfx file by adding in project properties signing tub. Even i couldnt understand
    how why are we using this certificate and is it interesting with it
    Also now i seen in my development machine when i opened this page a popup window come up this message:
    the current webpage is trying to open a site in your trusted sites list. Do you want to allow this?
    current site: res/npctrUI.dll
    Trusted site: localhost
    warning allowing this can expose your computer to security risk. If you dont trust the current page, choose no.
    regards
    Hamit YILDIRIM

    Things that require elevated trust will always work in visual studio.
    You need elevated trust to use the webbrowser inside a Silverlight page on a user's machine.
    That means purchasing a security certificate.
    https://msdn.microsoft.com/en-us/library/gg192793(v=vs.95)
    You can open up any old web page in another tab from Silverlight and I would suggest you consider that instead of using a webbrowser control inside a Silverlight page.
    Hope that helps.
    Technet articles: Uneventful MVVM;
    All my Technet Articles

  • Does un-checking "Allow Debuging" in VI properties- execution improves overall application performance?

    Does un-checking "Allow Debuging" in VI properties->execution improves overall application performance?

    > Does un-checking "Allow Debuging" in VI properties->execution improves
    > overall application performance?
    Yes, though it is hard to predict by how much. When debugging is
    enabled, after each node on the diagram there will be a small amount of
    compiled code to test if the VI has a probe, a breakpoint, execution
    hiliting, or the pause button is pressed. The code is quite small,
    about two or three instructions, but if you have twenty nodes in a loop
    and the nodes are doing simple math, these instructions could be 25%
    overhead. For more complex nodes or datatypes, these instructions turn
    into a fraction of a percent.
    Turn it off and measure. If you have other performance problems, read
    the documentation on the profiler and use it to help you find yo
    ur
    bottlenecks.
    Greg McKaskle

  • Each time I try to synch photos from my Windows 7 PC to my iPad2, iTunes stops working, and the error report says Problem Event Name:     APPCRASH   Application Name:     iTunes.exe   Application Version:     10.3.1.55   Application Timestamp:     4deec35

    Each time I try to synch photos from my Windows7 PC to my iPad2, iTunes stops working and the error message is:
    Problem Event Name:                          APPCRASH
      Application Name:                             iTunes.exe
      Application Version:                           10.3.1.55
      Application Timestamp:                    4deec351
      Fault Module Name:                          ntdll.dll
      Fault Module Version:                        6.1.7601.17514
      Fault Module Timestamp:                 4ce7ba58
      Exception Code:                                  c0000005
      Exception Offset:                                0002e3fb
      OS Version:                                          6.1.7601.2.1.0.768.3
      Locale ID:                                             1033
      Additional Information 1:                  0a9e
      Additional Information 2:                  0a9e372d3b4ad19135b953a78882e789
      Additional Information 3:                  0a9e
      Additional Information 4:                  0a9e372d3b4ad19135b953a78882e789
    I reloaded iTunes 10 (64 bit) successfully, but the problem remains the same.
    Any suggestions?

    I looked in the folder from which I want to synch photos, but there is no such thing as an "ipod photo cache" in that folder, or sub-folders, as suggested in the link which you were nice enough to provide.
    I have also tried removing photos from my iPad2 Photos App, and "iTunes has stopped working" shows up  again as soon as I click on the "Synch photos from" button.

  • Microsoft Silverlight application deployment to BO

    Hi,
    Please let me know whether we can deploy a Silverlight application to Business Objects?
    If possible please let me know how to do it?
    Regards,
    Lity

    Bjoern,
    I am not sure if copying the file to the file system will be reliable since I believe that the web content stored in the DB overwrites the file content when the instance is restarted or updated.  I will let you know if I come across this issue and please do the same for me as well. 
    In the mean time I will follow your suggestion as I don't have a better solution.
    Thanks,
    Sam

  • Microsoft Silverlight application deployment to NetWeaver CE v7.1 EhP1

    Hello,
    I'm a bit new to the MS Silverlight development arena but have worked extensively with web development technologies in the past.  Recently I was tasked with getting a Silverlight application to deploy onto NW CE but I'm not sure how to perform the following:
    1) Deploy the crossdomain.xml & clientaccesspolicy.xml files to the root of the NW CE server for security access control
         a) Currently I recieve a MS security access violation messge when performing REST calls to my local MII instance.
    2) Package and deploy the Silverlight content via an SDA into the App. Server environment.
    Any and all help is appreciated.
    Thanks,
    Sam

    Bjoern,
    I am not sure if copying the file to the file system will be reliable since I believe that the web content stored in the DB overwrites the file content when the instance is restarted or updated.  I will let you know if I come across this issue and please do the same for me as well. 
    In the mean time I will follow your suggestion as I don't have a better solution.
    Thanks,
    Sam

  • I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    Can you open the Preview program without loading a file, like by itself?
    If it doesn't load then I suspect a corrupt Preview preference file.
    Deleting the System Preference or other .plist file
    Can you open other files with Preview, like jpg's and images?
    How about other PDFs? or is it just that one you have downloaded?
    Run through this list of fixes
    Step by Step to fix your Mac

  • I am facing problems while openin an application in facebook and other places.when i go to the application,an error shows and firefox closes autmatically either i send error reports or dont.....plz help

    i am facing problems while openin an application in facebook and other places.when i go to the application,an error shows and firefox closes autmatically either i send error reports or dont.....plz help

    Notes:
    1) Please use the code tags when posting code or JNLP/HTML. It helps to retain indentation and avoids asterisks and plus sings being interpreted as formatting marks. To do that, select the code/JNLP etc. and click the CODE button seen on the Plain Text tab of the message posting form.
    2) That launch file is invalid. You might check it (and the project in general) using JaNeLA.
    3) The only place that SimpleSerial class could be, that the JRE would find, is in the root of aeon.jar. Is it actually there?

  • I am facing a caching problem in the Web-Application that I've developed us

    Dear Friends,
    I am facing a caching problem in the Web-Application that I've developed using Java/JSP/Servlet.
    Problem Description: In this application when a hyperlink is clicked it is supposed to go the Handling Servlet and then servlet will fetch the data (using DAO layer) and will store in the session. After this the servlet will forward the request to the view JSP to present the data. The JSP access the object stored in the session and displays the data.
    However, when the link is clicked second time then the request is not received by our servlet and the cached(prev data) page is shown. If we refresh the page then request come to the servlet and we get correct data. But as you will also agree that we don't want the users to refresh the page again and again to get the updated data.
    We've included these lines in JSPs also but it does no good:
    <%
    response.setHeader("Expires", "0");
    response.setHeader("Cache-Control" ,"no-cache, must-revalidate");
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control","no-store");
    %>
    Request you to please give a solution for the same.
    Thanks & Regards,
    Mohan

    However, when the link is clicked second time then the request is not received by our servlet Impossible mate.. can you show your code. You sure there are no javascript errors ?
    Why dont you just remove your object from the session after displaying the data from it and see if your page "automatically" hits the servlet when the link is clicked.
    cheers..
    S

  • Problem while deploying ADF application to standalone WLS server

    Hi,
    I am facing a problem while deploying ADF application to standalone WLS Server.
    Following is the error message that I am getting.
    [07:24:03 PM] ----  Deployment started.  ----
    [07:24:03 PM] Target platform is  (Weblogic 10.3).
    [07:24:07 PM] Retrieving existing application information
    [07:24:08 PM] Running dependency analysis...
    [07:24:08 PM] Building...
    [07:24:13 PM] Deploying 2 profiles...
    [07:24:14 PM] Wrote Web Application Module to D:\WorkSpace3\DashboardUi\deploy\Dashboard.war
    [07:24:14 PM] Wrote Enterprise Application Module to D:\WorkSpace3\deploy\Dashboard.ear
    [07:24:14 PM] Deploying Application...
    [07:24:22 PM] [Deployer:149191]Operation 'deploy' on application 'Dashboard' is initializing on 'msDevServer1'
    [07:24:27 PM] [Deployer:149193]Operation 'deploy' on application 'Dashboard' has failed on 'msDevServer1'
    [07:24:27 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application Dashboard on msDevServer1.: .
    [07:24:27 PM] Weblogic Server Exception: weblogic.application.ModuleException:
    [07:24:27 PM] Caused by: weblogic.common.ResourceException: DataSource DashboardDb already exists
    [07:24:27 PM]   See server logs or server console for more details.
    [07:24:27 PM] weblogic.application.ModuleException:
    [07:24:27 PM] ####  Deployment incomplete.  ####
    [07:24:27 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)Any suggestion how to fix this.
    Thanks
    Ajay

    I logged into console and browsed to 'Home >Summary of JDBC Data Sources' but not able to locate DashboardDb. Please let me know where to find DashboardDB on wls console.
    Also, please let me know how to configure the app to not to auto-deploy JDBC data sources

  • Problem deploying a web application (war)

    Hello,
    I am having a problem deploying a web application in Tomcat.
    Here is what happens:
    -I copied the war file into the webapps directory.
    -I started Tomcat.
    -Tomcat automatically expanded the war file into a directory of the same name.
    The problem is that I get the following error: "The requested resource (/jadmin) is not available." when I try to access my web application
    Can anyone please help?
    Thanks in advance,
    Balteo.

    Hi,
    check the Tomcat log file <tomcat_dir>/logs/localhost_log.yyyy-mm-dd.txt and see if there is an error corresponding to the deployement of the (/jadmin) context.

  • My itunes will not work and this is the error message. Problem signature:   Problem Event Name:     BEX   Application Name:     iTunes.exe   Application Version:     11.0.1.12   Application Timestamp:     50c8fc7e   Fault Module Name:     QuickTime.qts_un

    Problem signature:
      Problem Event Name:          BEX
      Application Name:          iTunes.exe
      Application Version:          11.0.1.12
      Application Timestamp:          50c8fc7e
      Fault Module Name:          QuickTime.qts_unloaded
      Fault Module Version:          0.0.0.0
      Fault Module Timestamp:          4ea5d609
      Exception Offset:          653f1040
      Exception Code:          c0000005
      Exception Data:          00000008
      OS Version:          6.1.7601.2.1.0.768.3
      Locale ID:          1033
      Additional Information 1:          0a9e
      Additional Information 2:          0a9e372d3b4ad19135b953a78882e789
      Additional Information 3:          0a9e
      Additional Information 4:          0a9e372d3b4ad19135b953a78882e789

    I am encountering the same thing as I am trying to restore my iPhone. How to fix this? I tried repairing iTunes. Still having the issue.

  • ITunes stops working moments after selecting . Microsoft offers to find solution but no response?Problem Event Name:     BEX   Application Name:     iTunes.exe   Application Version:     11.2.2.3   Application Timestamp:     5383f31a   Fault Module Name: 

    Microsoft report gives details of problem:
    Problem Event Name:
    BEX
      Application Name:
    iTunes.exe
      Application Version:
    11.2.2.3
      Application Timestamp:
    5383f31a
      Fault Module Name:
    StackHash_0a9e
      Fault Module Version:
    0.0.0.0
      Fault Module Timestamp:
    00000000
      Exception Offset:
    00000008
      Exception Code:
    c0000005
      Exception Data:
    00000008
      OS Version:
    6.1.7601.2.1.0.768.3
      Locale ID:
    2057
      Additional Information 1:
    0a9e
      Additional Information 2:
    0a9e372d3b4ad19135b953a78882e789
      Additional Information 3:
    0a9e
      Additional Information 4:
    0a9e372d3b4ad19135b953a78882e789
    I have tried reloading the iTunes player but same thing happens after selecting it.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    If you've already tried a complete uninstall and reinstall try opening iTunes in safe mode (hold down CTRL+SHIFT as you start iTunes) then going to Edit > Preferences > Store and turning off Show iTunes in the Cloud purchases. You may find iTunes will now start normally.
    tt2

  • My itunes wount open when i try to open it this message comes up Problem signature:   Problem Event Name:     BEX   Application Name:     iTunes.exe   Application Version:     10.6.3.25   Application Timestamp:     4fd16377   Fault Module Name:     CRYPTU

    when i try to open my Itunes this Message comes up
    Problem signature:
      Problem Event Name:    BEX
      Application Name:    iTunes.exe
      Application Version:    10.6.3.25
      Application Timestamp:    4fd16377
      Fault Module Name:    CRYPTUI.dll_unloaded
      Fault Module Version:    0.0.0.0
      Fault Module Timestamp:    4ce7b847
      Exception Offset:    68221040
      Exception Code:    c0000005
      Exception Data:    00000008
      OS Version:    6.1.7601.2.1.0.768.3
      Locale ID:    5129
      Additional Information 1:    0a9e
      Additional Information 2:    0a9e372d3b4ad19135b953a78882e789
      Additional Information 3:    0a9e
      Additional Information 4:    0a9e372d3b4ad19135b953a78882e789
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt

    Taken at face value, you're having trouble with a Windows operating system file there.
    Perhaps try an sfc /scannow. For instructions, see the following Microsoft document:
    How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows Vista or on Windows 7

Maybe you are looking for

  • Blue Screen Error while login screen in My Compaq CQ40 133TU

    Mate ,  I cant login my system. when i swtich on my sytem till login screen it ll coming , but after that showing blue screen error wth this error code  *** stop : 0x0000008E   (0xc0000005, 0x0044005C, 0x92000908, 0x00000000) What to do ? Please give

  • Why won't my pdf resume upload?

    I am applying for a job that requires me to upload a resume in either pdf or rft formats as part of the online application.  I designed and wrote my resume in Word (2003, SP3), opened Adobe Acrobat Pro (9.1.3), used the "Create" function to turn my W

  • Disk Utility Permissions Repair

    I did a permission repair on my hard drive and got the following messages: 2010-03-05 11:43:55 -0800: Permissions differ on "usr/share/derby", should be drwxr-xr-x , they are lrwxr-xr-x . 2010-03-05 11:43:55 -0800: Repaired "usr/share/derby". 2010-03

  • Project will not open. blank screen after load

    I have a pretty major issue, I just finished a rough cut of a feature film and I decided to change my hard drive drive letters so they were more organized. Now premiere pro 2014 (up to date version) will not open the project properly. The file loads

  • TS1368 i did te itunes update on my computer know i can not get my iphone to sync

    i can not get my ipone to sync with i tunes