Пример #1
0
        public IActionResult GetAll()
        {
            var result = _paymentManager.GetAll();

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public IActionResult Get()
        {
            var result = _iPaymentManager.GetAll();

            if (result == null)
            {
                return(BadRequest(new { error = "Data Can not Found!!" }));
            }

            return(Ok(result));
        }
Пример #3
0
        public List <ApiPaymentModel> GetList()
        {
            //List<ApiPaymentModel> paymentList = new List<ApiPaymentModel>();
            //ApiPaymentModel payment1 = new ApiPaymentModel
            //{
            //    ID = 1,
            //    Amount = 5000,
            //    Date_and_time = new DateTime (2017, 05, 25)
            //};
            //paymentList.Add(payment1);

            //ApiPaymentModel payment2 = new ApiPaymentModel
            //{
            //    ID = 2,
            //    Amount = 2000,
            //    Date_and_time = new DateTime(2017, 05, 28)
            //};
            //paymentList.Add(payment2);
            return(_paymentManager.GetAll <ApiPaymentModel>());
        }
Пример #4
0
        public IActionResult Details(Guid employeeId)
        {
            if (StaticCache.User == null)
            {
                AddNotification(NotificationViewModel.GetWarning("Page Not Accessable", $"Login to access page"));
                return(RedirectToAction("Index", "Home"));
            }

            var emp = _employeeManager.Get(employeeId);

            var paymentHistory = _paymentManager.GetAll(employeeId);

            var model = new DetailsViewModel
            {
                Employee   = emp.Data,
                Payments   = paymentHistory,
                EmployeeId = emp.Data.Id
            };

            return(View(model));
        }