Esempio n. 1
0
        public ActionResult ModifyPaymentOrganization([DataSourceRequest] DataSourceRequest request, ConfigPaymentOrganizationModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                var service = new ConfigPaymentOrganizationService();

                var paymentOrganization = DataTransfer.Transfer<Config_Payment_Organization>(
                    model,
                    typeof(ConfigPaymentOrganizationModel));

                service.Modify(paymentOrganization);
            }

            return Json(new[] { model }.ToDataSourceResult(request, ModelState));
        }
Esempio n. 2
0
        public ActionResult AddPaymentOrganization([DataSourceRequest] DataSourceRequest request, ConfigPaymentOrganizationModel model)
        {
            try
            {
                if (model != null)
                {
                    var service = new ConfigPaymentOrganizationService();

                    var paymentOrganization = DataTransfer.Transfer<Config_Payment_Organization>(
                        model,
                        typeof(ConfigPaymentOrganizationModel));

                    model.ID = service.Add(paymentOrganization);
                }

                return Json(new[] { model }.ToDataSourceResult(request, ModelState));
            }
            catch
            {
                return View();
            }
        }
Esempio n. 3
0
        public ActionResult RemovePaymentOrganization(int id, FormCollection collection)
        {
            try
            {
                var service = new ConfigPaymentOrganizationService();

                service.Remove(id);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Esempio n. 4
0
        public ActionResult QueryPaymentOrganization([DataSourceRequest] DataSourceRequest request, int paymentTypeId)
        {
            var service = new ConfigPaymentOrganizationService();

            var list = service.QueryAll();
            if (list != null)
            {
                var modelList = new List<ConfigPaymentOrganizationModel>();

                foreach (var config in list)
                {
                    modelList.Add(
                        DataTransfer.Transfer<ConfigPaymentOrganizationModel>(
                            config,
                            typeof(Config_Payment_Organization)));
                }

                return Json(modelList.ToDataSourceResult(request));
            }

            return this.View();
        }