public static LotteryResult GetLotteryResult(string cpCode, int status, string btime, string etime, string orderasc = "asc") { string sqlwhere = " where b.cpCode='" + cpCode + "'"; if (status > -1) { sqlwhere += " and b.Status=" + status; } if (!string.IsNullOrEmpty(btime)) { sqlwhere += " and b.opentime>='" + btime + "'"; } if (!string.IsNullOrEmpty(etime)) { sqlwhere += " and b.opentime<='" + etime + " 23:59:59:999'"; } DataTable dt = LotteryResultDAL.GetDataTable("select top 1 * from LotteryResult (nolock) b " + sqlwhere + " Order by AutoID " + orderasc); LotteryResult model = new LotteryResult(); foreach (DataRow dr in dt.Rows) { model.FillData(dr); } return(model); }
public static LotteryResult GetLotteryResult(string cpCode, string status, string orderasc = "asc") { string sqlwhere = " where b.cpCode='" + cpCode + "'"; if (!string.IsNullOrEmpty(status)) { sqlwhere += " and b.Status in (" + status + ") "; } DataTable dt = LotteryResultDAL.GetDataTable("select top 1 * from LotteryResult (nolock) b " + sqlwhere + " Order by AutoID " + orderasc); LotteryResult model = new LotteryResult(); foreach (DataRow dr in dt.Rows) { model.FillData(dr); } return(model); }