public ActionResult createExceptionalAmount(ExceptionalAmount model)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    ExceptionalAmountServices.Insert(CurrentUser.Id, model, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
                return(RedirectToAction("Details", new { id = model.LoanRequest }));
            }

            ViewBag.ExceptionalAmountTypeList = new SelectList(ExceptionalAmountTypeServices.List(db), "Id", "Name");
            ViewBag.LoanRequestList           = new SelectList(LoanRequestServices.List(db), "Request", "Name");
            ViewBag.ModuleName = moduleName;
            ViewBag.Action     = insert;
            ViewBag.Save       = save;
            ViewBag.Back       = back;
            return(View("Details", new { id = model.LoanRequest }));
        }
        public ActionResult Create([Bind(Include = "Id, LoanRequest, SubNumber, Amount, Notes, ExceptionalAmountType")] ExceptionalAmount exceptionalAmount)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    ExceptionalAmountServices.Insert(CurrentUser.Id, exceptionalAmount, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.ExceptionalAmountTypeList = new SelectList(ExceptionalAmountTypeServices.List(db), "Id", "Name");
            ViewBag.LoanRequestList           = new SelectList(LoanRequestServices.List(db), "Request", "Name");
            return(View(exceptionalAmount));
        }