//Generates a new id number public HttpResponseMessage Get() { HttpResponseMessage msg = new HttpResponseMessage(); GenerateNewId newID; try { newID = new GenerateNewId(); msg.Content = new StringContent(newID.NewID); } catch { msg = Request.CreateResponse(HttpStatusCode.BadRequest, "Error in Generating new ID"); } return msg; }
public void TestGeneration() { GenerateNewId newid = new GenerateNewId(); string newId = newid.NewID; }
public bool validCheckbit() { bool Success = false; try { GenerateNewId id = new GenerateNewId(); id.NewID = _id; var result = id.ControlDigit(); _checkbit = int.Parse(id._checkbit); if (_checkbit == int.Parse(_id.ToString().Substring(11, 1))) Success = true; } catch { throw new Exception("Invalid checkbit"); } return Success; }