// GET: GuarantorStatement/Delete/5
        public ActionResult Delete(Nullable <int> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Db db = new Db(DbServices.ConnectionString);
            GuarantorStatement guarantorStatement = GuarantorStatementServices.Get(id.Value, db);

            if (guarantorStatement == null)
            {
                return(HttpNotFound());
            }
            return(View(guarantorStatement));
        }
        // GET: GuarantorStatement/Edit/5
        public ActionResult Edit(Nullable <int> guarantor)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (guarantor == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GuarantorStatement guarantorStatement = GuarantorStatementServices.Get(guarantor.Value, db);

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

            ViewBag.GuarantorList = new SelectList(GuarantorServices.List(db), "Id", "Notes", guarantorStatement.Guarantor);
            return(View(guarantorStatement));
        }
        public ActionResult EditGuarantorWithStatement(int?id)
        {
            ViewBag.ModuleName = moduleName;
            ViewBag.Action     = update;
            ViewBag.Update     = update;
            ViewBag.Save       = save;
            ViewBag.Back       = back;
            Db db = new Db(DbServices.ConnectionString);

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Guarantor guarantor = GuarantorServices.Get(id.Value, db);

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


            GuarantorStatement guarantorStatement = GuarantorStatementServices.Get(guarantor.Id, db);

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


            ViewBag.EmployeeList        = new SelectList(EmployeeServices.List(db), "Id", "Id_Name", guarantor.Employee);
            ViewBag.GuarantorStatusList = new SelectList(GuarantorStatusServices.List(db), "Id", "Name", guarantor.GuarantorStatus);
            ViewBag.ProductId           = guarantor.RefundableProduct;
            GuarantorWithStatmentViewModel vm = new GuarantorWithStatmentViewModel();

            vm.Guarantor          = guarantor;
            vm.GuarantorStatement = guarantorStatement;


            return(PartialView(vm));
        }