Exemplo n.º 1
0
        public ActionResult AddVoucher([Bind(Include = "user,subcription,Used,ExpiryDate")] Voucher voucher)
        {
            DataBank db = new DataBank();

            voucher.user        = db.GetUser(Convert.ToInt32(Session["VoucherUserId"]));
            voucher.subcription = db.GetSubcription(Convert.ToInt32(Session["VoucherSubscriptionId"]));
            voucher.Date        = DateTime.Now;
            if (db.AddVoucher(voucher))
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }