document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.ComponentModel.DataAnnotations.Schema;
  7.  
  8. namespace LatihanMVVM
  9. {
  10.     public class ItemPenjualan
  11.     {
  12.         public ItemPenjualan()
  13.         {
  14.             DiskonPersen = 0;
  15.         }
  16.  
  17.         [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  18.         public long Id { get; set; }
  19.  
  20.         [StringLength(50)]
  21.         public string NamaBarang { get; set; }
  22.  
  23.         public int Jumlah { get; set; }
  24.  
  25.         public decimal Harga { get; set; }
  26.  
  27.         public decimal DiskonPersen { get; set; }
  28.  
  29.         public decimal Total()
  30.         {
  31.             decimal total = Jumlah * Harga;
  32.             return total - (DiskonPersen / 100 * total);
  33.         }
  34.     }
  35. }
');