示例#1
0
        public IActionResult AddOrderItem(int orderId)
        {
            _logger.LogInfo($"Zapytanie do metody AddOrderItem(orderId)", new { orderId });

            var result = _selectService.GetMedicineSelectList();

            if (!result.IsSuccess)
            {
                return(RedirectToDetails(orderId, result.FailureMessage));
            }

            var model = new AddOrderItemViewModel
            {
                OrderId      = orderId,
                MedicineList = result.Value
            };

            return(View(model));
        }
示例#2
0
        private IActionResult AddSelectListToModelWithRedirectToDetails(AddPrescriptionItemViewModel model)
        {
            var medicine = _selectService.GetMedicineSelectList();

            if (!medicine.IsSuccess)
            {
                return(RedirectToPrescriptionDetails(model.Id, medicine.FailureMessage));
            }

            model.MedicineList = medicine.Value;

            return(null);
        }