示例#1
0
        public Task <string> DownLoadInvoiceByUserInvoiceId(string invoiceId, string userId, string userTableName)
        {
            OrderSummary orderSummary = _context.OrderSummaries.FromSqlRaw($"select '' as statusname,* from UserOrders.User{userTableName}Orders where id='{invoiceId}' and userId='{userId}'").FirstOrDefault();

            if (orderSummary.OrderStatusId != (int)EnumOrderStatus.Delivered)
            {
                return(Task.FromResult("Requested order not found."));
            }
            return(Task.FromResult(TemplateGeneratorForInvoice.GetHTMLStringForInvoice(invoiceId, orderSummary)));
        }
示例#2
0
        public Task <string> DownLoadInvoiceByVendorInvoiceId(string invoiceId, string userId)
        {
            var          shop         = _context.Shops.Where(x => x.UserId == userId).FirstOrDefault();
            OrderSummary orderSummary = _context.OrderSummaries.FromSqlRaw($"select '' as statusname,* from VendorOrder.Vendor{shop.tableName}Orders where id='{invoiceId}' and shopId='{shop.Id}'").FirstOrDefault();

            if (orderSummary.OrderStatusId != (int)EnumOrderStatus.Delivered)
            {
                return(Task.FromResult("Requested order not found."));
            }
            return(Task.FromResult(TemplateGeneratorForInvoice.GetHTMLStringForInvoice(invoiceId, orderSummary)));
        }