当前位置: 首页>>代码示例>>C#>>正文


C# IValidator.ValidEntry方法代码示例

本文整理汇总了C#中IValidator.ValidEntry方法的典型用法代码示例。如果您正苦于以下问题:C# IValidator.ValidEntry方法的具体用法?C# IValidator.ValidEntry怎么用?C# IValidator.ValidEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IValidator的用法示例。


在下文中一共展示了IValidator.ValidEntry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Save

        public void Save(ServiceMarriage pmarriage, List<Guid> sources, List<MarriageWitness> witnesses, IValidator marriageValidation)
        {
            if (!marriageValidation.ValidEntry()) return;

            if (!_security.IsValidEdit()) return;

            if (pmarriage.MarriageId == Guid.Empty)
            {
                Insert(pmarriage,sources, witnesses);
            }
            else
            {
                Edit(pmarriage,sources, witnesses);
            }
        }
开发者ID:gnthackray1978,项目名称:and-sources,代码行数:15,代码来源:MarriageSearch.cs

示例2: Save

        public void Save(ServicePerson servicePerson,List<Guid> sourceIds,  IValidator validator = null)
        {
            if (validator != null && !validator.ValidEntry()) throw new InvalidDataException(validator.GetErrors());

            if (servicePerson.PersonId == Guid.Empty)
            {
                InsertNewRecord(servicePerson, sourceIds);
            }
            else
            {
                EditSelectedRecord(servicePerson, sourceIds);
            }
        }
开发者ID:gnthackray1978,项目名称:and-sources,代码行数:13,代码来源:PersonSearch.cs

示例3: Search

        public ServiceMarriageObject Search(MarriageFilterTypes filterMode, MarriageSearchFilter marriageSearchFilter, DataShaping shaping, IValidator validator = null)
        {
            var serviceMarriageObject = new ServiceMarriageObject();

            if (!_security.IsvalidSelect())  serviceMarriageObject.ErrorStatus = "Invalid permission to select";

            if (validator != null && !validator.ValidEntry())  serviceMarriageObject.ErrorStatus += " Validation failed: " + validator.GetErrors();

            if (serviceMarriageObject.ErrorStatus.Length == 0)
            {

                if (shaping.Column.Contains("MarriageDate DESC"))
                {
                    shaping.Column = "MarriageYear DESC";
                }
                else if (shaping.Column.Contains("MarriageDate"))
                {
                    shaping.Column = "MarriageYear";
                }

                switch (filterMode)
                {
                    case MarriageFilterTypes.Duplicates:
                        serviceMarriageObject = marriageSearchFilter.ParentId != Guid.Empty
                                                    ? _marriagesDll.GetDataByUniqueRef(marriageSearchFilter.ParentId)
                                                                   .ToServiceMarriageObject(shaping.Column, shaping.RecordPageSize,
                                                                                            shaping.RecordStart)
                                                    : new ServiceMarriageObject();
                        break;
                    case MarriageFilterTypes.Standard:
                        serviceMarriageObject =
                            _marriagesDll.GetFilteredMarriages(marriageSearchFilter)
                                         .ToServiceMarriageObject(shaping.Column, shaping.RecordPageSize, shaping.RecordStart);
                        break;

                    case MarriageFilterTypes.IdList:
                        serviceMarriageObject = _marriagesDll.GetByListId(marriageSearchFilter.Ids).ToServiceMarriageObject(shaping.Column, shaping.RecordPageSize, shaping.RecordStart);
                        break;

                }

            }
            return serviceMarriageObject;
        }
开发者ID:gnthackray1978,项目名称:and-sources,代码行数:44,代码来源:MarriageSearch.cs

示例4: Search

        public ServicePersonObject Search(PersonSearchTypes filterMode, PersonSearchFilter personSearchFilter, DataShaping shaper, IValidator validator = null)
        {
            if (validator != null && !validator.ValidEntry()) throw new InvalidDataException(validator.GetErrors());

            if (!_security.IsvalidSelect()) throw new SecurityException("Missing select permission");

            IList<ServicePerson> tpServicePerson = new List<ServicePerson>();

            switch (filterMode)
            {

                case PersonSearchTypes.Duplicates:
                    if (personSearchFilter.ParentId != Guid.Empty)
                    {
                        tpServicePerson = _personDal.GetByDupeRef(personSearchFilter.ParentId);
                    }

                    break;

                case PersonSearchTypes.Simple:
                    tpServicePerson = _personDal.GetByFilter(personSearchFilter).OrderBy(o => o.BirthYear).ToList();
                    break;

                case PersonSearchTypes.IdList:
                    tpServicePerson = _personDal.GetByIdList(personSearchFilter).OrderBy(o => o.BirthYear).ToList();
                    break;
            }

               return tpServicePerson.ToServicePersonObject(shaper.Column, shaper.RecordPageSize,shaper.RecordStart);
        }
开发者ID:gnthackray1978,项目名称:and-sources,代码行数:30,代码来源:PersonSearch.cs


注:本文中的IValidator.ValidEntry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。