public ActionResult Create([Bind(Include = "Id, Name, MainWorkPlace")] SalaryWorkPlace salaryWorkPlace)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    SalaryWorkPlaceServices.Insert(CurrentUser.Id, salaryWorkPlace, 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.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name");
            return(View(salaryWorkPlace));
        }
Пример #2
0
        public ActionResult Edit([Bind(Include = "Loan, MainWorkPlace")] IncomingLoan incomingLoan)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    IncomingLoanServices.Update(CurrentUser.Id, incomingLoan, 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.LoanList          = new SelectList(LoanServices.List(db), "Product", "Name", incomingLoan.Loan);
            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name", incomingLoan.MainWorkPlace);
            return(View(incomingLoan));
        }
        public ActionResult Create()
        {
            Db db = new Db(DbServices.ConnectionString);

            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name");
            return(View());
        }
Пример #4
0
        public ActionResult Create([Bind(Include = "Loan, LoanDecision, MainWorkPlace, ApprovedAmount, NetAmount, ProfitAmount")] OutgoingLoan outgoingLoan)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    OutgoingLoanServices.Insert(CurrentUser.Id, outgoingLoan, 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.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(outgoingLoan));
        }
Пример #5
0
        public ActionResult Create([Bind(Include = "Employee, MainWorkPlace, ApprovedAmount, Installment, Notes, IsVerified")] TransitoryIncomingLoan transitoryIncomingLoan)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    TransitoryIncomingLoanServices.Insert(CurrentUser.Id, transitoryIncomingLoan, 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.EmployeeList      = new SelectList(EmployeeServices.List(db), "Id", "FirstName");
            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name");
            return(View(transitoryIncomingLoan));
        }
Пример #6
0
        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());
        }
        /// <summary>
        /// Returns a list of SalaryWorkPlaceVw objects
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(SalaryWorkPlaceVwViewModel Model)
        {
            Db db = new Db(DbServices.ConnectionString);

            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name");
            if (Model.Filter.HasCriteria)
            {
                Model.List = SalaryWorkPlaceVwServices.Get(Model.Filter, db);
            }
            else
            {
                Model.List = new List <SalaryWorkPlaceVw>();
            }
            return(View(Model));
        }
        // GET: SalaryWorkPlace/Edit/5
        public ActionResult Edit(Nullable <int> id)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SalaryWorkPlace salaryWorkPlace = SalaryWorkPlaceServices.Get(id.Value, db);

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

            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name", salaryWorkPlace.MainWorkPlace);
            return(View(salaryWorkPlace));
        }
Пример #9
0
        // GET: IncomingLoan/Edit/5
        public ActionResult Edit(Nullable <int> loan)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (loan == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IncomingLoan incomingLoan = IncomingLoanServices.Get(loan.Value, db);

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

            ViewBag.LoanList          = new SelectList(LoanServices.List(db), "Product", "Name", incomingLoan.Loan);
            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name", incomingLoan.MainWorkPlace);
            return(View(incomingLoan));
        }
Пример #10
0
        // GET: TransitoryIncomingLoan/Edit/5
        public ActionResult Edit(Nullable <int> employee)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (employee == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TransitoryIncomingLoan transitoryIncomingLoan = TransitoryIncomingLoanServices.Get(employee.Value, db);

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

            ViewBag.EmployeeList      = new SelectList(EmployeeServices.List(db), "Id", "FirstName", transitoryIncomingLoan.Employee);
            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name", transitoryIncomingLoan.MainWorkPlace);
            return(View(transitoryIncomingLoan));
        }