コード例 #1
0
ファイル: SystemDAO.cs プロジェクト: jkchua/MPAOrganizer
		public Lookup GetLookupById(long lookupId)
		{
			Lookup lookupItem = new Lookup();
			
			var lookup = service.GetEnumById(lookupId);
			
			if(lookup != null)
			{
				lookupItem.Id = lookup.Id;
				lookupItem.Name = lookup.Name;
				lookupItem.Order = lookup.Order;
			}
			else
				return null;
						
			return lookupItem;
		}
コード例 #2
0
ファイル: SystemDAO.cs プロジェクト: jkchua/MPAOrganizer
		public List<Lookup> GetDropDownDataByCategoryId(Category category)
		{
			List<Lookup> dropDownData = new List<Lookup>();
			
			LookupStructure[] lookupList = service.GetEnumsByCategory((int)category);
			
			// Once parsed, transform the array into list by creating a List<Member> for your UI.
			for (int i = 0, lookupListLength = lookupList.Length; i < lookupListLength; i++) {
            	
				var item = lookupList[i];
				
				Lookup lookup = new Lookup() {
					Id = item.Id,
					Category = item.Category,
					Name = item.Name,
					Order = item.Order
				};
				
				dropDownData.Add(lookup);
			}

            return dropDownData;
		}