Esempio n. 1
0
        public ActionResult Edit([Bind(Include = "Product, LoanDecision, LoanType, LoanGenerationStatus, LoanStatus")] Loan loan)
        {
            Db db = new Db(DbServices.ConnectionString);

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

            ViewBag.LoanDecisionList         = new SelectList(LoanDecisionServices.List(db), "Id", "CersNumber", loan.LoanDecision);
            ViewBag.LoanGenerationStatusList = new SelectList(LoanGenerationStatusServices.List(db), "Id", "Name", loan.LoanGenerationStatus);
            ViewBag.LoanStatusList           = new SelectList(LoanStatusServices.List(db), "Id", "Name", loan.LoanStatus);
            ViewBag.LoanTypeList             = new SelectList(LoanTypeServices.List(db), "ProductType", "Name", loan.LoanType);
            ViewBag.ProductList = new SelectList(ProductServices.List(db), "Id", "Notes", loan.Product);
            return(View(loan));
        }
        public ActionResult Create()
        {
            Db db = new Db(DbServices.ConnectionString);

            ViewBag.LoanList          = new SelectList(LoanServices.List(db), "Product", "Name");
            ViewBag.LoanDecisionList  = new SelectList(LoanDecisionServices.List(db), "Id", "CersNumber");
            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name");
            return(View());
        }
Esempio n. 3
0
        public ActionResult Create()
        {
            Db db = new Db(DbServices.ConnectionString);

            ViewBag.LoanDecisionList         = new SelectList(LoanDecisionServices.List(db), "Id", "CersNumber");
            ViewBag.LoanGenerationStatusList = new SelectList(LoanGenerationStatusServices.List(db), "Id", "Name");
            ViewBag.LoanStatusList           = new SelectList(LoanStatusServices.List(db), "Id", "Name");
            ViewBag.LoanTypeList             = new SelectList(LoanTypeServices.List(db), "ProductType", "Name");
            ViewBag.ProductList = new SelectList(ProductServices.List(db), "Id", "Notes");
            return(View());
        }
        // GET: OutgoingLoan/Edit/5
        public ActionResult Edit(Nullable <int> loan)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (loan == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OutgoingLoan outgoingLoan = OutgoingLoanServices.Get(loan.Value, db);

            if (outgoingLoan == null)
            {
                return(HttpNotFound());
            }

            ViewBag.LoanList          = new SelectList(LoanServices.List(db), "Product", "Name", outgoingLoan.Loan);
            ViewBag.LoanDecisionList  = new SelectList(LoanDecisionServices.List(db), "Id", "CersNumber", outgoingLoan.LoanDecision);
            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name", outgoingLoan.MainWorkPlace);
            return(View(outgoingLoan));
        }
Esempio n. 5
0
        // GET: Loan/Edit/5
        public ActionResult Edit(Nullable <int> product)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (product == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Loan loan = LoanServices.Get(product.Value, db);

            if (loan == null)
            {
                return(HttpNotFound());
            }

            ViewBag.LoanDecisionList         = new SelectList(LoanDecisionServices.List(db), "Id", "CersNumber", loan.LoanDecision);
            ViewBag.LoanGenerationStatusList = new SelectList(LoanGenerationStatusServices.List(db), "Id", "Name", loan.LoanGenerationStatus);
            ViewBag.LoanStatusList           = new SelectList(LoanStatusServices.List(db), "Id", "Name", loan.LoanStatus);
            ViewBag.LoanTypeList             = new SelectList(LoanTypeServices.List(db), "ProductType", "Name", loan.LoanType);
            ViewBag.ProductList = new SelectList(ProductServices.List(db), "Id", "Notes", loan.Product);
            return(View(loan));
        }