本文整理汇总了C#中ObjectList.get_Count方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectList.get_Count方法的具体用法?C# ObjectList.get_Count怎么用?C# ObjectList.get_Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectList
的用法示例。
在下文中一共展示了ObjectList.get_Count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTree
public void AddTree(AreaAddressesTree areaAddressesTreeSource)
{
System.Collections.Generic.List<System.Windows.Forms.TreeNode> selectedNodes = areaAddressesTreeSource.SelectedNodes;
areaAddressesTreeSource.Remove();
foreach (System.Windows.Forms.TreeNode node in selectedNodes)
{
AddressesNode node2 = (AddressesNode) node;
node2.NullDelete();
if (node2.Nodes.get_Count() == 0)
{
this.RemoveNode(node2);
this.AddNode(new AddressesNode((LocalAddress) node2.get_Tag()));
}
else
{
ObjectList<LocalAddress> addresses = new ObjectList<LocalAddress>();
this.GetLeaves(addresses, node2);
if (addresses.get_Count() != 0)
{
foreach (LocalAddress address in addresses)
{
AddressesNode nodeByAddress = this.GetNodeByAddress(address);
if (nodeByAddress != null)
{
this.RemoveNode(nodeByAddress);
}
this.AddNode(new AddressesNode(address));
}
}
}
}
base.Sort();
this.OnPaintRoots();
areaAddressesTreeSource.OnPaintRoots();
if (selectedNodes.get_Count() != 0)
{
System.Collections.Generic.List<System.Windows.Forms.TreeNode> list3 = new System.Collections.Generic.List<System.Windows.Forms.TreeNode>();
foreach (System.Windows.Forms.TreeNode node4 in selectedNodes)
{
AddressesNode node5 = this.GetNode(this, (AddressesNode) node4);
if (node5 != null)
{
list3.Add(node5);
if (node5.Parent != null)
{
node5.Parent.EnsureVisible();
node5.Parent.Expand();
}
}
}
base.SelectedNodes = list3;
if (this.OnChangeSelectAddresses != null)
{
this.OnChangeSelectAddresses();
}
}
}
示例2: Refresh
public void Refresh(ObjectList<Apartment> list)
{
base.BeginUpdate();
base.Nodes.Clear();
string str = (list.get_Count() > 0) ? FormatItemsCount(list.get_Count()) : ((string) "По запросу ничего не найдено");
System.Windows.Forms.TreeNode node = base.Nodes.Add(str);
System.Windows.Forms.TreeNodeCollection nodes = node.Nodes;
foreach (Apartment apartment in list)
{
nodes.Add(new AIS.SN.UI.Accountant.Apartments.ApartmentNode(apartment.ToString(), apartment));
}
base.ExpandAll();
node.EnsureVisible();
base.EndUpdate();
if (node.Nodes.get_Count() == 1)
{
base.set_SelectedNode(node.Nodes.get_Item(0));
}
}
示例3: SetFilter
public void SetFilter(ObjectList<Organization> FilterServiceProvider, ObjectList<ServiceTypeOld> FilterServiceTypes)
{
if ((FilterServiceProvider != null) && (FilterServiceProvider.get_Count() == 0))
{
this.m_FilterServiceProvider = null;
}
else
{
this.m_FilterServiceProvider = FilterServiceProvider;
}
if ((FilterServiceTypes != null) && (FilterServiceTypes.get_Count() == 0))
{
this.m_FilterServiceTypes = null;
}
else
{
this.m_FilterServiceTypes = FilterServiceTypes;
}
}
示例4: UjfHouseInspectionsAddChangeForm
public UjfHouseInspectionsAddChangeForm(long ordId, ObjectList<UjfApartmentHouseInspection> hil)
{
this.InitializeComponent();
this.set_Font(Manager.WindowFont);
this.orderId = ordId;
this.HouseInspList = hil;
this.inspectionStatusFasetData.Faset = FasetsEnum.UjfApartmentHouseInspectionStatus;
this.inspectionStatusFasetData.RefreshValuesWithNull();
this.inspectionStatusFasetData.SelectedFasetItem = FasetItem.Null;
if ((hil != null) && (hil.get_Count() > 0))
{
this.dtpInspectionDate.Value = hil.get_Item(0).InspectionDateTime;
if (hil.get_Item(0).StatusId != 0)
{
this.inspectionStatusFasetData.SelectedFasetItem = FasetItem.FindById(hil.get_Item(0).StatusId);
}
else
{
this.inspectionStatusFasetData.set_SelectedIndex(0);
}
this.tbInspector.set_Text(hil.get_Item(0).Inspector);
}
}
示例5: btnAddShedule_Click
private void btnAddShedule_Click(object sender, System.EventArgs e)
{
bool flag = false;
ObjectList<UjfApartmentHouseDefect> list = new ObjectList<UjfApartmentHouseDefect>();
foreach (System.Windows.Forms.DataGridViewRow row in this.dgvDefects.SelectedRows)
{
list.Add((UjfApartmentHouseDefect) row.get_DataBoundItem());
}
if ((list != null) && (list.get_Count() > 0))
{
foreach (UjfApartmentHouseDefect defect in list)
{
UjfApartmentHouseDefectShedule shedule = new UjfApartmentHouseDefectShedule {
ApartmentHouseDefectId = defect.Id,
InspectionId = this.m_inspectionId,
SheduleYear = (int) this.nudSheduleYear.Value
};
if (Mappers.UjfApartmentHouseDefectSheduleMapper.FindByApartmentHouseDefectIdAndSheduleYear(shedule.ApartmentHouseDefectId, shedule.SheduleYear, shedule.Id).get_Count() > 0)
{
flag = true;
}
else
{
shedule.SaveChanges();
}
}
}
else
{
System.Windows.Forms.MessageBox.Show("Для составления плана-графика добавьте хотя бы один дефект к текущему осмотру!");
}
if (flag)
{
System.Windows.Forms.MessageBox.Show("Некоторые планы-графики не были добавлены, так как уже присутствуют в списке!");
}
base.Close();
}
示例6: SetGroups
private void SetGroups(ObjectList<AreaGroup> groups)
{
this.bsGroups.set_DataSource(new ObjectList<AreaGroup>());
AreaGroup group = new AreaGroup {
Id = -1L,
Name = "<не выбрано>"
};
((ObjectList<AreaGroup>) this.bsGroups.get_DataSource()).Add(group);
((ObjectList<AreaGroup>) this.bsGroups.get_DataSource()).AddRange(groups);
this.lblGroupCounter.set_Text("Всего групп: " + ((int) groups.get_Count()));
}
示例7: GetSelectRowsGrid
private ObjectList<BenefitServiceType> GetSelectRowsGrid()
{
ObjectList<BenefitServiceType> list = new ObjectList<BenefitServiceType>();
foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvBenefitSrvTypes.Rows)
{
if (row.get_Selected())
{
list.Add((BenefitServiceType) row.get_DataBoundItem());
}
}
if (list.get_Count() != 0)
{
return list;
}
return null;
}
示例8: SetAreas
private void SetAreas(ObjectList<Area> areas)
{
this.bsAreas.set_DataSource(new ObjectList<Area>());
Area area = new Area {
Id = -1L,
Name = "<не выбрано>"
};
((ObjectList<Area>) this.bsAreas.get_DataSource()).Add(area);
((ObjectList<Area>) this.bsAreas.get_DataSource()).AddRange(areas);
if (this.listGroups.get_SelectedValue() != null)
{
int num = -1;
if (!(this.listGroups.get_SelectedValue().ToString() == ((int) num).ToString()))
{
this.lblAreaCounter.set_Text("Наборов в группе: " + ((int) areas.get_Count()));
return;
}
}
this.lblAreaCounter.set_Text("Всего наборов: " + ((int) areas.get_Count()));
}
示例9: foreach
private void отчетПоОсмотрамToolStripMenuItem_Click(object sender, System.EventArgs e)
{
ObjectList<UjfOrders> orders = new ObjectList<UjfOrders>();
foreach (System.Windows.Forms.DataGridViewRow row in this.dgvOrders.SelectedRows)
{
orders.Add(row.get_DataBoundItem() as UjfOrders);
}
if (orders.get_Count() <= 0)
{
System.Windows.Forms.MessageBox.Show("Выберите приказы для составления отчета");
}
else
{
System.Data.DataSet set = Mappers.UjfOrdersMapper.CreateOrderProtocol(orders);
set.Tables.get_Item(0).set_TableName("dataOrderInfo");
StiReport report = new StiReport();
report.Load(Resources.UjfOrderInspectionProtocol);
report.Compile();
report.RegData((System.Data.DataSet) set);
report.Show();
}
}
示例10: selectServices_OnServicesSelected
private void selectServices_OnServicesSelected(ObjectList<ServiceOld> services)
{
ServiceOld @null = ServiceOld.Null;
if (services.get_Count() != 0)
{
@null = services.get_Item(0);
}
this.UpdateServiceFields(@null);
}
示例11: m_SearchWorker_DoWork
private void m_SearchWorker_DoWork(object sender, DoWorkEventArgs e)
{
ObjectList<Apartment> list = new ObjectList<Apartment>();
if (this.m_SearchByNumbersRadio.get_Checked())
{
string apartmentNumber = this.m_ApartmentNumberEdit.get_Text().Trim();
string accountNumber = this.m_AccountEdit.get_Text().Trim();
list = Apartment.Search(apartmentNumber, accountNumber, LocalAddress.Null.Id, string.Empty, this.chxShowClose.get_Checked(), string.Empty);
if (string.IsNullOrEmpty(apartmentNumber) && string.IsNullOrEmpty(accountNumber))
{
this.addressesSearch.Clear();
for (int i = 0; i < LocalAddress.GetUserAddresses().get_Count(); i = (int) (i + 1))
{
this.addressesSearch.Add(LocalAddress.GetUserAddresses().get_Item(i));
}
}
if (!string.IsNullOrEmpty(apartmentNumber) || !string.IsNullOrEmpty(accountNumber))
{
if (list.get_Count() == 0)
{
System.Windows.Forms.MessageBox.Show("По Вашему запросу не найдено адреса.", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
this.flag = true;
}
else
{
this.addressesSearch.Clear();
this.addressesSearch.Add(LocalAddress.FindById(list.get_Item(0).AdrId));
}
}
}
else
{
LocalAddress selectedAddress = this.m_LocalAddressSelector.GetSelectedAddress();
string ownerName = this.m_OwnerNameEdit.get_Text();
if ((selectedAddress == LocalAddress.Null) && string.IsNullOrEmpty(ownerName))
{
list = Apartment.Search(string.Empty, string.Empty, LocalAddress.Null.Id, string.Empty, this.chxShowClose.get_Checked(), string.Empty);
this.addressesSearch.Clear();
for (int j = 0; j < LocalAddress.GetUserAddresses().get_Count(); j = (int) (j + 1))
{
this.addressesSearch.Add(LocalAddress.GetUserAddresses().get_Item(j));
}
}
else if ((selectedAddress != LocalAddress.Null) || !string.IsNullOrEmpty(ownerName))
{
list = Apartment.Search(string.Empty, string.Empty, selectedAddress.Id, ownerName, this.chxShowClose.get_Checked(), string.Empty);
if (list.get_Count() == 0)
{
System.Windows.Forms.MessageBox.Show("По Вашему запросу не найдено адреса.", "Предупреждение", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk);
this.flag = true;
}
else
{
this.addressesSearch.Clear();
if (selectedAddress != LocalAddress.Null)
{
this.addressesSearch.Add(selectedAddress);
}
else
{
this.addressesSearch.Add(LocalAddress.FindById(list.get_Item(0).AdrId));
}
}
}
}
list.ApplySort("AddressName");
e.set_Result(list);
}
示例12: GetSelectRowsGrid
private ObjectList<ApartmentResidentBenefitsServiceTypesView> GetSelectRowsGrid()
{
ObjectList<ApartmentResidentBenefitsServiceTypesView> list = new ObjectList<ApartmentResidentBenefitsServiceTypesView>();
foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvServiceTypes.Rows)
{
if (row.get_Selected())
{
list.Add((ApartmentResidentBenefitsServiceTypesView) row.get_DataBoundItem());
}
}
if (list.get_Count() == 0)
{
return null;
}
return list;
}
示例13: selectServiceTypes_Selected
private void selectServiceTypes_Selected(ObjectList<ServiceTypeOld> list)
{
if ((list != null) && (list.get_Count() > 0))
{
this.selectServices.FilterServiceTypes = list.get_Item(0);
}
else
{
this.selectServices.FilterServiceTypes = null;
}
}
示例14: SaveIndications
private void SaveIndications()
{
this.UpdatePackNumber();
this.dgvApartmentCounterIndicationsView.EndEdit();
ObjectList<ApartmentCounterIndicationInputView> counterIndications = new ObjectList<ApartmentCounterIndicationInputView>();
ObjectList<ApartmentCounterIndicationInputView> list2 = this.bsApartmentCounterIndicationInputView.get_DataSource() as ObjectList<ApartmentCounterIndicationInputView>;
foreach (ApartmentCounterIndicationInputView view in list2)
{
if ((view.NewVal != view.Val) || view.IsValueChanged)
{
if (!this.IsCorrectIndication(view))
{
view.NewValTypeName = "Контрольное (информационное)";
}
counterIndications.Add(view);
}
}
if (counterIndications.get_Count() > 0)
{
if (this.tsmiConfirmSaving.get_Checked())
{
if (System.Windows.Forms.DialogResult.Yes != System.Windows.Forms.MessageBox.Show(null, "Сохранить показания?", "Внимание", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Exclamation, System.Windows.Forms.MessageBoxDefaultButton.Button1))
{
return;
}
this.ClearAll();
this.FocusOnBarcode();
}
try
{
ApartmentCounterIndicationInputView.SaveIndications(counterIndications);
}
catch (System.Data.SqlClient.SqlException exception)
{
Messages.ShowException(this, "Ошибка при сохранении показаний", exception);
}
catch (System.Exception exception2)
{
Messages.ShowException(this, "Неопознанная ошибка", exception2);
}
}
else
{
Messages.ShowMessage("Нет корректных показаний для сохранения");
}
if (!this.m_IsFirstUpdate)
{
this.m_IsFirstUpdate = true;
}
}
示例15: btnSave_Click
private void btnSave_Click(object sender, System.EventArgs e)
{
bool isSaveDuplicateIndications = this.cbSaveDuplicateIndications.get_Checked();
if ((System.Windows.Forms.Application.OpenForms.get_Item(0).GetType().ToString() == "AIS.SN.UI.Provider.ProviderMainForm") && !User.IsMemberOf(RightsEnum.ПравоНеограниченнойРаботыСПоказаниями))
{
string valueByName = Setting.GetValueByName("Работа с приборами учета", "Диапазон в который разрешено редактирование в Поставщике");
if ((System.Convert.ToInt32(valueByName.Substring(0, valueByName.IndexOf('-'))) > System.DateTime.Now.get_Day()) || (System.Convert.ToInt32(valueByName.Substring((int) (valueByName.IndexOf('-') + 1), (int) ((valueByName.get_Length() - valueByName.IndexOf('-')) - 1))) < System.DateTime.Now.get_Day()))
{
System.Windows.Forms.MessageBox.Show(string.Concat((string[]) new string[] { "Вам разрешено редактирование данных только с ", valueByName.Substring(0, valueByName.IndexOf('-')), " по ", valueByName.Substring((int) (valueByName.IndexOf('-') + 1), (int) ((valueByName.get_Length() - valueByName.IndexOf('-')) - 1)), " числа месяца" }), "Редактирование запрещено", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Hand);
return;
}
}
this.dgvApartmentCounterIndicationsView.EndEdit();
if (System.Windows.Forms.DialogResult.No != System.Windows.Forms.MessageBox.Show(null, "Сохранить показания?", "Внимание", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Exclamation, System.Windows.Forms.MessageBoxDefaultButton.Button2))
{
ObjectList<ApartmentCounterIndicationInputView> list = (ObjectList<ApartmentCounterIndicationInputView>) this.bsApartmentCounterIndicationInputView.get_DataSource();
ObjectList<ApartmentCounterIndicationInputView> counterIndications = new ObjectList<ApartmentCounterIndicationInputView>();
foreach (ApartmentCounterIndicationInputView view in list)
{
if ((((view.Val != view.NewVal) || isSaveDuplicateIndications) || view.IsSaveDuplicateIndication) && view.ValidationMultiChangeIndication())
{
counterIndications.Add(view);
}
}
if (counterIndications.get_Count() > 0)
{
try
{
DALSql.ExecuteNonQuery("begin transaction", null);
ApartmentCounterIndicationInputView.MultiSaveRecalc(0L, counterIndications, isSaveDuplicateIndications);
DALSql.ExecuteNonQuery("commit transaction", null);
Messages.ShowMessage("Данные успешно сохранены");
}
catch (System.Exception exception)
{
DALSql.ExecuteNonQuery("IF (XACT_STATE()) = -1\r\n BEGIN\r\n ROLLBACK TRANSACTION;\r\n END;\r\n\r\n -- Test whether the transaction is active and valid.\r\n IF (XACT_STATE()) = 1\r\n BEGIN\r\n COMMIT TRANSACTION; \r\n END;\r\n ", null);
System.Windows.Forms.MessageBox.Show(exception.get_Message());
}
}
}
}