Esempio n. 1
0
		public ActionResult ManagePledge(string id)
		{
			if (!id.HasValue())
				return Content("bad link");
			ManagePledgesModel m = null;
			var td = TempData["PeopleId"];
			if (td != null)
				m = new ManagePledgesModel(td.ToInt(), id.ToInt());
			else
			{
				var guid = id.ToGuid();
				if (guid == null)
					return Content("invalid link");
				var ot = DbUtil.Db.OneTimeLinks.SingleOrDefault(oo => oo.Id == guid.Value);
				if (ot == null)
					return Content("invalid link");
				if (ot.Used)
					return Content("link used");
				if (ot.Expires.HasValue && ot.Expires < DateTime.Now)
					return Content("link expired");
				var a = ot.Querystring.Split(',');
				m = new ManagePledgesModel(a[1].ToInt(), a[0].ToInt());
				ot.Used = true;
				DbUtil.Db.SubmitChanges();
			}
			SetHeaders(m.orgid);
		    m.Log("Start");
            return View("ManagePledge/Index", m);
		}
Esempio n. 2
0
		public ActionResult ConfirmPledge(ManagePledgesModel m)
		{
            m.Confirm();
	        SetHeaders(m.orgid);
	        OnlineRegModel.LogOutOfOnlineReg();

            m.Log("Confirm");
			return View("ManagePledge/Confirm", m);
		}