Created
March 11, 2015 09:43
-
-
Save Imater/7c4a2776463103d53cbf to your computer and use it in GitHub Desktop.
temp
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
using System.Collections.Generic; | |
using Castle.Core.Internal; | |
using EEC.Portal.OP22.DomainModel.Definitions; | |
using EEC.Portal.OP22.Web.Boilerplate.Forms; | |
namespace EEC.Portal.OP22.Web.ApplicantOffice.Application.Requests.Validation | |
{ | |
public class ValidateRightHolder | |
{ | |
public List<string> ValidateFormData(RightHolderForm form) | |
{ | |
var errors = new List<string>(); | |
if (form.ApplicantType == ApplicantType.Individual) | |
{ | |
if (form.FullNameDetails.FirstName.IsNullOrEmpty()) | |
{ | |
errors.Add("Имя"); | |
} | |
if (form.FullNameDetails.LastName.IsNullOrEmpty()) | |
{ | |
errors.Add("Фамилия"); | |
} | |
if (form.IdentityDocDetails.DocKindName.IsNullOrEmpty()) | |
{ | |
errors.Add("Документ удостоверяющий личность"); | |
} | |
if (form.IdentityDocDetails.IdentityDocNumberId.IsNullOrEmpty()) | |
{ | |
errors.Add("Номер документа"); | |
} | |
if (form.IdentityDocDetails.DocCreationDate == null) | |
{ | |
errors.Add("Дата документа"); | |
} | |
if (form.IdentityDocDetails.AuthorityName.IsNullOrEmpty()) | |
{ | |
errors.Add("Наименование выдавшего органа"); | |
} | |
} | |
else | |
{ | |
if (form.IPOrganizationDetails.CountryCode.IsNullOrEmpty()) | |
{ | |
errors.Add("Страна регистрации"); | |
} | |
if (form.IPOrganizationDetails.OrganizationName.IsNullOrEmpty()) | |
{ | |
errors.Add("Наименование организации"); | |
} | |
if (form.IPOrganizationDetails.BusinessEntityTypeName.IsNullOrEmpty()) | |
{ | |
errors.Add("Организационно правовая форма"); | |
} | |
} | |
return errors; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment