Example #1
0
        public ActionResult Edit(string id, FinancialAidAmt finAid)
        {
            try
            {
                using (FCModels finAidAmtModel = new FCModels())
                {
                    finAidAmtModel.Entry(finAid).State = EntityState.Modified;
                    finAidAmtModel.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #2
0
        public ActionResult Create(FinancialAidAmt finAid)
        {
            try
            {
                using (FCModels finAidAmtModel = new FCModels())
                {
                    finAidAmtModel.FinancialAidAmt.Add(finAid);
                    finAidAmtModel.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #3
0
        public ActionResult Delete(string id, FormCollection collection)
        {
            try
            {
                using (FCModels finAidAmtModel = new FCModels())
                {
                    FinancialAidAmt finAid = finAidAmtModel.FinancialAidAmt.Where(x => x.finAidName == id).FirstOrDefault();
                    finAidAmtModel.FinancialAidAmt.Remove(finAid);
                    finAidAmtModel.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }