Exemplo n.º 1
0
 public IActionResult Payment(Models.Purchasing.Payment model)
 {
     if (ModelState.IsValid)
     {
         var serialize = Newtonsoft.Json.JsonConvert.SerializeObject(model);
         var content   = new StringContent(serialize);
         content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
         var response = Post("purchasing/savepayment", content);
         if (response.IsSuccessStatusCode)
         {
             return(RedirectToAction("purchaseinvoices"));
         }
     }
     ViewBag.PageContentHeader = "Make Payment";
     ViewBag.CashBanks         = Models.SelectListItemHelper.CashBanks();
     return(View(model));
 }
Exemplo n.º 2
0
        public IActionResult Payment(int id)
        {
            ViewBag.PageContentHeader = "Make Payment";

            var invoice = GetAsync <Dto.Purchasing.PurchaseInvoice>("purchasing/purchaseinvoice?id=" + id).GetAwaiter().GetResult();

            var model = new Models.Purchasing.Payment()
            {
                InvoiceId     = invoice.Id,
                InvoiceNo     = invoice.No,
                VendorId      = invoice.VendorId,
                VendorName    = invoice.VendorName,
                InvoiceAmount = invoice.Amount,
                AmountPaid    = invoice.AmountPaid,
                Date          = invoice.InvoiceDate
            };

            ViewBag.CashBanks = Models.SelectListItemHelper.CashBanks();

            return(View(model));
        }