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)); }
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)); }
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, 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()); }
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)); }
/// <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)); }
// 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)); }
// 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)); }
// 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)); }