/// <summary> /// /// </summary> /// <param name="commmaSeperatedCodes"></param> /// <returns></returns> public static IList <NamedBusinessCode> CodesToList(string commmaSeperatedCodes, bool integer) { IList <NamedBusinessCode> nbcList = new List <NamedBusinessCode>(); string[] str = commmaSeperatedCodes.Split(PROJECT_FIELD_DELIMITER); foreach (string s in str) { NamedBusinessCode i = new NamedBusinessCode(); if (integer) { if (string.IsNullOrEmpty(s)) { i.ID = -1; } else { i.ID = Convert.ToInt32(s); } } else { i.Code = s; } i.Name = string.Empty; nbcList.Add(i); } return(nbcList); }
/// <summary> /// /// </summary> /// <param name="commmaSeperatedCodes"></param> /// <returns></returns> public static IList <NamedBusinessCode> CodesToList(string commmaSeperatedCodes) { IList <NamedBusinessCode> nbcList = new List <NamedBusinessCode>(); string[] str = commmaSeperatedCodes.Split(PROJECT_FIELD_DELIMITER); foreach (string s in str) { NamedBusinessCode i = new NamedBusinessCode(); i.Code = s; i.Name = string.Empty; nbcList.Add(i); } return(nbcList); }