// GET: Recipients/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IRecipient  recipient = _recipientService.GetRecepient(CommonFunctions.NullableIntToInt(id));
            RecipientVM vm        = new RecipientVM(recipient);

            if (recipient == null)
            {
                return(HttpNotFound());
            }
            return(View(vm));
        }
Ejemplo n.º 2
0
 public ActionResult Create([Bind(Include = "BillId,DueAmount,DueDate,Period,Description,BillTypeId,RecipientId")] CreateBillVM bill)
 {
     if (ModelState.IsValid)
     {
         IBill item = _billFactory.NewBill(bill.BillId, bill.RecipientId, bill.BillTypeId, bill.Description, bill.DueAmount, bill.DueDate, bill.Periodical, bill.Period, false);
         _billService.CreateBill(item);
         TempData["ResultMessage"] = "Utworzono rachunek";
         var recipient = _recipientService.GetRecepient(bill.RecipientId);
         log.Info("Utworzono rachunek " + "Id:" + bill.RecipientId + ", Odbiorca: " + recipient.CompanyName + ", Kwota: " + bill.DueAmount);
         return(RedirectToAction("Index"));
     }
     return(View(bill));
 }