Пример #1
0
        public JsonResult SendMessage(string fname, string email, string subject, string message)
        {
            //TODO: Issue Respone all error 403
            Response.Status     = "200 OK";
            Response.StatusCode = 200;
            //TODO: Issue Respone all error 403
            bool check = EmailValidateHelper.IsValidEmail(email);
            //send email
            var clientsJson = Json(check, JsonRequestBehavior.AllowGet);

            return(clientsJson);
        }
Пример #2
0
        public BusinessRuleResult Execute(IEntity instance)
        {
            var failed           = false;
            var franchisee       = instance as Framework.DomainModel.Entities.FranchiseeTenant;
            var validationResult = new List <ValidationResult>();

            // var franchiseeConfig = instance as Framework.DomainModel.Entities.FranchiseeConfiguration;


            if (franchisee != null)
            {
                if (string.IsNullOrEmpty(franchisee.Name))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Name");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (!string.IsNullOrEmpty(franchisee.Name) &&
                         _franchiseeTenantRepository.CheckExist(o => o.Name == franchisee.Name && o.Id != franchisee.Id))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("ExistsTextResourceKey"), "Name");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(franchisee.Address1))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Address 1");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(franchisee.City))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "City");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(franchisee.State))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "State");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                int i = 0;
                if (string.IsNullOrEmpty(franchisee.Zip))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Zip");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (int.TryParse(franchisee.Zip, out i) == false)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("FieldInvalidText"), "Zip");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(franchisee.OfficePhone))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Office Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (franchisee.OfficePhone.Length < 10)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Office Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(franchisee.FaxNumber))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Fax Number");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (franchisee.FaxNumber.Length < 10)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Fax Number");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(franchisee.Server))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Server");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(franchisee.Database))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Database");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                if (string.IsNullOrEmpty(franchisee.UserName))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Username");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(franchisee.Password))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Password");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (!string.IsNullOrEmpty(franchisee.LicenseKey) &&
                    _franchiseeTenantRepository.CheckExist(
                        o => o.LicenseKey == franchisee.LicenseKey && o.Id != franchisee.Id))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("ExistsTextResourceKey"), "License Key");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                //Primary Contact
                if (string.IsNullOrEmpty(franchisee.FranchiseeContact))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Frachisee Contact");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(franchisee.PrimaryContactPhone))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (franchisee.PrimaryContactPhone.Length < 10 || franchisee.PrimaryContactPhone.Contains("_"))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (!string.IsNullOrEmpty(franchisee.PrimaryContactEmail))
                {
                    if (Regex.IsMatch(franchisee.PrimaryContactEmail, "[A-Z]"))
                    {
                        var mess = string.Format(SystemMessageLookup.GetMessage("EmailValid"), "Email");
                        validationResult.Add(new ValidationResult(mess));
                        failed = true;
                    }
                    if (!EmailValidateHelper.IsValidEmail(franchisee.PrimaryContactEmail))
                    {
                        var mess = string.Format(SystemMessageLookup.GetMessage("EmailValid"), "Email");
                        validationResult.Add(new ValidationResult(mess));
                        failed = true;
                    }
                }

                if (!string.IsNullOrEmpty(franchisee.PrimaryContactFax))
                {
                    if (franchisee.PrimaryContactFax.Length < 10 || franchisee.PrimaryContactFax.Contains("_"))
                    {
                        var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Fax");
                        validationResult.Add(new ValidationResult(mess));
                        failed = true;
                    }
                }

                if (!string.IsNullOrEmpty(franchisee.PrimaryContactCellNumber))
                {
                    if (franchisee.PrimaryContactCellNumber.Length < 10 ||
                        franchisee.PrimaryContactCellNumber.Contains("_"))
                    {
                        var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Cell Number");
                        validationResult.Add(new ValidationResult(mess));
                        failed = true;
                    }
                }
                //license key
                if (franchisee.StartActiveDate == null)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Start Active Date");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (((DateTime)(franchisee.StartActiveDate)).Year == 1)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Start Active Date");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }


                if (franchisee.EndActiveDate == null)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "End Active Date");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (((DateTime)(franchisee.EndActiveDate)).Year == 1)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "End Active Date");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                if (franchisee.EndActiveDate != null && franchisee.StartActiveDate != null)
                {
                    if (((DateTime)(franchisee.EndActiveDate)) < ((DateTime)(franchisee.StartActiveDate)))
                    {
                        var mess = string.Format(SystemMessageLookup.GetMessage("MustGreaterThan"), "End Active Date",
                                                 "StartActiveDate");
                        validationResult.Add(new ValidationResult(mess));
                        failed = true;
                    }
                }
                // Check connection string
                if (!string.IsNullOrEmpty(franchisee.Server) && !string.IsNullOrEmpty(franchisee.Database) &&
                    !string.IsNullOrEmpty(franchisee.UserName) && !string.IsNullOrEmpty(franchisee.Password))
                {
                    var connectionString = PersistenceHelper.GenerateConnectionString(franchisee.Server,
                                                                                      franchisee.Database, franchisee.UserName, franchisee.Password);
                    if (!_franchiseeTenantRepository.CheckConnectionString(connectionString))
                    {
                        var mess = string.Format(SystemMessageLookup.GetMessage("ConnectionStringInvalid"));
                        validationResult.Add(new ValidationResult(mess));
                        failed = true;
                    }
                }


                var result = new BusinessRuleResult(failed, "", instance.GetType().Name, instance.Id, PropertyNames, Name)
                {
                    ValidationResults = validationResult
                };
                return(result);
            }


            return(new BusinessRuleResult());
        }
