Ejemplo n.º 1
0
        public ActionResult GenerateStatementEmail(int customerId)
        {
            CakesPosRepository cpr = new CakesPosRepository(_connectionString);
            int              id    = cpr.GenerateStatement(customerId);
            StatementsModel  s     = cpr.GetStatementsForPdf(id, customerId);
            StatementManager sm    = new StatementManager();

            sm.CreateStatementPDF(s, @"C:\inetpub\sites\CakesPos\StatementsPdf\" + s.Statement.Id + ".pdf");
            cpr.AddStatementFilePath(s.Statement.Id, @"C:\inetpub\sites\CakesPos\StatementsPdf\" + s.Statement.Id + ".pdf");
            sm.EmailStatement(@"C:\inetpub\sites\CakesPos\StatementsPdf\" + s.Statement.Id + ".pdf", s.Orders.FirstOrDefault().customer.Email, s.Statement.Date.ToShortDateString());
            return(null);
        }
Ejemplo n.º 2
0
        public ActionResult GenerateStatementPrint(int customerId)
        {
            CakesPosRepository cpr = new CakesPosRepository(_connectionString);
            int              id    = cpr.GenerateStatement(customerId);
            StatementsModel  s     = cpr.GetStatementsForPdf(id, customerId);
            StatementManager sm    = new StatementManager();

            sm.CreateStatementPDF(s, @"C:\inetpub\sites\CakesPos\StatementsPdf\" + s.Statement.Id + ".pdf");
            cpr.AddStatementFilePath(s.Statement.Id, @"C:\inetpub\sites\CakesPos\StatementsPdf\" + s.Statement.Id + ".pdf");
            return(Json(id, JsonRequestBehavior.AllowGet));
            //sm.EmailStatement(@"C:\Users\Barry\Documents\Pdf-Statements\" + s.Statement.Id + ".pdf", s.Orders.FirstOrDefault().customer.Email, s.Statement.Date.ToShortDateString());
            //Statement s=cpr.GetStatementByCustomerId(customerId);
            //StatementManager sm = new StatementManager();
            //sm.CreateStatementPDF(s, @"C:\Users\Barry\Documents\Pdf-Statements\" + s.StatementNumber + ".pdf");
            //sm.EmailStatement(@"C:\Users\Barry\Documents\Pdf-Statements\" + s.StatementNumber + ".pdf", s.Orders.FirstOrDefault().customer.Email, s.StatementDate.ToShortDateString());
            //cpr.AddStatementsFilePath()Path.Combine(AppDomain.CurrentDomain.BaseDirectory,s.Statement.Id + ".pdf");
        }