public CableReportController() { _da = new ReportDA(); _hostDa = new HostDA(); _dishBillGenerateDA = new DishBillGenerateDA(); _internetBillGenerateDA = new InternetBillGenerateDA(); }
public MailAttachments AgreementReportAttachment(int OfferId, int UserType) { ReportDA ReportDAL = new ReportDA(); byte[] AgreementReport = ReportDAL.AgreementReportFile(OfferId, UserType); MailAttachments AgreementReportAttachment = new MailAttachments(); AgreementReportAttachment.file = AgreementReport; AgreementReportAttachment.fileName = "AgreementReport.pdf"; AgreementReportAttachment.contentType = "application/pdf"; return(AgreementReportAttachment); }
public ActionResult MakeInvoicePayment() { List <InvoicePaymentViewModel> lstObj = new List <InvoicePaymentViewModel>(); List <Int32> InvIds = new ReportDA().GetInvoiceIds(); TicketingReportViewModel model = new TicketingReportViewModel(); model.TicketReport = new ReportDA().GetTicketingReportByDateRange("08/01/2014", "07/31/2015"); List <TransactionEMP> transactions = new ReportDA().GetAllTransactionSummary(); List <InvoiceName> iNames = new ReportDA().GetAllInvoiceNamesSummary(); for (int i = 0; i < 10; i++) { InvoicePaymentViewModel Obj = new InvoicePaymentViewModel(); Obj.Id = i + 1; Obj.InvoiceId = InvIds[i]; Obj.Amount = iNames.Where(a => a.InvoiceId == InvIds[i]).Select(x => x.Amount).Sum(); Obj.Received = transactions.Where(a => a.InvoiceId == InvIds[i]).Select(x => x.Amount).Sum(); lstObj.Add(Obj); } return(View()); }
public byte[] AgreementReportFile(int OfferId, int UserType) { ReportDA ReportDAL = new ReportDA(); return(ReportDAL.AgreementReportFile(OfferId, UserType)); }
public static void DoWork(JobContext context) { var now = DateTime.Now; #region 修复数据Code if (context != null) { //从上下文中获取当前日期(用于修复数据使用,平时都为空) if (context.Properties.ContainsKey("CurrentDay")) { now = Convert.ToDateTime(context.Properties["CurrentDay"]); } } #endregion if (now.Day != 1 && now.DayOfWeek != DayOfWeek.Monday) { return; } DateTime dtPeridTime; if (now.Day == 1) { dtPeridTime = now.AddMonths(-1); } else { dtPeridTime = now.AddDays(1 - now.Day); } var dateFrom = dtPeridTime.Date.ToString(Settings.ShortDateFormat); var dateTo = now.Date.AddSeconds(-1).ToString(Settings.LongDateFormat); var beginMonthDate = now.AddDays(1 - now.Day).Date; var beginMonth = beginMonthDate.ToString(Settings.ShortDateFormat); var endLastMonth = beginMonthDate.AddSeconds(-1).ToString(Settings.LongDateFormat); try { var ds = ReportDA.ARAPReport(dateFrom, dateTo, beginMonth, endLastMonth); if (!HasMoreRow(ds)) { return; } StringBuilder sb = new StringBuilder(1000); sb.Append("<table border=1 ><font color=blue></font>"); sb.Append("<tr><td colspan=5 align=center>收款方式区分收入" + dtPeridTime.ToString("yyyy-MM-dd") + "~" + dateTo + "</td></tr>"); sb.Append("<tr>"); sb.Append("<td>付款方式编号</td>"); sb.Append("<td>付款方式名称</td>"); sb.Append("<td>销售收入(不含税)</td>"); sb.Append("<td>月初应收款余额(含税)</td>"); sb.Append("<td>截至上周日晚应收款余额(含税)</td>"); sb.Append("<td>截至前一天晚上的应收款余额(含税)</td>"); sb.Append("</tr>"); foreach (DataRow row in ds.Tables[0].Rows) { sb.Append("<tr>"); sb.Append("<td>" + row["PayTypeSysNo"].ToString() + "</td>"); sb.Append("<td>" + row["PayTypeName"].ToString() + "</td>"); sb.Append("<td>" + (TrimDecimalNull(row["TotalAmt"]) / 1.17m).ToString(Settings.DecimalFormatWithGroup) + "</td>"); sb.Append("<td>" + TrimDecimalNull(row["OriginARAmt"]).ToString(Settings.DecimalFormatWithGroup) + "</td>"); sb.Append("<td>" + TrimDecimalNull(row["ARAmt"]).ToString(Settings.DecimalFormatWithGroup) + "</td>"); sb.Append("<td>" + TrimDecimalNull(row["OrderAmt"]).ToString(Settings.DecimalFormatWithGroup) + "</td>"); sb.Append("</tr>"); } sb.Append("<tr>"); sb.Append("<td colspan=2 align=center>合计:</td>"); sb.Append("<td>" + (TrimDecimalNull(ds.Tables[0].Compute("sum(TotalAmt)", null)) / 1.17m).ToString(Settings.DecimalFormatWithGroup) + "</td>"); sb.Append("<td>" + (TrimDecimalNull(ds.Tables[0].Compute("sum(OriginARAmt)", null))).ToString(Settings.DecimalFormatWithGroup) + "</td>"); sb.Append("<td>" + (TrimDecimalNull(ds.Tables[0].Compute("sum(ARAmt)", null))).ToString(Settings.DecimalFormatWithGroup) + "</td>"); sb.Append("<td>" + (TrimDecimalNull(ds.Tables[0].Compute("sum(OrderAmt)", null))).ToString(Settings.DecimalFormatWithGroup) + "</td>"); sb.Append("</tr>"); sb.Append("</table>"); sb.Append("<br /> <b>" + dtPeridTime.ToString("yyyy-MM-dd") + "~" + dateTo + "理光客户积分数据:</b>"); DataSet dsPoint = ReportDA.LGPoint(dateFrom, dateTo); if (HasMoreRow(dsPoint)) { if (TrimDecimalNull(dsPoint.Tables[0].Rows[0][0]) != Settings.DecimalNull) { sb.Append("<br />使用积分:").Append(TrimDecimalNull(dsPoint.Tables[0].Rows[0][0])); } else { sb.Append("<br />使用积分:0"); } if (TrimIntNull(dsPoint.Tables[0].Rows[0][1]) != Settings.IntNull) { sb.Append("<br />作废积分:").Append(TrimIntNull(dsPoint.Tables[0].Rows[0][1])); } else { sb.Append("<br />作废积分:0"); } } else { sb.Append("<br />使用积分:0"); sb.Append("<br />作废积分:0"); } SendMail(Settings.EmailAddress, "按每种收款方式区分收入汇总报表_理光积分情况", sb.ToString(), 0); } catch (Exception ex) { throw ex; } }