public string GenerateCode() { var code = "L" + TextExpress.Randomize(6, TextExpress.NUMBER + TextExpress.NUMBER); var existing = dao.Query(x => x.LocationCode == code).FirstOrDefault(); while (existing != null) { code = "L" + TextExpress.Randomize(6, TextExpress.NUMBER + TextExpress.NUMBER); existing = dao.Query(x => x.LocationCode == code).FirstOrDefault(); } return(code); }
public string GenerateCode() { var code = "S" + TextExpress.Randomize(9, TextExpress.NUMBER + TextExpress.NUMBER); var existing = Query(x => x.ServerCode == code).FirstOrDefault(); while (existing != null) { code = "S" + TextExpress.Randomize(9, TextExpress.NUMBER + TextExpress.NUMBER); existing = Query(x => x.ServerCode == code).FirstOrDefault(); } return(code); }
public string GeneratePassword() { var password = TextExpress.Randomize(10); return(password); }