Пример #1
0
        public ActionResult Edit([Bind(Include = "Id, Employee, Date, PaymentGroup, Amount, Notes, PaymentStatus, CollectOrder")] Payment payment)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    PaymentServices.Update(CurrentUser.Id, payment, 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.CollectOrderList  = new SelectList(CollectOrderServices.List(db), "Id", "Name", payment.CollectOrder);
            ViewBag.EmployeeList      = new SelectList(EmployeeServices.List(db), "Id", "FirstName", payment.Employee);
            ViewBag.PaymentGroupList  = new SelectList(PaymentGroupServices.List(db), "Id", "Name", payment.PaymentGroup);
            ViewBag.PaymentStatusList = new SelectList(PaymentStatusServices.List(db), "Id", "Name", payment.PaymentStatus);
            return(View(payment));
        }
Пример #2
0
        public ActionResult Create([Bind(Include = "Id, Name, Rate, GuarantorsCount, AccountNumber, PrintLabel, ProfitStrategy, PaymentGroup, IsActive")] ProductType productType)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    ProductTypeServices.Insert(CurrentUser.Id, productType, 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.PaymentGroupList   = new SelectList(PaymentGroupServices.List(db), "Id", "Name");
            ViewBag.ProfitStrategyList = new SelectList(ProfitStrategyServices.List(db), "Id", "Name");
            return(View(productType));
        }
        public ActionResult Create([Bind(Include = "Id, Employee, PaymentGroup, Month, Opening, NormalLoans, IncomingLoans, Restitution, OutgoingLoans, SalaryPayment, CashPayment")] MonthlyBalance monthlyBalance)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    MonthlyBalanceServices.Insert(CurrentUser.Id, monthlyBalance, 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.PaymentGroupList = new SelectList(PaymentGroupServices.List(db), "Id", "Name");
            return(View(monthlyBalance));
        }
Пример #4
0
        public ActionResult Create([Bind(Include = "Id, Employee, Number, Date, VoucherNumber, VoucherDate, PaymentNumber, PaymentDate, AccountingDocumentNumber, AccountingDocumentDate, PaymentGroup, PaidAmount, IsProfit, IsFixed, Notes")] PayOrder payOrder)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    PayOrderServices.Insert(CurrentUser.Id, payOrder, 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.PaymentGroupList = new SelectList(PaymentGroupServices.List(db), "Id", "Name");
            ViewBag.EmployeeList     = new SelectList(EmployeeServices.List(db), "Id", "FirstName");
            return(View(payOrder));
        }
        public ActionResult Create()
        {
            Db db = new Db(DbServices.ConnectionString);

            ViewBag.EmployeeList     = new SelectList(EmployeeServices.List(db), "Id", "FirstName");
            ViewBag.PaymentGroupList = new SelectList(PaymentGroupServices.List(db), "Id", "Name");
            return(View());
        }
Пример #6
0
        public ActionResult Create()
        {
            Db db = new Db(DbServices.ConnectionString);

            ViewBag.PaymentGroupList   = new SelectList(PaymentGroupServices.List(db), "Id", "Name");
            ViewBag.ProfitStrategyList = new SelectList(ProfitStrategyServices.List(db), "Id", "Name");
            return(View());
        }
        /// <summary>
        /// Returns a list of MonthlyBalanceVw objects
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(MonthlyBalanceVwViewModel Model)
        {
            Db db = new Db(DbServices.ConnectionString);

            ViewBag.PaymentGroupList = new SelectList(PaymentGroupServices.List(db), "Id", "Name");
            if (Model.Filter.HasCriteria)
            {
                Model.List = MonthlyBalanceVwServices.Get(Model.Filter, db);
            }
            else
            {
                Model.List = new List <MonthlyBalanceVw>();
            }
            return(View(Model));
        }
Пример #8
0
        // GET: PaymentGroup/Delete/5
        public ActionResult Delete(Nullable <byte> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Db           db           = new Db(DbServices.ConnectionString);
            PaymentGroup paymentGroup = PaymentGroupServices.Get(id.Value, db);

            if (paymentGroup == null)
            {
                return(HttpNotFound());
            }
            return(View(paymentGroup));
        }
Пример #9
0
        /// <summary>
        /// Returns a list of LoanTypeVw objects
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(LoanTypeVwViewModel Model)
        {
            Db db = new Db(DbServices.ConnectionString);

            ViewBag.ProductTypePaymentGroupList   = new SelectList(PaymentGroupServices.List(db), "Id", "Name");
            ViewBag.ProductTypeProfitStrategyList = new SelectList(ProfitStrategyServices.List(db), "Id", "Name");

            if (Model.Filter.HasCriteria)
            {
                Model.List = LoanTypeVwServices.Get(Model.Filter, db);
            }
            else
            {
                Model.List = new List <LoanTypeVw>();
            }
            return(View(Model));
        }
Пример #10
0
        // GET: MonthlyBalance/Edit/5
        public ActionResult Edit(Nullable <int> id)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MonthlyBalance monthlyBalance = MonthlyBalanceServices.Get(id.Value, db);

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

            ViewBag.EmployeeList     = new SelectList(EmployeeServices.List(db), "Id", "FirstName", monthlyBalance.Employee);
            ViewBag.PaymentGroupList = new SelectList(PaymentGroupServices.List(db), "Id", "Name", monthlyBalance.PaymentGroup);
            return(View(monthlyBalance));
        }
Пример #11
0
        // GET: ProductType/Edit/5
        public ActionResult Edit(Nullable <short> id)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProductType productType = ProductTypeServices.Get(id.Value, db);

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

            ViewBag.PaymentGroupList   = new SelectList(PaymentGroupServices.List(db), "Id", "Name", productType.PaymentGroup);
            ViewBag.ProfitStrategyList = new SelectList(ProfitStrategyServices.List(db), "Id", "Name", productType.ProfitStrategy);
            return(View(productType));
        }
Пример #12
0
 public ActionResult DeleteConfirmed(byte id)
 {
     try
     {
         Db db = new Db(DbServices.ConnectionString);
         PaymentGroupServices.Delete(CurrentUser.Id, id, db);
         TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "DeleteConfirmed");
         // return RedirectToAction("Index");
     }
     catch (CfException cfex)
     {
         TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
     }
     catch (Exception ex)
     {
         TempData["Failure"] = ex.Message;
     }
     // return View(paymentGroup);
     return(RedirectToAction("Index"));
 }
Пример #13
0
        // GET: Payment/Edit/5
        public ActionResult Edit(Nullable <int> id)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Payment payment = PaymentServices.Get(id.Value, db);

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

            ViewBag.CollectOrderList  = new SelectList(CollectOrderServices.List(db), "Id", "Name", payment.CollectOrder);
            ViewBag.EmployeeList      = new SelectList(EmployeeServices.List(db), "Id", "FirstName", payment.Employee);
            ViewBag.PaymentGroupList  = new SelectList(PaymentGroupServices.List(db), "Id", "Name", payment.PaymentGroup);
            ViewBag.PaymentStatusList = new SelectList(PaymentStatusServices.List(db), "Id", "Name", payment.PaymentStatus);
            return(View(payment));
        }
Пример #14
0
        public ActionResult Create([Bind(Include = "Id, Name")] PaymentGroup paymentGroup)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    PaymentGroupServices.Insert(CurrentUser.Id, paymentGroup, 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;
                }
            }

            return(View(paymentGroup));
        }