Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [System.Web.Mvc.Route("BuildingTH")]
- [System.Web.Mvc.HttpPost()]
- [System.Web.Mvc.ActionName("FindListBuilding")]
- public HttpResponseMessage FindListBuilding([FromBody] BuildingContentViewModel mydata)
- {
- HttpResponseMessage response = default(HttpResponseMessage);
- try
- {
- if (DomainModelBase.IsAuthenticated() == "l")
- {
- response = Request.CreateResponse(HttpStatusCode.OK, new
- {
- Result = "login",
- //Data = GenerateTableRows(dt, "users")
- Data = "Please login"
- });
- return response;
- }
- var model = new BuildingDomaineModel().GetListBuilding(mydata, true);
- if (model != null)
- {
- response = Request.CreateResponse(HttpStatusCode.OK, new
- {
- Result = "success",
- //Data = GenerateTableRows(dt, "users")
- Data = model
- });
- }
- else
- {
- response = Request.CreateResponse(HttpStatusCode.NotFound, new
- {
- Result = "Pleade insert the firstname",
- // Data = GenerateTableRows(dt, "users")
- });
- }
- }
- catch (Exception ex)
- {
- response = Request.CreateResponse(HttpStatusCode.InternalServerError, new
- {
- result = "error",
- data = ex
- });
- }
- return response;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement