Ejemplo n.º 1
0
        public ActionResult Details(string id)
        {
            CustomerLevelDetailView customerLevelDetailView = new CustomerLevelDetailView();

            #region Access Check
            bool hasPermission = GetEmployee().IsGuaranteed("CustomerLevel_Read");
            if (!hasPermission)
            {
                ModelState.AddModelError("", "AccessDenied");
                return(View(customerLevelDetailView));
            }
            #endregion


            CustomerLevelView customerLevelView = this.GetCustomerLevelView(id);

            customerLevelDetailView.CustomerLevelView = customerLevelView;

            return(View(customerLevelDetailView));
        }
Ejemplo n.º 2
0
        public GetCustomerLevelResponse GetCustomerLevel(GetRequest request)
        {
            GetCustomerLevelResponse response = new GetCustomerLevelResponse();

            try
            {
                CustomerLevel     customerLevel     = new CustomerLevel();
                CustomerLevelView customerLevelView = customerLevel.ConvertToCustomerLevelView();

                customerLevel = _customerLevelRepository.FindBy(request.ID);
                if (customerLevel != null)
                {
                    customerLevelView = customerLevel.ConvertToCustomerLevelView();
                }

                response.CustomerLevelView = customerLevelView;
            }
            catch (Exception ex)
            {
            }

            return(response);
        }