void GetLevelChartIDLevel5() { CheckForChild(); Level1 = LblNodeValue.Text.ToString().Substring(0, 1); Level2 = LblNodeValue.Text.ToString().Substring(1, 2); Level3 = LblNodeValue.Text.ToString().Substring(3, 2); Level4 = LblNodeValue.Text.ToString().Substring(5, 2); Level5 = LblNodeValue.Text.ToString().Substring(7); //ParentChartID = Convert.ToInt64(COAChartCode); string P = ""; char pad = '0'; if (Convert.ToInt16(Level5) > 0) { Int16 ii = Convert.ToInt16(Level5); ii += 1; P = ii.ToString(); P = P.PadLeft(Level5.Length, pad); LastLevel = "W"; COAChartCode = Level1 + Level2 + Level3 + Level4 + P; Level = 5; } else { Level1 = LblNodeValue.Text.ToString().Substring(0, 1); Level2 = LblNodeValue.Text.ToString().Substring(1, 2); Level3 = LblNodeValue.Text.ToString().Substring(3, 2); Level4 = LblNodeValue.Text.ToString().Substring(5, 2); Level5 = LblNodeValue.Text.ToString().Substring(7); COAChartCode = Level1.ToString() + Level2.ToString() + Level3.ToString() + Level4.ToString() + "0001".ToString(); Level = 5; } TxtNewAccountNo.Text = COAChartCode; }