summaryrefslogtreecommitdiff
path: root/Project-Unite/Models/Group.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-07 10:04:12 -0400
committerMichael <[email protected]>2017-05-07 10:04:12 -0400
commitca5954e7d2b9c2040f6f421816778d8203161563 (patch)
treebb31a48e7632f78e7a1a3d21ac43658dd278c636 /Project-Unite/Models/Group.cs
parente6c0552be8363a597d2427c2ef1fcb73672ed6e1 (diff)
downloadproject-unite-ca5954e7d2b9c2040f6f421816778d8203161563.tar.gz
project-unite-ca5954e7d2b9c2040f6f421816778d8203161563.tar.bz2
project-unite-ca5954e7d2b9c2040f6f421816778d8203161563.zip
Create group page
Diffstat (limited to 'Project-Unite/Models/Group.cs')
-rw-r--r--Project-Unite/Models/Group.cs60
1 files changed, 60 insertions, 0 deletions
diff --git a/Project-Unite/Models/Group.cs b/Project-Unite/Models/Group.cs
index da5b277..3ecf2f3 100644
--- a/Project-Unite/Models/Group.cs
+++ b/Project-Unite/Models/Group.cs
@@ -1,19 +1,79 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
+using System.Web.Mvc;
namespace Project_Unite.Models
{
+ public class GroupViewModel
+ {
+ public List<SelectListItem> Publicities
+ {
+ get
+ {
+ return new List<SelectListItem>
+ {
+ new SelectListItem { Value="public", Text="Public"},
+ new SelectListItem { Value="publici", Text="Public (Invite Only)"},
+ new SelectListItem { Value="private", Text="Private"},
+ new SelectListItem { Value="privatei", Text="Private (Invite Only)" }
+ };
+ }
+ }
+
+ [Required]
+ [MaxLength(25, ErrorMessage = "Your group's name must have a maximum of 25 characters in it.")]
+ [MinLength(5, ErrorMessage = "You must set a name with at least 5 characters in it.")]
+ public string Name { get; set; }
+
+ [Required]
+ public string Publicity { get; set; }
+
+ [Required]
+ [MaxLength(6, ErrorMessage = "Hexadecimal color values can only have 6 or less digits.")]
+ [MinLength(3, ErrorMessage = "Hexadecimal color values must have at least 3 digits.")]
+ public string BannerColorHex { get; set; }
+
+ [Required]
+ [AllowHtml]
+ public string Description { get; set; }
+
+ [Required]
+ [MaxLength(4, ErrorMessage = "Your Short Name can only have 4 characters. Think of it like an acronym.")]
+ public string ShortName { get; set; }
+
+ }
+
+
public class Group
{
+ [Required]
public string Id { get; set; }
+
+ [Required]
+ [MaxLength(25, ErrorMessage ="Your group's name must have a maximum of 25 characters in it.")]
+ [MinLength(5, ErrorMessage ="You must set a name with at least 5 characters in it.")]
public string Name { get; set; }
+
+ [Required]
public int Publicity { get; set; }
+
+ [Required]
+ [MaxLength(6, ErrorMessage ="Hexadecimal color values can only have 6 or less digits.")]
+ [MinLength(3, ErrorMessage ="Hexadecimal color values must have at least 3 digits.")]
public string BannerColorHex { get; set; }
+
+ [Required]
+ [AllowHtml]
public string Description { get; set; }
+
+ [Required]
+ [MaxLength(4, ErrorMessage ="Your Short Name can only have 4 characters. Think of it like an acronym.")]
public string ShortName { get; set; }
+ [Required]
public double RawReputation { get; set; }
public ApplicationUser[] Users