コード例 #1
0
        public ActionResult Update(CustomerCustomerDemoItemModel customerCustomerDemoItemModel)
        {
            try
            {
                if (IsUpdate(customerCustomerDemoItemModel.OperationResult))
                {
                    if (IsValid(customerCustomerDemoItemModel.OperationResult, customerCustomerDemoItemModel.CustomerCustomerDemo))
                    {
                        CustomerCustomerDemo customerCustomerDemo = (CustomerCustomerDemo)customerCustomerDemoItemModel.CustomerCustomerDemo.ToData();
                        if (Application.Update(customerCustomerDemoItemModel.OperationResult, customerCustomerDemo))
                        {
                            if (customerCustomerDemoItemModel.IsSave)
                            {
                                return(JsonResultSuccess(customerCustomerDemoItemModel.OperationResult,
                                                         Url.Action("Update", "CustomerCustomerDemo", new { CustomerId = customerCustomerDemo.CustomerId, CustomerTypeId = customerCustomerDemo.CustomerTypeId }, Request.Url.Scheme)));
                            }
                            else
                            {
                                return(JsonResultSuccess(customerCustomerDemoItemModel.OperationResult));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                customerCustomerDemoItemModel.OperationResult.ParseException(exception);
            }

            customerCustomerDemoItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(customerCustomerDemoItemModel.OperationResult));
        }
コード例 #2
0
        public ActionResult Delete(string customerId, string customerTypeId, string masterCustomerTypeId = null, string masterCustomerId = null)
        {
            CustomerCustomerDemoItemModel customerCustomerDemoItemModel = new CustomerCustomerDemoItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                CustomerCustomerDemo = new CustomerCustomerDemoViewModel(),
                ControllerAction     = "Delete",
                MasterCustomerTypeId = masterCustomerTypeId, MasterCustomerId = masterCustomerId
            };

            try
            {
                CustomerCustomerDemoDTO customerCustomerDemoDTO = Application.GetById(customerCustomerDemoItemModel.OperationResult, new object[] { customerId, customerTypeId });
                if (customerCustomerDemoDTO != null)
                {
                    customerCustomerDemoItemModel.CustomerCustomerDemo = new CustomerCustomerDemoViewModel(customerCustomerDemoDTO);
                }
            }
            catch (Exception exception)
            {
                customerCustomerDemoItemModel.OperationResult.ParseException(exception);
            }

            return(PartialView(customerCustomerDemoItemModel));
        }
コード例 #3
0
        public ActionResult Delete(CustomerCustomerDemoItemModel customerCustomerDemoItemModel)
        {
            try
            {
                if (Application.Delete(customerCustomerDemoItemModel.OperationResult, (CustomerCustomerDemoDTO)customerCustomerDemoItemModel.CustomerCustomerDemo.ToDTO()))
                {
                    return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                }
            }
            catch (Exception exception)
            {
                customerCustomerDemoItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(customerCustomerDemoItemModel.OperationResult));
        }
コード例 #4
0
        public ActionResult Create(string masterEntity = null, string masterKey = null)
        {
            CustomerCustomerDemoItemModel customerCustomerDemoItemModel = new CustomerCustomerDemoItemModel(ActivityOperations, "Create", masterEntity, masterKey);

            try
            {
                if (IsCreate(customerCustomerDemoItemModel.OperationResult))
                {
                    return(ZPartialView("CRUD", customerCustomerDemoItemModel));
                }
            }
            catch (Exception exception)
            {
                customerCustomerDemoItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(customerCustomerDemoItemModel.OperationResult));
        }
コード例 #5
0
        public ActionResult Delete(CustomerCustomerDemoItemModel customerCustomerDemoItemModel)
        {
            try
            {
                if (IsDelete(customerCustomerDemoItemModel.OperationResult))
                {
                    if (Application.Delete(customerCustomerDemoItemModel.OperationResult, (CustomerCustomerDemo)customerCustomerDemoItemModel.CustomerCustomerDemo.ToData()))
                    {
                        return(JsonResultSuccess(customerCustomerDemoItemModel.OperationResult));
                    }
                }
            }
            catch (Exception exception)
            {
                customerCustomerDemoItemModel.OperationResult.ParseException(exception);
            }

            customerCustomerDemoItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(customerCustomerDemoItemModel.OperationResult));
        }
コード例 #6
0
        public ActionResult Create(string masterCustomerTypeId = null, string masterCustomerId = null)
        {
            CustomerCustomerDemoItemModel customerCustomerDemoItemModel = new CustomerCustomerDemoItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                CustomerCustomerDemo = new CustomerCustomerDemoViewModel(),
                ControllerAction     = "Create",
                MasterCustomerTypeId = masterCustomerTypeId, MasterCustomerId = masterCustomerId
            };

            try
            {
                IsCreate(customerCustomerDemoItemModel.OperationResult);
            }
            catch (Exception exception)
            {
                customerCustomerDemoItemModel.OperationResult.ParseException(exception);
            }

            return(PartialView(customerCustomerDemoItemModel));
        }
コード例 #7
0
        public ActionResult Delete(string customerId, string customerTypeId, string masterEntity = null, string masterKey = null)
        {
            CustomerCustomerDemoItemModel customerCustomerDemoItemModel = new CustomerCustomerDemoItemModel(ActivityOperations, "Delete", masterEntity, masterKey);

            try
            {
                if (IsDelete(customerCustomerDemoItemModel.OperationResult))
                {
                    CustomerCustomerDemo customerCustomerDemo = Application.GetById(customerCustomerDemoItemModel.OperationResult, new object[] { customerId, customerTypeId });
                    if (customerCustomerDemo != null)
                    {
                        customerCustomerDemoItemModel.CustomerCustomerDemo = new CustomerCustomerDemoViewModel(customerCustomerDemo);

                        return(ZPartialView("CRUD", customerCustomerDemoItemModel));
                    }
                }
            }
            catch (Exception exception)
            {
                customerCustomerDemoItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(customerCustomerDemoItemModel.OperationResult));
        }