public void GetReportStatisticsTest() { SMS sms = GetSMS(); var b = ReportStatisticsDB.AddSMSHistory(sms); Assert.IsTrue(b); var r = ReportStatisticsDB.GetReportStatistics(sms.SerialNumber, sms.SendTime); Assert.IsNotNull(r); }
/// <summary> /// 查看短信统计报告 /// </summary> /// <param name="serialNumber"></param> /// <returns></returns> public RPCResult <ReportStatistics> GetReportStatistics(string smsid, DateTime sendTime) { try { var rs = ReportStatisticsDB.GetReportStatistics(smsid, sendTime); return(new RPCResult <ReportStatistics>(true, rs, "")); } catch (Exception ex) { LogHelper.LogError("StatusReport", "StatusReportService.GetReportStatistics", ex.ToString()); return(new RPCResult <ReportStatistics>(false, null, "获取统计报告失败")); } }
public void UpdateTest() { SMS sms = GetSMS(); var b = ReportStatisticsDB.AddSMSHistory(sms); Assert.IsTrue(b); var r = ReportStatisticsDB.GetReportStatistics(sms.SerialNumber, sms.SendTime); Assert.IsNotNull(r); ReportStatistics rs = new ReportStatistics() { SerialNumber = sms.SerialNumber, SendCount = 100, SendTime = sms.SendTime }; b = ReportStatisticsDB.Update("account", rs); Assert.IsTrue(b); }