本文整理汇总了C#中ObjectList.FindById方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectList.FindById方法的具体用法?C# ObjectList.FindById怎么用?C# ObjectList.FindById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectList
的用法示例。
在下文中一共展示了ObjectList.FindById方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: isUpdateBindingReports
private bool isUpdateBindingReports()
{
ObjectList<RepReport> list = new ObjectList<RepReport>();
list = this.tsbRepresentMyReport.get_Checked() ? RepReport.FindByPeriodUser(this.dbRepresentPeriodDate.DateBegin, this.dbRepresentPeriodDate.DateEnd) : RepReport.FindByPeriod(this.dbRepresentPeriodDate.DateBegin, this.dbRepresentPeriodDate.DateEnd);
foreach (RepReport report in (ObjectList<RepReport>) this.bsReports.get_DataSource())
{
RepReport report2 = list.FindById(report.Id);
if ((report2 == null) || (report2.Status != report.Status))
{
return true;
}
}
return false;
}
示例2: btnResidentsDelete_Click
private void btnResidentsDelete_Click(object sender, System.EventArgs e)
{
ApartmentResident currentApartmentResident = this.GetCurrentApartmentResident();
if (currentApartmentResident == ApartmentResident.Null)
{
Messages.ShowMessage("Выберите проживающего для удаления");
}
else
{
ObjectList<ApartmentResidentBenefit> apartmentResidentBenefitsByResident = currentApartmentResident.GetApartmentResidentBenefitsByResident();
if (apartmentResidentBenefitsByResident.get_Count() > 0)
{
string str = string.Empty;
ObjectList<AIS.SN.Model.DomainObjects.Person> list2 = new ObjectList<AIS.SN.Model.DomainObjects.Person>();
foreach (ApartmentResidentBenefit benefit in apartmentResidentBenefitsByResident)
{
if (list2.FindById(benefit.PersonId) == null)
{
list2.Add(benefit.GetPerson());
string str2 = (benefit.ToDate == Constants.NullDate) ? ((string) " ,...)") : ("," + benefit.ToDate.ToShortDateString() + ")");
string str3 = str;
str = string.Concat((string[]) new string[] { str3, benefit.PersonName, " (", benefit.FromDate.ToShortDateString(), str2, System.Environment.get_NewLine() });
}
}
Messages.ShowMessage("Удаление проживающего невозможно, пока не будут удалены связи со льготами: " + System.Environment.get_NewLine() + str);
}
else if (Messages.QuestionYesNo(base.FindForm(), "Вы уверены, что хотите удалить?") != System.Windows.Forms.DialogResult.No)
{
currentApartmentResident.Delete();
this.UpdateBindingSourceApartmentResidents();
}
}
}
示例3: btnSave_Click
private void btnSave_Click(object sender, System.EventArgs e)
{
if ((this.selectTypeResident.SelectedFasetItem == FasetItem.Null) || this.dbxBegin.IsNull)
{
new BalloonWindow("Не все поля заполнены").Show(this.btnSave);
}
else
{
ApartmentResident resident = ApartmentResident.FindById(this.apr.Id);
resident.FromDate = this.dbxBegin.Value;
resident.ToDate = this.dbxEnd.IsNull ? System.DateTime.MinValue : this.dbxEnd.Value;
ObjectList<ApartmentResidentBenefit> apartmentResidentBenefitsByResidentToDate = resident.GetApartmentResidentBenefitsByResidentToDate();
if (apartmentResidentBenefitsByResidentToDate.get_Count() > 0)
{
string str = string.Empty;
ObjectList<Person> list2 = new ObjectList<Person>();
foreach (ApartmentResidentBenefit benefit in apartmentResidentBenefitsByResidentToDate)
{
if (list2.FindById(benefit.PersonId) == null)
{
list2.Add(benefit.GetPerson());
string str2 = (benefit.ToDate == Constants.NullDate) ? ((string) " ,...)") : ("," + benefit.ToDate.ToShortDateString() + ")");
string str3 = str;
str = string.Concat((string[]) new string[] { str3, benefit.PersonName, " (", benefit.FromDate.ToShortDateString(), str2, System.Environment.get_NewLine() });
}
}
Messages.ShowMessage("Изменение даты выписки невозможно, пока не будут удалены связи со льготами: " + System.Environment.get_NewLine() + str);
}
else if (resident.GetCountVacationsByToDate() > 0)
{
Messages.ShowMessage("Изменение даты выписки невозможно, т.к. существует временное отсутствие за периодом прописки.");
}
else
{
this.apr.TypeResidents = this.selectTypeResident.SelectedFasetItem.Id;
this.apr.Relative = this.seletcRelative.SelectedFasetItem.Id;
this.apr.FromDate = this.dbxBegin.Value;
this.apr.ToDate = this.dbxEnd.IsNull ? System.DateTime.MinValue : this.dbxEnd.Value;
this.apr.Comment = this.tbComment.get_Text();
this.apr.SaveChanges();
base.Close();
}
}
}
示例4: GetLeavesByRoot
public void GetLeavesByRoot(ObjectList<LocalAddress> addresses, AddressesNode node)
{
node.NullDelete();
if ((node.Nodes.get_Count() == 0) || (node.ForeColor == Color))
{
if (addresses.FindById(((LocalAddress) node.get_Tag()).Id) == null)
{
addresses.Add((LocalAddress) node.get_Tag());
}
node.NullAdd();
}
else
{
foreach (AddressesNode node2 in node.Nodes)
{
this.GetLeavesByRoot(addresses, node2);
}
}
}