Пример #3
0
        public BusinessRuleResult Execute(IEntity instance)
        {
            var failed = false;
            var FranchiseeConfiguration = instance as Framework.DomainModel.Entities.FranchiseeConfiguration;
            var validationResult        = new List <ValidationResult>();

            if (FranchiseeConfiguration != null)
            {
                if (!string.IsNullOrEmpty(FranchiseeConfiguration.Name) && _FranchiseeConfigurationRepository.CheckExist(o => o.Name == FranchiseeConfiguration.Name && o.Id != FranchiseeConfiguration.Id))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("ExistsTextResourceKey"), "Name");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                //if (string.IsNullOrEmpty(FranchiseeConfiguration.OfficePhone))
                //{
                //    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Office Phone");
                //    validationResult.Add(new ValidationResult(mess));
                //    failed = true;
                //}
                //else if (FranchiseeConfiguration.OfficePhone.Length < 10)
                //{
                //    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Office Phone");
                //    validationResult.Add(new ValidationResult(mess));
                //    failed = true;
                //}
                //if (string.IsNullOrEmpty(FranchiseeConfiguration.FaxNumber))
                //{
                //    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Fax Number");
                //    validationResult.Add(new ValidationResult(mess));
                //    failed = true;
                //}
                //else if (FranchiseeConfiguration.FaxNumber.Length < 10)
                //{
                //    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Fax Number");
                //    validationResult.Add(new ValidationResult(mess));
                //    failed = true;
                //}
                if (string.IsNullOrEmpty(FranchiseeConfiguration.Address1))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Address1");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                if (string.IsNullOrEmpty(FranchiseeConfiguration.City))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "City");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                if (string.IsNullOrEmpty(FranchiseeConfiguration.State))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "State");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(FranchiseeConfiguration.Zip))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Zip");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                //FranchiseeConfiguration.Zip!="N/A" vi khi tao moi 1 franchisee khong co Address1, City, Zip, State
                //nen khi xuat hien man hinh Welcome Tour update franchisee khong duoc nen set tat cai la "N/A" o HomeController
                else if (FranchiseeConfiguration.Zip != "N/A")
                {
                    if (!Regex.IsMatch(FranchiseeConfiguration.Zip, @"^[0-9\\\-/]*$"))
                    {
                        var mess = string.Format(SystemMessageLookup.GetMessage("FieldInvalidText"), "Zip");
                        validationResult.Add(new ValidationResult(mess));
                        failed = true;
                    }
                }

                //if (string.IsNullOrEmpty(FranchiseeConfiguration.FranchiseeContact))
                //{
                //    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Contact Name");
                //    validationResult.Add(new ValidationResult(mess));
                //    failed = true;
                //}
                if (string.IsNullOrEmpty(FranchiseeConfiguration.PrimaryContactPhone))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (FranchiseeConfiguration.PrimaryContactPhone.Length < 10)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                //email
                if (string.IsNullOrEmpty(FranchiseeConfiguration.PrimaryContactEmail))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (Regex.IsMatch(FranchiseeConfiguration.PrimaryContactEmail, "[A-Z]"))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("EmailValid"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (!EmailValidateHelper.IsValidEmail(FranchiseeConfiguration.PrimaryContactEmail))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("EmailValid"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                if (!string.IsNullOrEmpty(FranchiseeConfiguration.PrimaryContactFax) && FranchiseeConfiguration.PrimaryContactFax.Length < 10)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Fax");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(FranchiseeConfiguration.PrimaryContactCellNumber))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Cell");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (FranchiseeConfiguration.PrimaryContactCellNumber.Length < 10)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Cell");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }


                if (string.IsNullOrEmpty(FranchiseeConfiguration.Logo.ToString()))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Logo");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                var result = new BusinessRuleResult(failed, "", instance.GetType().Name, instance.Id, PropertyNames, Name)
                {
                    ValidationResults = validationResult
                };
                return(result);
            }

            return(new BusinessRuleResult());
        }
