本文整理汇总了C#中System.Collections.ObjectModel.Collection.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.ObjectModel.Collection.ToArray方法的具体用法?C# System.Collections.ObjectModel.Collection.ToArray怎么用?C# System.Collections.ObjectModel.Collection.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.ObjectModel.Collection
的用法示例。
在下文中一共展示了System.Collections.ObjectModel.Collection.ToArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValues
private CascadingDropDownNameValue[] GetValues(System.Data.DataTable table)
{
System.Collections.ObjectModel.Collection<CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection<CascadingDropDownNameValue>();
foreach(System.Data.DataRow dr in table.Rows)
{
values.Add(new CascadingDropDownNameValue(dr["party"].ToString(), dr["party_code"].ToString()));
}
return values.ToArray();
}
示例2: GetStockItems
public CascadingDropDownNameValue[] GetStockItems(string knownCategoryValues, string category)
{
System.Collections.ObjectModel.Collection<CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection<CascadingDropDownNameValue>();
using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable("core", "items", "maintain_stock", "true"))
{
foreach(System.Data.DataRow dr in table.Rows)
{
values.Add(new CascadingDropDownNameValue(dr["item_name"].ToString(), dr["item_code"].ToString()));
}
return values.ToArray();
}
}
示例3: GetUnits
public CascadingDropDownNameValue[] GetUnits(string knownCategoryValues, string category)
{
StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
string itemCode = kv["Item"];
System.Collections.ObjectModel.Collection<CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection<CascadingDropDownNameValue>();
using (System.Data.DataTable table = MixERP.Net.BusinessLayer.Core.Units.GetUnitViewByItemCode(itemCode))
{
foreach (System.Data.DataRow dr in table.Rows)
{
values.Add(new CascadingDropDownNameValue(dr["unit_name"].ToString(), dr["unit_id"].ToString()));
}
return values.ToArray();
}
}
示例4: GetShippingAddresses
public CascadingDropDownNameValue[] GetShippingAddresses(string knownCategoryValues, string category)
{
System.Collections.ObjectModel.Collection<CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection<CascadingDropDownNameValue>();
StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
string partyCode = kv["Party"];
using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Core.ShippingAddresses.GetShippingAddressView(partyCode))
{
table.Columns.Add("shipping_address", typeof(string), MixERP.Net.BusinessLayer.Core.ShippingAddresses.GetDisplayField());
foreach(System.Data.DataRow dr in table.Rows)
{
values.Add(new CascadingDropDownNameValue(dr["shipping_address_code"].ToString(), dr["shipping_address"].ToString()));
}
}
return values.ToArray();
}
示例5: GetCashRepositories
public CascadingDropDownNameValue[] GetCashRepositories(string knownCategoryValues, string category)
{
StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
string accountCode = kv["Account"];
System.Collections.ObjectModel.Collection<CascadingDropDownNameValue> values = new System.Collections.ObjectModel.Collection<CascadingDropDownNameValue>();
if(MixERP.Net.BusinessLayer.Core.Accounts.IsCashAccount(accountCode))
{
using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable("office", "cash_repositories"))
{
foreach(System.Data.DataRow dr in table.Rows)
{
values.Add(new CascadingDropDownNameValue(dr["cash_repository_name"].ToString(), dr["cash_repository_code"].ToString()));
}
}
}
return values.ToArray();
}