You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

66 lines
1.9 KiB

using System.Net;
namespace Common.Model
{
public class JsonResponse
{
private string _responseData = "";
public HttpStatusCode statusCode { get; set; }
public string errorName { get; set; }
public string responseMessage { get; set; }
public string responseDescription { get; set; }
public string responseData
{
get
{
return _responseData;
}
set
{
_responseData = value;
}
}
public JsonResponse()
{
}
public void SetResponseMessage(HttpStatusCode statusCode, string message, string data)
{
this.statusCode = statusCode;
this.responseMessage = message;
this.responseDescription = "";//ConstantValues.GetHttpStatusCodeDescription(statusCode);
this.responseData = data;
}
public void SetResponseMessage(string errorName, string message, HttpStatusCode statusCode, string description)
{
this.statusCode = statusCode;
this.responseMessage = message;
this.responseDescription = description;
this.errorName = errorName;
}
public void SetResponseMessage(string errorName, string message, HttpStatusCode statusCode)
{
this.statusCode = statusCode;
this.responseMessage = message;
this.responseDescription = "";
this.errorName = errorName;
}
public void SetResponseMessage(HttpStatusCode statusCode, string message)
{
this.statusCode = statusCode;
this.responseMessage = message;
this.responseDescription = "";
}
public JsonResponse ReturnBadRequest(string message)
{
this.SetResponseMessage(HttpStatusCode.BadRequest, message);
return this;
}
}
}