using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace IStation.Dto
{
///
/// 执行返回的通用类,该类带有详细的业务数据,除了告诉用户此次调用是否成功与否,以及一个表示提示信息的字符串外,还带的详细的业务数据
///
public class ApiResult_ID : ApiResult
{
///
/// 业务数据
///
public long ID { get; set; }
///
/// /
///
public string Data { get; set; }
///
/// 构造函数
///
public ApiResult_ID() { }
///
/// 构造函数
///
/// 返回ID
/// 状态标识
/// 提示信息
public ApiResult_ID(long ID, IStation.Dto.ApiResultCode type, string message)
: base(type, message)
{
this.ID = ID;
this.Data = ID.ToString();
}
///
/// 构造函数
///
/// 返回ID
public ApiResult_ID(long ID)
{
if (ID > 0)
{
this.Code = IStation.Dto.ApiResultCode.Success;
this.Message = "";
this.ID = ID;
this.Data = ID.ToString();
}
else
{
this.Code = IStation.Dto.ApiResultCode.Error;
this.Message = "添加失败";
this.ID = 0;
this.Data = "0";
}
}
}
}