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