Example #1
0
        public async Task <ActionResult <Result> > GetDashboardData(UserLoginViewModel userViewModel)
        {
            try
            {
                var Result = new Result();
                if (userViewModel.UserType == UserTypeEnum.Citizen)
                {
                    Result = await _CitizenManager.GetDashboardData(userViewModel);

                    return(Result);
                }
                else if (userViewModel.UserType == UserTypeEnum.Shop)
                {
                    Result = await _ShopManager.GetDashboardData(userViewModel);

                    return(Result);
                }
                return(Result);
            }
            catch (Exception ex)
            {
                _exceptionManager.SaveLog(Request.Path, userViewModel, ex, null);
                return(new Result()
                {
                    IsSuccess = false,
                    Errors = new List <string> {
                        Resources.ExceptionMessage
                    }
                });
            }
        }