Exemplo n.º 1
0
        public ActionResult Delete(int?customerId, int?masterSupportRepId = null)
        {
            CustomerItemModel customerItemModel = new CustomerItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Customer             = new CustomerViewModel(),
                ControllerAction     = "Delete",
                MasterSupportRepId   = masterSupportRepId
            };

            try
            {
                CustomerDTO customerDTO = Application.GetById(customerItemModel.OperationResult, new object[] { customerId });
                if (customerDTO != null)
                {
                    customerItemModel.Customer = new CustomerViewModel(customerDTO);
                }
            }
            catch (Exception exception)
            {
                customerItemModel.OperationResult.ParseException(exception);
            }

            return(PartialView(customerItemModel));
        }
Exemplo n.º 2
0
        public ActionResult Delete(CustomerItemModel customerItemModel)
        {
            try
            {
                if (Application.Delete(customerItemModel.OperationResult, (CustomerDTO)customerItemModel.Customer.ToDTO()))
                {
                    return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                }
            }
            catch (Exception exception)
            {
                customerItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(customerItemModel.OperationResult));
        }
Exemplo n.º 3
0
        public ActionResult Delete(CustomerItemModel customerItemModel)
        {
            try
            {
                if (Application.Delete(customerItemModel.OperationResult, (CustomerDTO)customerItemModel.Customer.ToDTO()))
                {
                    return(RedirectToUrlDictionary());
                }
            }
            catch (Exception exception)
            {
                customerItemModel.OperationResult.ParseException(exception);
            }

            customerItemModel.IsSecurityOperations = IsSecurityOperations;

            return(View(customerItemModel));
        }
Exemplo n.º 4
0
        public ActionResult Create(CustomerItemModel customerItemModel)
        {
            try
            {
                if (ValidateModelState(Application.Repository))
                {
                    if (Application.Create(customerItemModel.OperationResult, (CustomerDTO)customerItemModel.Customer.ToDTO()))
                    {
                        return(JsonResultSuccess(new { uri = ReadUrlDictionary() }));
                    }
                }
            }
            catch (Exception exception)
            {
                customerItemModel.OperationResult.ParseException(exception);
            }

            return(JsonResultOperationResult(customerItemModel.OperationResult));
        }
Exemplo n.º 5
0
        public ActionResult Create(int?masterSupportRepId = null)
        {
            CustomerItemModel customerItemModel = new CustomerItemModel()
            {
                IsSecurityOperations = this.IsSecurityOperations,
                Customer             = new CustomerViewModel(),
                ControllerAction     = "Create",
                MasterSupportRepId   = masterSupportRepId
            };

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

            return(PartialView(customerItemModel));
        }