This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace GZTW.AyaNova.BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// Factory class for returning editable
|
||||
/// root object collections by name
|
||||
/// </summary>
|
||||
public sealed class EditableCollectionFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Fetch an editable collection
|
||||
/// </summary>
|
||||
/// <param name="Key">LocaleKey of Collection or
|
||||
/// most significant portion of localeKey property of collection
|
||||
/// i.e. "Priority.Label.List" LocaleKey is accepted
|
||||
/// as is "Priority"
|
||||
/// </param>
|
||||
public static object Get(string Key)
|
||||
{
|
||||
if (Key.LastIndexOf(".") != -1)
|
||||
{
|
||||
string [] s=Key.Split('.');
|
||||
Key=s[0];
|
||||
}
|
||||
switch (Key)
|
||||
{
|
||||
case "ContactTitle":
|
||||
return ContactTitles.GetItems();
|
||||
|
||||
case "DispatchZone":
|
||||
return DispatchZones.GetItems(true);
|
||||
|
||||
case "ClientGroup":
|
||||
return ClientGroups.GetItems();
|
||||
|
||||
case "ClientNoteType":
|
||||
return ClientNoteTypes.GetItems();
|
||||
|
||||
case "WorkorderItemType":
|
||||
return WorkorderItemTypes.GetItems();
|
||||
|
||||
case "WorkorderCategory":
|
||||
return WorkorderCategories.GetItems();
|
||||
|
||||
case "WorkorderStatus":
|
||||
return WorkorderStatuses.GetItems();
|
||||
|
||||
case "Priority":
|
||||
return Priorities.GetItems();
|
||||
|
||||
case "UnitOfMeasure":
|
||||
return UnitOfMeasures.GetItems();
|
||||
|
||||
case "PartCategory":
|
||||
return PartCategories.GetItems();
|
||||
|
||||
case "PartAssembly":
|
||||
return PartAssemblies.GetItems();
|
||||
|
||||
case "UserSkill":
|
||||
return UserSkills.GetItems();
|
||||
|
||||
case "UserCertification":
|
||||
return UserCertifications.GetItems();
|
||||
|
||||
case "UnitServiceType":
|
||||
return UnitServiceTypes.GetItems();
|
||||
|
||||
case "PartWarehouse":
|
||||
return PartWarehouses.GetItems(true);
|
||||
|
||||
case "UnitModelCategory":
|
||||
return UnitModelCategories.GetItems();
|
||||
|
||||
case "RateUnitChargeDescription":
|
||||
return RateUnitChargeDescriptions.GetItems();
|
||||
|
||||
case "Task":
|
||||
return Tasks.GetItems();
|
||||
|
||||
default:
|
||||
throw new ApplicationException("EditableCollectionFactory - list: " + Key + " Not recognized");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user