public ActionResult Update(CustomerDemographicItemModel customerDemographicItemModel)
        {
            try
            {
                if (IsUpdate(customerDemographicItemModel.OperationResult))
                {
                    if (IsValid(customerDemographicItemModel.OperationResult, customerDemographicItemModel.CustomerDemographic))
                    {
                        CustomerDemographic customerDemographic = (CustomerDemographic)customerDemographicItemModel.CustomerDemographic.ToData();
                        if (Application.Update(customerDemographicItemModel.OperationResult, customerDemographic))
                        {
                            if (customerDemographicItemModel.IsSave)
                            {
                                return(JsonResultSuccess(customerDemographicItemModel.OperationResult,
                                                         Url.Action("Update", "CustomerDemographic", new { CustomerTypeId = customerDemographic.CustomerTypeId }, Request.Url.Scheme)));
                            }
                            else
                            {
                                return(JsonResultSuccess(customerDemographicItemModel.OperationResult));
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                customerDemographicItemModel.OperationResult.ParseException(exception);
            }

            customerDemographicItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(customerDemographicItemModel.OperationResult));
        }
Пример #2
0
        public ActionResult Delete(CustomerDemographicItemModel customerDemographicItemModel)
        {
            try
            {
                if (Application.Delete(customerDemographicItemModel.OperationResult, (CustomerDemographicDTO)customerDemographicItemModel.CustomerDemographic.ToDTO()))
                {
                    return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                }
            }
            catch (Exception exception)
            {
                customerDemographicItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(customerDemographicItemModel.OperationResult));
        }
        public ActionResult Create(string masterEntity = null, string masterKey = null)
        {
            CustomerDemographicItemModel customerDemographicItemModel = new CustomerDemographicItemModel(ActivityOperations, "Create", masterEntity, masterKey);

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

            return(JsonResultOperationResult(customerDemographicItemModel.OperationResult));
        }
Пример #4
0
        public ActionResult Create()
        {
            CustomerDemographicItemModel customerDemographicItemModel = new CustomerDemographicItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                CustomerDemographic  = new CustomerDemographicViewModel(),
                ControllerAction     = "Create"
            };

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

            return(PartialView(customerDemographicItemModel));
        }
        public ActionResult Delete(CustomerDemographicItemModel customerDemographicItemModel)
        {
            try
            {
                if (IsDelete(customerDemographicItemModel.OperationResult))
                {
                    if (Application.Delete(customerDemographicItemModel.OperationResult, (CustomerDemographic)customerDemographicItemModel.CustomerDemographic.ToData()))
                    {
                        return(JsonResultSuccess(customerDemographicItemModel.OperationResult));
                    }
                }
            }
            catch (Exception exception)
            {
                customerDemographicItemModel.OperationResult.ParseException(exception);
            }

            customerDemographicItemModel.ActivityOperations = ActivityOperations;

            return(JsonResultOperationResult(customerDemographicItemModel.OperationResult));
        }
Пример #6
0
        public ActionResult Delete(string customerTypeId)
        {
            CustomerDemographicItemModel customerDemographicItemModel = new CustomerDemographicItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                CustomerDemographic  = new CustomerDemographicViewModel(),
                ControllerAction     = "Delete"
            };

            try
            {
                CustomerDemographicDTO customerDemographicDTO = Application.GetById(customerDemographicItemModel.OperationResult, new object[] { customerTypeId });
                if (customerDemographicDTO != null)
                {
                    customerDemographicItemModel.CustomerDemographic = new CustomerDemographicViewModel(customerDemographicDTO);
                }
            }
            catch (Exception exception)
            {
                customerDemographicItemModel.OperationResult.ParseException(exception);
            }

            return(PartialView(customerDemographicItemModel));
        }
        public ActionResult Delete(string customerTypeId, string masterEntity = null, string masterKey = null)
        {
            CustomerDemographicItemModel customerDemographicItemModel = new CustomerDemographicItemModel(ActivityOperations, "Delete", masterEntity, masterKey);

            try
            {
                if (IsDelete(customerDemographicItemModel.OperationResult))
                {
                    CustomerDemographic customerDemographic = Application.GetById(customerDemographicItemModel.OperationResult, new object[] { customerTypeId });
                    if (customerDemographic != null)
                    {
                        customerDemographicItemModel.CustomerDemographic = new CustomerDemographicViewModel(customerDemographic);

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

            return(JsonResultOperationResult(customerDemographicItemModel.OperationResult));
        }