本文整理汇总了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;
}
示例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;
}
示例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;
}