예제 #1
0
        public void GenerateCustomerId()
        {
            int    spaceIndex    = CompanyName.IndexOf(' ');
            string tmpCustomerId = string.Empty;

            if (spaceIndex == 0)
            {
                tmpCustomerId = CompanyName.ToUpper().Substring(0, 5);
            }
            else
            {
                tmpCustomerId = CompanyName.ToUpper().Substring(0, 3) +
                                CompanyName.ToUpper().Substring(spaceIndex + 1, 2);
            }

            CustomerId = tmpCustomerId;
        }