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


C# BaseRepository.SaveChages方法代码示例

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


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

示例1: Validate

        public override ValidationResult Validate(object value,
        System.Globalization.CultureInfo cultureInfo)
        {
            BindingGroup bg = value as BindingGroup;
            if (bg == null) { return ValidationResult.ValidResult; }
            if (bg.Items.Count > 0)
            {
                Peoples tempValue = (value as BindingGroup).Items[0] as Peoples;
                try
                {
                    BaseRepository<Peoples> peoples = new BaseRepository<Peoples>();
                    var temp = (from peopl in peoples.items where tempValue.inn == peopl.inn select peopl).Count<Peoples>();
                    if (temp == 1)
                    {
                        peoples.SaveChages();
                        return ValidationResult.ValidResult;
                        
                    }

                    return new ValidationResult(false, "Найдено совпадение ИНН");
                }
                catch (Exception ex)
                {
                    return new ValidationResult(false, ex.Message);
                }
            }
            return ValidationResult.ValidResult;
        }
开发者ID:versussun,项目名称:git-ato-base_client,代码行数:28,代码来源:PeoplesRowValidationRules.cs

示例2: Validate

        public override ValidationResult Validate(object value,
        System.Globalization.CultureInfo cultureInfo)
        {
            BindingGroup bg = value as BindingGroup;
            if (bg == null) { return ValidationResult.ValidResult; }
            if (bg.Items.Count > 0)
            {
                period_in_ATO tempValue = (value as BindingGroup).Items[0] as period_in_ATO;
                try
                {
                    BaseRepository<period_in_ATO> periods = new BaseRepository<period_in_ATO>();

                    var temp = (from period in periods.items
                                where Comparator(period, tempValue)
                                select period).Count<period_in_ATO>();
                    if (temp == 1)
                    {
                        periods.SaveChages();
                        return ValidationResult.ValidResult;

                    }

                    return new ValidationResult(false, "Найдено совпадение периодов!!! Проверьте даты...");
                }
                catch (Exception ex)
                {
                    return new ValidationResult(false, ex.Message);
                }
            }
            return ValidationResult.ValidResult;
        }
开发者ID:versussun,项目名称:git-ato-base_client,代码行数:31,代码来源:PeriodRowValidationRules.cs

示例3: Validate

        public override ValidationResult Validate(object value,
        System.Globalization.CultureInfo cultureInfo)
        {
            BindingGroup bg = value as BindingGroup;
            if (bg == null) { return ValidationResult.ValidResult; }
            if (bg.Items.Count > 0)
            {
                UBD_sertificate tempValue = (value as BindingGroup).Items[0] as UBD_sertificate;
                try
                {
                    BaseRepository<UBD_sertificate> sertificats = new BaseRepository<UBD_sertificate>();

                    var temp = (from sertif in sertificats.items
                                where sertif.id_people==tempValue.id_people && sertif.certificate_number==tempValue.certificate_number
                                select sertif).Count<UBD_sertificate>();
                    if (temp == 1)
                    {
                        sertificats.SaveChages();
                        return ValidationResult.ValidResult;

                    }

                    return new ValidationResult(false, "Запись о даном удостоверении уже существует!!!");
                }
                catch (Exception ex)
                {
                    return new ValidationResult(false, ex.Message);
                }
            }
            return ValidationResult.ValidResult;
        }
开发者ID:versussun,项目名称:git-ato-base_client,代码行数:31,代码来源:UBDValidationRules.cs


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