Esempio n. 1
0
        //
        // GET: /Admin/Opportunities/Create
        public ActionResult Create()
        {
            var grants = _svc.GetAvailableGrants();
            var classifications = _svc.GetClassifications();

            var vm = new OpportunityBindingModel(new Opportunity(), grants, classifications);
            return View(vm);
        }
Esempio n. 2
0
        public ActionResult Create(Opportunity opportunity)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                    _svc.CreateOpportunity(opportunity);

                return RedirectToAction("Index");
            }
            catch
            {
                var grants = _svc.GetAvailableGrants();
                var classifications = _svc.GetClassifications();

                var vm = new OpportunityBindingModel(opportunity, grants, classifications);
                return View(vm);
            }
        }
Esempio n. 3
0
        public ActionResult Edit(Guid id, Opportunity opportunity)
        {
            try
            {
                // TODO: Add update logic here
                if (ModelState.IsValid)
                    _svc.PutOpportunityById(id, opportunity);
                return RedirectToAction("Index");
            }
            catch
            {
                var grants = _svc.GetAvailableGrants();
                var classifications = _svc.GetClassifications();

                var vm = new OpportunityBindingModel(opportunity, grants, classifications);
                return View(vm);
            }
        }
Esempio n. 4
0
        //
        // GET: /Admin/Opportunities/Edit/5
        public ActionResult Edit(Guid id)
        {
            var grants = _svc.GetAvailableGrants();
            var opportunity = _svc.GetOpportunityById(id);
            var classifications = _svc.GetClassifications();

            var vm = new OpportunityBindingModel(opportunity, grants, classifications);
            return View(vm);
        }