How do I compute the sum of several "Money" type properties (some may contain NULL values) in a computed property of an entity in LIghswitch using C#

I am developing a Lightswitch Application and in one of the Entities I have several currency type properties and I would like to add them all up in one calculated property using C#. For instance:
I have 3 columns Amount1                 Amount2                 Amount3 And would like the total
sum of the 3 fields.
With result = Amount1 + Amount2 + Amount3
The will add all the column as long as there is data but if Amount2 is NULL then no result is written to the computed property.

Here is the actual code.
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
Microsoft.LightSwitch;
namespace
LightSwitchApplication
publicpartialclassTransaction
partialvoidTotalDue_Compute(refdecimal?
result)
// Set result to the desired field value
            result = StandardServiceFee + TransferFee + EstoppleFee + StateSurcharge + AttorneySurcharge + CountyRecordingSurcharge + OutOfCountryFee + ROFR + RCITransferFee
+ OtherFee + MF2015 + MF2016;
partialvoidMF2016_Validate(EntityValidationResultsBuilderresults)
// results.AddPropertyError("<Error-Message>");
            result = (MF2016.HasValue ? (
decimal)MF2016 : 0);

Similar Messages

  • How to compute the sum of words(or bytes) in tables?

    Sir
    Now there are several million records in a database, I want compute the sum of words(or bytes) in the tables by query condition. I have used ADO to access database, and use this SQL sentence-- 'select length(clo1)+length(col2)+..+length(coln) from tablename where ..' --to get resultset, and then sum the result, the speed is slowly. How can i do it in great efficiency?
    thanks

    Increasing efficiency?
    You revisit the requirement. Determine exactly what is needed and whether adding LENGHTs of columns provides a correct, never mind accurate, answer.
    Oracle space utilisation, physical row size and so on, are vastly more complex than a simply adding lengths of columns together.

  • HT2731 If i purchased coins on a game (doubledown casino) and did not get the coins, but was charged for them what do i do? How do i get the coins or my money refunded?

    If i made a purchase on a game(doubledown casino) but never got my coins, but the money was taken out of the account, what do I do? How do I get the coins or my money back?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • How do I get the names of tracks I type in Adobe Audition 3 to copy to the Sony CD-RW CRX217E in myD

    How do I get the names of tracks I type in Adobe Audition 3 to copy to the Sony CD-RW CRX217E in my Dell Precision Workstation 670?
    I have recorded 10 tracks of voice with music using Adobe Audition 3 and Sony CD-RW CRX217E with no problem.
    The problem is, however, that the names I type in Audition 3 for each of the tracks and artist do not copy to the CD I have recorded. This means that when I play the tracks on any playback equipment that shows the names of the tracks and artists, etc. all that appears on the screen is the track number, such as Track 1, Track 2, etc.
    I am using a Dell Precision Workstation 670
    Inter®Xeon
    CPU3.2GHz
    3.19GHz,2.00GB RAM
    SYSTEM
    Professional x64 Edition
    V2003
    SP 2, v.4354
    Thank you
    NoPro

    Well, there is one possibility, but I can't absolutely confirm this. I had a look at the specification for the drive on the Dell website:
    http://support.dell.com/support/edocs/storage/P89087/en/index.htm
    and nowhere does it say that the drive supports CD-Text, I'm afraid. Even though all drives can in theory write this, a lot have the header hard-coded, and simply can't. Yours may be one of them, but I think you'll have to ask Dell to confirm this.

  • How do I change the font color in Live Type?

    How can I change the font color in Live Type?

    By trial and error, I also learned that the slide icon just to the right of the color box must be moved to the right in order for the new color to be visible. Of course, the amount to which the slide is moved determines the intensity of and color. Thanks for putting me on the right track (no pun intended).

  • How do I get the numbers ipad app to plot a graph of dates against values, where the most recent date is on the right of the graph, but the most recent date is at the top rather than bottom of the rows in the table?

    How do I get the numbers ipad app to plot a graph of dates against values, where the most recent date is on the right of the graph, but the most recent date is at the top rather than bottom of the rows in the table?
    Also how can it be a line graph without plotting a circle at each value?
    Thanks this is very frustrating

    Make a copy of the table and produce your Line chart or Bar chart from the copy. Sort the copy into the order you want to see in your chart.
    Alternately you could use a Scatter Chart...
    Jerry

  • How to transfer database table contain null values, primary key, and foreign key to the another database in same server. using INSERT method.

    how to transfer database table contain null values, primary key, and foreign key to the another database in same server. using INSERT method.  thanks

    INSERT targetdb.dbo.tbl (col1, col2, col3, ...)
       SELECT col1, col2, col3, ...
       FROM   sourcedb.dbo.tbl
    Or what is your question really about? Since you talke about foreign keys etc, I suspect that you want to transfer the entire table definition, but you cannot do that with an INSERT statement.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How can i Customize the UIShell Global Area ? Please provide some steps to Customize the UIShell Global Area ? i am using JDev11.1.1.7.0g version

    How can i Customize the UIShell Global Area ? Please provide some steps to Customize the UIShell Global Area ?
    Actually I need to manipulate the Sign Out link and put my own Sign out link there...

    If you want to customize the UI Shell you need to download the code from UI Shell - ADF UI Patterns - Dynamic Tabs UI Shell Template Functional UI Pattern ; modiffy and use the updated code

  • I just bought a $25 Gift Card and used 15 dollars of it. But iTunes saying I used all of it? How do I get the rest of my money back?

    I just bought a $25 Gift Card and used 15 dollars of it. But iTunes saying I used all of it? How do I get the rest of my money back?

    Check the account area of the iTunes Store window on the right to check the balance. You must use the credit remaining, no refunds.
    Apple - Apple Gift Cards

  • Synching iPad to older PC with less memory - it ran out of space when synching movies - how to synch in the future if we can't free up more space (besides buying a new computer)

    In synching ****...
    Tried to synch iPad with several movies with a PC that turns out to have less memory than what we were synching.
    Turned off synching of movies to try to help the situation...
    WRONG!
    Two of our purchased movies were deleted in the synch process.
    We got them out of the PCs recycle bin but now how have them on the PC, but not on the iPad.
    How do we (a) get the movies back on to the iPad and
    (b) solve the longer-term issue of synching if the PC can't hold as much as the iPad does?

    He doent have to , we already know he's got a xp machines, and from the fact that he's able to sync his iPad to it tells me enough, it's enough to know he has the basic requirements to connect an external drive via USB, now we know it's an older machine so it more than likely he's got a ton of .tmp files taking up space,and the fact that he's asking this question makes me think he may not be aware of how to  search the HD via *.tmp from the command line to location and delete those files, so w/o buying a new machine, his only option is intsalling a new Internal or external hard drive.

  • How do I maintain the configuration of my current Catalog in PSE9 when moving it to a new computer?

    While the Version Sets in my current catalog are collapsed, the version sets in the Catalog on the new computer have all become 'expanded'; this is unacceptable to me, as many of the pairs that are stacked as Version Sets have become separated.  While all of the Version Sets are "tagged", it looks as though many of the photos in the expanded sets are without tags.  Problem #2 is that the hierarchy of Keyword Tags that I currently use is lost when the Catalog is restored in the new computer's Organizer.  I currently use about 500 Keyword Tags, divided into 6 categories (i.e. People, Places, Locations, Events, Other, Bird Species).  On the new computer, the tags are alphabetized without being separated into their 6 categories.  I currently have close to 30,000 items in my Catalog, and have spent hundreds, perhaps thousands, of hours editing (and saving both the original and  edited files as  Version Sets), tagging and captioning all of my photos.  I followed the instructions previously published in "Photoshop Elements Help" regarding backup to an external hard drive and restoring the files in an empty Organizer on the new computer.  I also used the "Save Keyword Tags To File" command before the backup.  Any suggestions to remedy my two major problems would be appreciated.  I do have the intact "current" Catalog on my old computer, complete with tags and captions, collapsed version sets, and a list of Keyword Tags organized in the Hierarchy that has worked best for me.

    Hi,
    The version set information and the tag hierarchy are stored within the catalog. It sounds as though you haven't brought over the catalog from your old computer.
    The recommended way to transfer elements from one computer to a new one is to use the Backup catalog to CD, DVD or Hard Drive on your old system and then use Restore catalog from CD, DVD or Hard Drive on your new system. Is this how you did it?
    That should have preserved your version sets.
    Brian

  • How can i get the music off my ipod to go back to itunes?  i wiped my computer out and want to keep the songs i have on my ipod and load more on there too.  how do i do that?

    i wiped my computer out yesterday and i want to keep the songs i have on my ipod and load more on there.  how do i get the songs that are on my ipod back in my itunes library so i can keep those on my ipod and put more on it?  I didnt purchase the music from itunes, they came from old cds i had and now dont have them anymore. 

    beverlyfromhillsville wrote:
    how do i do the music sync?
    The music sync is how you got the music from the computer to the ipod in the first place.
    You cannot sync it from the ipod to the computer as I explained in the previous post, unless it is itunes purchased music.

  • How Do You Add the Sum of Check Marks in a Form?

    I've built a form that has three fields across "Yes, No, In Progress". with several questions down the side. How do I count the "yes" "No" " In Progress" check mark fields? Also need to know what the script would be if I considered all the "No"and "In Progress" fields to be no.
    Yes / No and In Progress fields = % of completion.

    You can change the order required by just clicking the element by using a unbundle

  • How can I get the sum of fields in group

    example:
    fieldA fieldB
    2 30 group1
    2 10
    5 12 group2
    5 14
    5 9 group3
    8 1
    8 9
    the values of fieldA in a group are the same.
    each group i want to calculate fieldA only once: 258
    how can i do this and display the sum at the first page of the report?

    Please re-post if this is still an issue to the Business Objects Integration Kits - SAP Forum or purchase a case and have a dedicated support engineer work with you directly

  • How do you get the sum of two columns multipied together?

    I can't seem to figure out how to get the sum of two columns multiplied together without having to manually type out each location (example: A1*B1+A2*B2+A3*B3, etc..).  Though the idea seems to be rather simple, everything I have tried has only given me an error.  I know there must be an easier way of doing this, but I get lost in the explanations given in 'help' area of numbers, can someone help me?

    C3=SUMPRODUCT(A3:A18, B3:B18)
    the function SUMPRODUCT() takes ranges and multiplies corresponding cells in the ranges, then adds them together.
    I the case I show SUMPRODUCT() performs:
    A3*B3 + A4*B4 + A5*B5 + A6*B6 + ... +  A18*B18
    If you want to perform the same operation on the whole column (s) you could modify the formula:
    C3=SUMPRODUCT(A, B)

