public string GetOrganizationCode(Organization organization) { int countDeptStd = setupGateway.GetOrganizationCode(organization) + 1; int noOfZeroToBeAdded = 4 - countDeptStd.ToString().Length; string noOfZero = ""; for (int i = 0; i < noOfZeroToBeAdded; i++) { noOfZero += "0"; } return(noOfZero + countDeptStd); }