예제 #1
0
        public static void AddSendQueue(string mailfrom, string rcptto, string messagebody)
        {
            OutGoing input = new OutGoing()
            {
                MailFrom = mailfrom, RcptTo = rcptto, MsgBody = messagebody
            };

            AddQueue(input);
        }
예제 #2
0
        public ActionResult Send(InvoiceDetailModel model)
        {
            OutGoing outGoing = db.Invoices.OfType <OutGoing>().FirstOrDefault(f => f.Id == model.Id);

            InvoiceDetailModel invoice = new InvoiceDetailModel()
            {
                Id               = outGoing.Id,
                Title            = outGoing.Title,
                CustomerUserName = outGoing.CustomerUserName,
                AraToplam        = outGoing.AraToplam,
                CreateTime       = outGoing.CreateTime,
                CustomerId       = outGoing.CustomerId,
                Description      = outGoing.Description,
                GenelToplam      = outGoing.GenelToplam,
                KDVToplam        = outGoing.KDVToplam,
                ProcessTime      = outGoing.ProcessTime,
                CustomerEmail    = model.CustomerEmail,
                ServiceProducts  = db.ServiceProducts.Where(w => w.InvoiceId == model.Id).ToList(),
            };

            return(View(invoice));
        }
예제 #3
0
        public ActionResult SCreate(OutGoingCreateModel model1)
        {
            OutGoingCreateModel model    = (TempData["Outgoing"] as OutGoingCreateModel);
            OutGoing            outGoing = new OutGoing
            {
                CustomerId       = model.CustomerId,
                CustomerUserName = model.CustomerUserName,
                Description      = model.Description,
                ProcessTime      = model.ProcessTime,
                CreateTime       = model.CreateTime,
                Title            = model.Title,
                AraToplam        = model.AraToplam,
                KDVToplam        = model.KDVToplam,
                GenelToplam      = model.GenelToplam,
            };
            Invoice invoice = db.Invoices.Add(outGoing);

            db.SaveChanges();

            foreach (var product in model.ServiceProducts)
            {
                ServiceProduct serviceProduct = new ServiceProduct
                {
                    Name        = product.Name,
                    Description = product.Description,
                    Quantity    = product.Quantity,
                    UnitPrice   = product.UnitPrice,
                    Tax         = product.Tax,
                    Total       = product.Total,
                    InvoiceId   = invoice.Id,
                };
                db.ServiceProducts.Add(serviceProduct);
            }

            db.SaveChanges();
            TempData.Remove("Outgoing");
            return(RedirectToAction("SIndex", "Invoice"));
        }