2018-12-18 15:42:39 +01:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2018-12-08 19:27:21 +01:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
|
|
|
|
namespace MailSender.Models
|
|
|
|
|
{
|
|
|
|
|
[Table("Mail")]
|
|
|
|
|
public class MailModel
|
|
|
|
|
{
|
|
|
|
|
[Key]
|
|
|
|
|
public int Id { get; set; }
|
2018-12-09 02:20:46 +01:00
|
|
|
|
|
2018-12-08 19:27:21 +01:00
|
|
|
|
//[ForeignKey]
|
|
|
|
|
//public int UserId //id usera ktory wyslal maila
|
2018-12-16 13:35:41 +01:00
|
|
|
|
|
2018-12-13 23:05:57 +01:00
|
|
|
|
[Display(Name = "Temat")]
|
2018-12-09 02:20:46 +01:00
|
|
|
|
[Required(AllowEmptyStrings = false)]
|
2018-12-08 19:27:21 +01:00
|
|
|
|
public string Subject { get; set; }
|
2018-12-16 13:35:41 +01:00
|
|
|
|
|
2018-12-09 02:20:46 +01:00
|
|
|
|
[DataType(DataType.EmailAddress)]
|
2018-12-16 13:35:41 +01:00
|
|
|
|
[Required(AllowEmptyStrings = false, ErrorMessage = "Musisz wprowadzić adres e-mail")]
|
|
|
|
|
[RegularExpression(".*@.*\\..*", ErrorMessage = "Zły format")]
|
2018-12-13 23:05:57 +01:00
|
|
|
|
[Display(Name = "Adres odbiorcy")]
|
2018-12-16 13:35:41 +01:00
|
|
|
|
[EmailAddress(ErrorMessage ="Zły format")]
|
2018-12-08 19:27:21 +01:00
|
|
|
|
public string EMailTo { get; set; }
|
2018-12-09 02:20:46 +01:00
|
|
|
|
|
2018-12-13 23:05:57 +01:00
|
|
|
|
[Display(Name ="Odpowiedź")]
|
2018-12-16 13:35:41 +01:00
|
|
|
|
[Required(AllowEmptyStrings = false, ErrorMessage = "Proszę wprowadzić odpowiedź")]
|
2018-12-13 23:05:57 +01:00
|
|
|
|
[DataType(DataType.MultilineText)]
|
2018-12-09 02:20:46 +01:00
|
|
|
|
[StringLength(500, ErrorMessage = "Message has to have between 1 and 500 chars", MinimumLength = 1)]
|
2018-12-13 23:05:57 +01:00
|
|
|
|
public string Content { get; set; }
|
2018-12-18 15:42:39 +01:00
|
|
|
|
|
2018-12-08 19:27:21 +01:00
|
|
|
|
}
|
|
|
|
|
}
|