Пример #4
0
        public BusinessRuleResult Execute(IEntity instance)
        {
            var failed           = false;
            var courier          = instance as Framework.DomainModel.Entities.Courier;
            var validationResult = new List <ValidationResult>();

            if (courier != null)
            {
                var user = courier.User;

                //validate licence
                //if (courier.Id == 0 && MenuExtractData.Instance.NumberOfCourier != null && MenuExtractData.Instance.NumberOfCourier != 0 && _courierRepository.ListAll().Count >= MenuExtractData.Instance.NumberOfCourier)
                //{
                //    var mess = string.Format(SystemMessageLookup.GetMessage("MaximumOfCourierExceeded"));
                //    validationResult.Add(new ValidationResult(mess));
                //    failed = true;
                //}
                //else
                //{
                //username
                if (string.IsNullOrEmpty(user.UserName))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Username");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (!string.IsNullOrEmpty(user.UserName) &&
                         _userRepository.CheckExist(o => o.UserName == user.UserName && o.Id != user.Id))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("ExistsTextResourceKey"), "Username");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                //email
                if (string.IsNullOrEmpty(user.Email))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (Regex.IsMatch(user.Email, "[A-Z]"))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("EmailValid"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (!EmailValidateHelper.IsValidEmail(user.Email))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("EmailValid"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (!string.IsNullOrEmpty(user.Email) &&
                         _userRepository.CheckExist(
                             o => o.Email.Trim().ToLower() == user.Email.Trim().ToLower() && o.Id != user.Id))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("ExistsTextResourceKey"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                //firstName
                if (string.IsNullOrEmpty(courier.User.FirstName))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "First Name");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(user.LastName))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Last Name");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(user.HomePhone))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Home Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (user.HomePhone.Length < 10)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Home Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }


                if (string.IsNullOrEmpty(user.MobilePhone))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Mobile Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (user.MobilePhone.Length < 10)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Mobile Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(courier.CarNo))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Car Number");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                //}


                var result = new BusinessRuleResult(failed, "", instance.GetType().Name, instance.Id, PropertyNames, Name)
                {
                    ValidationResults = validationResult
                };
                return(result);
            }

            return(new BusinessRuleResult());
        }
Пример #5
0
        public BusinessRuleResult Execute(IEntity instance)
        {
            var failed           = false;
            var user             = instance as Framework.DomainModel.Entities.User;
            var validationResult = new List <ValidationResult>();

            if (user != null)
            {
                if (!string.IsNullOrEmpty(user.UserRoleId.ToString()) && user.UserRoleId == 0)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Role");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (!string.IsNullOrEmpty(user.UserName) && _userRepository.CheckExist(o => o.UserName == user.UserName && o.Id != user.Id))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("ExistsTextResourceKey"), "Username");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                //firstName
                if (string.IsNullOrEmpty(user.FirstName))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "First Name");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(user.LastName))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Last Name");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                //email
                if (string.IsNullOrEmpty(user.Email))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (Regex.IsMatch(user.Email, "[A-Z]"))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("EmailValid"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (!EmailValidateHelper.IsValidEmail(user.Email))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("EmailValid"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (!string.IsNullOrEmpty(user.Email) &&
                         _userRepository.CheckExist(
                             o => o.Email.Trim().ToLower() == user.Email.Trim().ToLower() && o.Id != user.Id))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("ExistsTextResourceKey"), "Email");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }


                if (string.IsNullOrEmpty(user.HomePhone))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Home Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (user.HomePhone.Length < 10)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Home Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }

                if (string.IsNullOrEmpty(user.MobilePhone))
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("RequiredTextResourceKey"), "Mobile Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }
                else if (user.MobilePhone.Length < 10)
                {
                    var mess = string.Format(SystemMessageLookup.GetMessage("PhoneValid"), "Mobile Phone");
                    validationResult.Add(new ValidationResult(mess));
                    failed = true;
                }


                var result = new BusinessRuleResult(failed, "", instance.GetType().Name, instance.Id, PropertyNames, Name)
                {
                    ValidationResults = validationResult
                };
                return(result);
            }

            return(new BusinessRuleResult());
        }