private void FormPaymentView_Load(object sender, EventArgs e) { if (dataSource == null) { DateTime dt = DateTime.Now; DataSource = PaymentVwServices.List(new Db(DbServices.ConnectionString)); slblEllapsedTimeValue.Text = (DateTime.Now.Subtract(dt).TotalMilliseconds / 1000).ToString(); } }
/// <summary> /// Returns a list of PaymentVw objects /// </summary> /// <returns></returns> public ActionResult Index(PaymentVwViewModel Model) { Db db = new Db(DbServices.ConnectionString); ViewBag.PaymentStatusList = new SelectList(PaymentStatusServices.List(db), "Id", "Name"); if (Model.Filter.HasCriteria) { Model.List = PaymentVwServices.Get(Model.Filter, db); } else { Model.List = new List <PaymentVw>(); } return(View(Model)); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Details(Nullable <int> id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PaymentVwViewModel paymentVwViewModel = new PaymentVwViewModel(); Db db = new Db(DbServices.ConnectionString); // paymentVwViewModel.Instance = PaymentVwServices.Get(id.Value, db); paymentVwViewModel.Instance = PaymentVwServices.GetChildren(id.Value, db); if (paymentVwViewModel.Instance == null) { return(HttpNotFound()); } @ViewBag.CashPaymentVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "CashPayment", "ModuleName"); if (paymentVwViewModel.Instance.CashPaymentVw != null) { paymentVwViewModel.CashPaymentVwViewModel.List.Add(paymentVwViewModel.Instance.CashPaymentVw); } // paymentVwViewModel.CashPaymentVwViewModel.Instance = paymentVwViewModel.Instance.CashPaymentVw; @ViewBag.DownPaymentVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "DownPayment", "ModuleName"); if (paymentVwViewModel.Instance.DownPaymentVw != null) { paymentVwViewModel.DownPaymentVwViewModel.List.Add(paymentVwViewModel.Instance.DownPaymentVw); } // paymentVwViewModel.DownPaymentVwViewModel.Instance = paymentVwViewModel.Instance.DownPaymentVw; @ViewBag.SalaryPaymentVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "SalaryPayment", "ModuleName"); if (paymentVwViewModel.Instance.SalaryPaymentVw != null) { paymentVwViewModel.SalaryPaymentVwViewModel.List.Add(paymentVwViewModel.Instance.SalaryPaymentVw); } // paymentVwViewModel.SalaryPaymentVwViewModel.Instance = paymentVwViewModel.Instance.SalaryPaymentVw; @ViewBag.SettlementVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "Settlement", "ModuleNamePlural"); // paymentVwViewModel.SettlementVwViewModel.List = SettlementVwServices.GetByPaymentId(id.Value, db); paymentVwViewModel.SettlementVwViewModel.List = paymentVwViewModel.Instance.SettlementVwList; return(View(paymentVwViewModel)); }