-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bdc55e
commit 958fb4c
Showing
12 changed files
with
279 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using FSDTS.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Linq; | ||
using System.Web; | ||
|
||
namespace FSDTS.Common | ||
{ | ||
public class CustomValidators | ||
{ | ||
public class ValidateDateAttribute : ValidationAttribute | ||
{ | ||
protected override ValidationResult IsValid(object value, ValidationContext validationContext) | ||
{ | ||
Period period = new Period(); | ||
period = (Period)validationContext.ObjectInstance; | ||
|
||
if (!(period.PeriodEndDate >= (DateTime)value)) // || !(period.PeriodDeadlineDate >= (DateTime)value) | ||
{ | ||
return new ValidationResult(ErrorMessage); | ||
} | ||
else | ||
{ | ||
return ValidationResult.Success; | ||
} | ||
} | ||
} | ||
|
||
public class ValidateYearAttribute : ValidateDateAttribute | ||
{ | ||
protected override ValidationResult IsValid(object value, ValidationContext validationContext) | ||
{ | ||
Project project = new Project(); | ||
project = (Project)validationContext.ObjectInstance; | ||
|
||
if (!(Convert.ToInt32(project.ProjectEndYear)> Convert.ToInt32(value))) | ||
{ | ||
return new ValidationResult(ErrorMessage); | ||
} | ||
else | ||
{ | ||
return ValidationResult.Success; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ namespace FSDTS.Common | |
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Mail; | ||
using System.Web; | ||
|
||
/// <summary> | ||
|
@@ -61,6 +62,20 @@ public class FsdtsConstants | |
/// </summary> | ||
public const string ItemNotFound = "Item you are searching not found."; | ||
|
||
#region Fields used for Notification (Email) functionality | ||
|
||
public const string SenderEmailId = "[email protected]"; | ||
|
||
public const string SenderPassword = "Mobile1234"; | ||
|
||
public const string SMTPHost = "smtp.gmail.com"; | ||
|
||
public const int SMTPPort = 587; | ||
|
||
public const System.Net.Mail.SmtpDeliveryMethod SMTPDeliveryMethod = "SmtpDeliveryMethod.Network"; | ||
|
||
#endregion | ||
|
||
#region Generic fields used across all the controllers | ||
/// <summary> | ||
/// For Get() method (Ex. GetCourse(), GetProgram() etc.) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace FSDTS.Migrations | ||
{ | ||
using System; | ||
using System.Data.Entity.Migrations; | ||
|
||
public partial class initiald : DbMigration | ||
{ | ||
public override void Up() | ||
{ | ||
AddColumn("dbo.Users", "UserPassword", c => c.String()); | ||
} | ||
|
||
public override void Down() | ||
{ | ||
DropColumn("dbo.Users", "UserPassword"); | ||
} | ||
} | ||
} |
Oops, something went wrong.