Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AllocationChange allocationChange = (AllocationChange)db.ChangeEvents.Find(id);

            db.ChangeEvents.Remove(allocationChange);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,EffectiveDateTime,Amount,ChangeTypeEnum,Recurance,AllocationId,IsRecurring")] AllocationChange allocationChange)
 {
     if (ModelState.IsValid)
     {
         db.Entry(allocationChange).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AllocationId = new SelectList(db.Allocations, "Id", "Name", allocationChange.AllocationId);
     return(View(allocationChange));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,EffectiveDateTime,Amount,ChangeTypeEnum,Recurance,AllocationId,IsRecurring")] AllocationChange allocationChange)
        {
            if (ModelState.IsValid)
            {
                db.ChangeEvents.Add(allocationChange);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AllocationId = new SelectList(db.Allocations, "Id", "Name", allocationChange.AllocationId);
            return(View("~/Views/Budget/Index.cshtml"));
        }
Exemplo n.º 4
0
        // GET: AllocationChanges/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AllocationChange allocationChange = (AllocationChange)db.ChangeEvents.Find(id);

            if (allocationChange == null)
            {
                return(HttpNotFound());
            }
            return(View(allocationChange));
        }
Exemplo n.º 5
0
        // GET: AllocationChanges/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AllocationChange allocationChange = (AllocationChange)db.ChangeEvents.Find(id);

            if (allocationChange == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AllocationId = new SelectList(db.Allocations, "Id", "Name", allocationChange.AllocationId).OrderBy(x => x.Text);
            return(View(allocationChange));
        }
Exemplo n.º 6
0
        // GET: AllocationChanges/Create
        public ActionResult Create(int?AllocationId)
        {
            ViewBag.AllocationId = new SelectList(db.Allocations, "Id", "Name").OrderBy(x => x.Text);
            AllocationChange change = new AllocationChange();

            if (AllocationId != null)
            {
                //change.AllocationId = (int)AllocationId;
                change.Allocation = db.Allocations.Find(AllocationId);
            }
            change.EffectiveDateTime = DateTime.Now;
            change.ChangeTypeEnum    = Models.Enums.ChangeTypeEnum.LumpSum;

            return(View(change));
        }