Ejemplo n.º 1
0
        public ActionResult GrantBudgetsDeleteConfirmed(Guid id)
        {
            GrantBudget grantBudget = dbGrantBudgets.GrantBudgets.Find(id);

            dbGrantBudgets.GrantBudgets.Remove(grantBudget);
            dbGrantBudgets.SaveChanges();
            return(RedirectToAction("GrantBudgetsIndex", routeValues: new { grantId = grantBudget.GrantID }));
        }
Ejemplo n.º 2
0
        public ActionResult GrantBudgetsDelete(Guid?id, Guid grantId)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GrantBudget grantBudget = dbGrantBudgets.GrantBudgets.Find(id);

            if (grantBudget == null)
            {
                return(HttpNotFound());
            }
            ViewBag.GrantID = grantId;

            return(View(grantBudget));
        }
Ejemplo n.º 3
0
        public ActionResult GrantBudgetsEdit(Guid?id, Guid grantId)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GrantBudget grantBudget = dbGrantBudgets.GrantBudgets.Find(id);

            if (grantBudget == null)
            {
                return(HttpNotFound());
            }
            PopulateGrantBudgetTypesDropDownList(grantBudget.GrantBudgetsTypeID);
            ViewBag.GrantID = grantId;
            return(View(grantBudget));
        }
Ejemplo n.º 4
0
        public ActionResult GrantBudgetsCreate([Bind(Include = "GrantBudgetsTypeID,Amount,Year,Description,GrantID")] GrantBudget grantBudget, string grantId)
        {
            if (ModelState.IsValid)
            {
                grantBudget.GrantBudgetID = Guid.NewGuid();

                grantBudget.DateCreated  = DateTime.Now;
                grantBudget.DateModified = grantBudget.DateCreated;

                grantBudget.UserCreatedID  = Guid.Parse(User.Identity.GetUserId());
                grantBudget.UserModifiedID = grantBudget.UserCreatedID;

                dbGrantBudgets.GrantBudgets.Add(grantBudget);
                dbGrantBudgets.SaveChanges();
                return(RedirectToAction("GrantBudgetsIndex", new { grantId = grantId }));
            }
            PopulateGrantBudgetTypesDropDownList();
            return(View(grantBudget));
        }
Ejemplo n.º 5
0
        public ActionResult GrantBudgetsEdit([Bind(Include = "GrantBudgetID,GrantBudgetsTypeID,Year,Amount,Description,GrantID")] GrantBudgetViewModel grantBudgetViewModel, string grantId)
        {
            if (ModelState.IsValid)
            {
                GrantBudget grantBudget = dbGrantBudgets.GrantBudgets.Find(grantBudgetViewModel.GrantBudgetID);

                grantBudget.GrantBudgetID      = grantBudgetViewModel.GrantBudgetID;
                grantBudget.GrantBudgetsTypeID = grantBudgetViewModel.GrantBudgetsTypeID;
                grantBudget.Year        = grantBudgetViewModel.Year;
                grantBudget.Amount      = grantBudgetViewModel.Amount;
                grantBudget.Description = grantBudgetViewModel.Description;

                grantBudget.DateModified   = DateTime.Now;
                grantBudget.UserModifiedID = Guid.Parse(User.Identity.GetUserId());

                dbGrantBudgets.Entry(grantBudget).State = EntityState.Modified;
                dbGrantBudgets.SaveChanges();
                return(RedirectToAction("GrantBudgetsIndex", new { grantId = grantId }));
            }
            return(View(grantBudgetViewModel));
        }