public BDSNewController(IBDSNewService service, IBDSAccountService serviceAccount, IBDSEducationService serviceEducation, IBDSTimeWorkService serviceTimeWork, IBDSCareerService serviceCareer, IBDSNewsTypeService serviceNewsType, IBDSNewsTypePriceService serviceNewsTypePrice, IBDSLanguageService serviceLanguage, IBDSEmployerInformationService serviceEmployerInformation, IBDSPictureService servicePicture, IBDSTransactionHistoryService serviceTransactionHistory, IBDSNewsDateService serviceNewsDate ) { _service = service; _serviceAccount = serviceAccount; _serviceEducation = serviceEducation; _serviceTimeWork = serviceTimeWork; _serviceCareer = serviceCareer; _serviceNewsType = serviceNewsType; _serviceNewsTypePrice = serviceNewsTypePrice; _serviceLanguage = serviceLanguage; _serviceEmployerInformation = serviceEmployerInformation; _servicePicture = servicePicture; _serviceTransactionHistory = serviceTransactionHistory; _serviceNewsDate = serviceNewsDate; }
public BDSEmployerInformationValidator(IBDSAccountService service) { _service = service; //RuleFor(m => m.BDSAccount.Email).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); //RuleFor(m => m.BDSAccount.Email).Matches(new Regex(@"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$")).WithMessage(Resource.TheEmailAddressEnteredIsInvalid); //RuleFor(m => m.BDSAccount.Email).Must((BDSEmployerInformation model, string email) => //{ // BDSAccount modelDB = _service.GetItem(model.ID); // if (modelDB == null && _service.CheckItem(model.BDSAccount)) // { // return false; // } // else // { // if (model.BDSAccount.Email != email && _service.CheckItem(model.BDSAccount)) // { // return false; // } // } // return true; //}).WithMessage("'" + Resource.Email + "' " + Resource.AlreadyExist); //RuleFor(m => m.BDSAccount.PassWord).Must((BDSEmployerInformation model, string pass) => //{ // if (model.BDSAccount.ID == 0 && pass.Trim().Length == 0) // { // return false; // } // return true; //}).WithMessage(Resource.TheFieldShouldNotBeEmpty); //RuleFor(m => m.BDSAccount.Money).GreaterThan(0).WithMessage(Resource.TheFieldNotEqualTo0); //RuleFor(m => m.BDSAccount.Money).GreaterThanOrEqualTo(0).WithMessage(Resource.TheFieldNotEqualTo0); //RuleFor(m => m.BDSAccount.Point).GreaterThanOrEqualTo(0).WithMessage(Resource.TheFieldNotEqualTo0); RuleFor(m => m.Name).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.Scope).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.UrlImage).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.Address).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.City).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.District).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(u => u.Fax).Matches(new Regex("^[0-9]*$")).WithMessage(Resource.OnlyNumberAllowed); RuleFor(m => m.Phone).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(u => u.Phone).Matches(new Regex("^[0-9]*$")).WithMessage(Resource.OnlyNumberAllowed); RuleFor(m => m.NameContact).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.EmailContact).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.EmailContact).Matches(new Regex(@"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$")).WithMessage(Resource.TheEmailAddressEnteredIsInvalid); RuleFor(m => m.PhoneContact).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(u => u.PhoneContact).Matches(new Regex("^[0-9]*$")).WithMessage(Resource.OnlyNumberAllowed); RuleFor(m => m.AddressContact).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.CityContact).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.DistrictContact).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.TypeContact).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); }
public BDSTransactionController(IBDSTransactionService service, IBDSAccountService serviceAccount, IBDSBankService serviceBank, IBDSEmployerInformationService serviceEmployerInformation, IBDSBranchService serviceBranch, IBDSEventService serviceEvent, IBDSTransactionHistoryService serviceTranHis ) { _service = service; _serviceAccount = serviceAccount; _serviceBank = serviceBank; _serviceEmployerInformation = serviceEmployerInformation; _serviceBranch = serviceBranch; _serviceEvent = serviceEvent; _serviceTranHis = serviceTranHis; }
public BDSPersonalInformationController(IBDSPersonalInformationService service, IBDSAccountService serviceAccount, IBDSEducationService serviceEducation, IBDSMarriageService serviceMarriage, IBDSSalaryService serviceSalary, IBDSTimeWorkService serviceTimeWork, IBDSCareerService serviceCareer ) { _service = service; _serviceAccount = serviceAccount; _serviceEducation = serviceEducation; _serviceMarriage = serviceMarriage; _serviceSalary = serviceSalary; _serviceTimeWork = serviceTimeWork; _serviceCareer = serviceCareer; }
public BDSPersonalInfomationValidator(IBDSAccountService service) { _service = service; RuleFor(m => m.Name).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.Birthday).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.Phone).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(u => u.Phone).Matches(new Regex("^[0-9]*$")).WithMessage(Resource.OnlyNumberAllowed); RuleFor(m => m.Sex).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.MaritalStatus).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.TemporaryAddress).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.PermanentAddress).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.Province).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.UrlImage).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); }
public BDSAccountValidator(IBDSAccountService service) { this._service = service; RuleFor(m => m.Email).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.Email).Matches(new Regex(@"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$")).WithMessage(Resource.TheEmailAddressEnteredIsInvalid); RuleFor(u => u.Email).Must((BDSAccount model, string email) => { BDSAccount modelDB = _service.GetItem(model.ID); if (modelDB == null && _service.CheckItem(model)) { return(false); } else { if (model.Email != email && _service.CheckItem(model)) { return(false); } } return(true); }).WithMessage("'" + Resource.Email + "' " + Resource.AlreadyExist); RuleFor(m => m.PassWord).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.PassWord).Must((BDSAccount model, string pass) => { if (model.ID == 0 && pass.Trim().Length == 0) { return(false); } return(true); }).WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.RePassWord).NotEmpty().WithMessage(Resource.TheFieldShouldNotBeEmpty); RuleFor(m => m.RePassWord).Must((BDSAccount model, string pass) => { if (model.ID == 0 && model.PassWord.Trim().Length > 0 && pass != model.PassWord) { return(false); } return(true); }).WithMessage(Resource.PasswordMismatch); RuleFor(m => m.Money).GreaterThan(0).WithMessage(Resource.TheFieldNotEqualTo0); RuleFor(m => m.Money).GreaterThanOrEqualTo(0).WithMessage(Resource.TheFieldNotEqualTo0); RuleFor(m => m.Point).GreaterThanOrEqualTo(0).WithMessage(Resource.TheFieldNotEqualTo0); }
public BDSAccountController(IBDSAccountService service) { _service = service; }