Maybe you are looking for

  • SQL Server 2012 PowerPivot System Service not visible in Central Administration

    Hi all, I want to test PowerPivot 2012 on the following configuration: - Windows Server 2008 R2  - Sharepoint 2010 - Enterprise edition - SQL Server 2008 R2  - PowerPivot for Sharepoint<o:p></o:p> As such, I downloaded SQL Server 2012 Evaluation and

  • Updated my old iPhone with new OS, now locked out

    I have an iPhone 4 that was  relegated to streaming in my kitchen when I upgraded to a 5 last year. I had removed password protection because it no longer needed it. When I upgraded the 4 to OS 7, iTunes installed a non-existant password, and now I c

  • XtremeMusic digital o

    Hi folks, I recently bought the Onkyo 576 and would like to connect my X-fi with it. But the only way i was able to do this was via Klinke to Cinch (don't know the english word, I'm german ) I want to have a digital Signal, but atm it's analogue. So

  • IFilter 9 not searching OCR .PDFs post SP2 for Office 2007 Servers

    Prior to the installation of Service Pack 2 for Office 2007 Servers, .PDF files that were scanned in and then ran against Optical Character Recognition software could be searched with the iFliter 9 for Windows MOSS, x64.  Now, those specific files no

  • EJB and Server

    Dear All: I am VERY MUCH new to EJB and just started 3 months back. I am right now using JBoss in Linux platform, using XDoclet and Ant. However my requirement is to use a new J2EE application server apart from JBoss in order to implement all my web