Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.ComponentModel.DataAnnotations;
  6.  
  7. namespace eBayLister.Models
  8. {
  9.  
  10.  
  11.     public class eBayItem
  12.     {
  13.         [Key]
  14.         public int ItemID { get; set; }
  15.         [Display(Name = "Item SKU")]
  16.         public string ItemSKU { get; set; }     // Not required but needs to be generated if not supplied
  17.         [Required]
  18.         [MaxLength(80, ErrorMessage = "Title can not be longer than 80 characters")]
  19.         public string Title { get; set; }    
  20.         [Required]
  21.         [Display(Name = "Category")]
  22.         public int CategoryID { get; set; }     // Integer corresponds to category name
  23.         [Required]
  24.         [DataType(DataType.Currency)]
  25.         [Range(1,100000,ErrorMessage = "Price cannot be greater than $100,000.")]
  26.         public decimal Price { get; set; }
  27.         [Required]
  28.         [Display(Name = "Condition")]
  29.         public ConditionType Condition { get; set; }
  30.         [Required]
  31.         [Display(Name = "Handling Time")]
  32.         [Range(0,30,ErrorMessage = "Handling time cannot be greater than 30 days.")]
  33.         public int HandlingTime { get; set; }   // 0 represents same day handling
  34.         [Required]
  35.         [Display(Name = "Listing Duration")]
  36.         [Range(1,30,ErrorMessage = "Please select an option from list.")]
  37.         public ListingTime Duration { get; set; }
  38.         [Required]
  39.         [Display(Name = "Listing Type")]
  40.         public ListingType Format { get; set; }
  41.         [Required]
  42.         [Display(Name = "Picture URL")]
  43.         public string PictureURL { get; set; }  // Will need to be adjusted to allow user to browse local files
  44.         [Required]
  45.         [Range(0,30,ErrorMessage ="Quantity cannot be greater than 1,000.")]
  46.         public int Quantity { get; set; }
  47.         [Required]
  48.         [Display(Name = "Product Description")]
  49.         public string ProductDescription { get; set; }
  50.  
  51.     }
  52.  
  53.     public enum ConditionType
  54.     {
  55.         New = 1,
  56.         Used = 0
  57.     }
  58.  
  59.     public enum ListingType
  60.     {
  61.         Auction = 0,
  62.         [Display(Name = "Buy It Now")]
  63.         BuyItNow = 1
  64.     }
  65.  
  66.     public enum ListingTime
  67.     {
  68.         [Display(Name = "Choose...")]
  69.         ZeroDay = 0, // blocked by range
  70.         [Display(Name = "1 Day")]
  71.         OneDay = 1,
  72.         [Display(Name = "3 Days")]
  73.         ThreeDay = 3,
  74.         [Display(Name = "5 Days")]
  75.         FiveDay = 5,
  76.         [Display(Name = "7 Days")]
  77.         SevenDay = 7,
  78.         [Display(Name = "10 Days")]
  79.         TenDay = 10,
  80.         [Display(Name = "30 Days")]
  81.         ThirtyDay = 30
  82.         // Also GoodTilCancelled as option
  83.     }
  84.  
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement