public HttpResponseMessage registerCompany(Company company) { StatusMessageModel message = new StatusMessageModel(); message.message = "Company registered"; message.status = "OK"; HttpResponseMessage response = ResponseHelper.CreateResponse(HttpStatusCode.Accepted, message, Request); return response; }
public HttpResponseMessage postMessage(StatusMessageModel mm) { StatusMessageModel newMessage = new StatusMessageModel(); newMessage.message = "Received (" + mm.status + " " + mm.message + ")"; newMessage.status = "OK"; HttpResponseMessage response = null; response = ResponseHelper.CreateResponse(HttpStatusCode.Accepted, newMessage, Request); return response; }
public HttpResponseMessage apiStatus() { HttpResponseMessage response = null; //response = ResponseHelper.CreateResponse(HttpStatusCode.OK, sm, Request); StatusMessageModel mm = new StatusMessageModel(); mm.status = "Ok"; mm.message = "Good Call"; //string mm = "message model string"; //string json = JsonConvert.SerializeObject(mm); //Business.Business.LogMessage(string.Format("Returning ({0}/{1}): {2}", statusCode, (int)statusCode, json)); response = Request.CreateResponse<object>(HttpStatusCode.OK, mm); return response; }
public HttpResponseMessage registerUser(string user) { StatusMessageModel mm = new StatusMessageModel(); if (user == null) { mm.message = "User is null"; mm.status = "Bad User"; } else if (user.IndexOf("admin") >= 0) { mm.status = "Admin user registered"; mm.message = user + " is Registered"; } else { mm.status = "User Registered"; mm.message = user + " is Registered"; } HttpResponseMessage response = null; response = ResponseHelper.CreateResponse(HttpStatusCode.Accepted, mm, Request); return response; }