Beispiel #1
0
        public string GenerateId(string district, string thana, int thanaId)
        {
            int    numberOfcenter = aCenterManager.GetTotalThana(thanaId);
            string code           = "";

            for (int i = 0; i < 3; i++)
            {
                code += district[i];
            }
            for (int i = 0; i < 3; i++)
            {
                code += thana[i];
            }
            code += ".";
            if (numberOfcenter < 9)
            {
                code += "00" + (numberOfcenter + 1).ToString();
            }
            else if (numberOfcenter < 99)
            {
                code += "0" + (numberOfcenter + 1).ToString();
            }
            else
            {
                code += (numberOfcenter + 1).ToString();
            }

            return(code);
        }