public async Task <IActionResult> GetPractitionersList([FromBody] PractitionersRequest practitioners)
        {
            JsonResponse <IEnumerable <PractitionersList> > objResult = new JsonResponse <IEnumerable <PractitionersList> >();

            try
            {
                IEnumerable <PractitionersList> lists;
                lists = await this._superAdminService.GetPractitionersList(practitioners);

                if (lists != null && lists.Count() > 0)
                {
                    objResult.Data    = lists;
                    objResult.Status  = StaticResource.SuccessStatusCode;
                    objResult.Message = StaticResource.SuccessMessage;
                    return(new OkObjectResult(objResult));
                }
                else
                {
                    objResult.Data    = null;
                    objResult.Status  = StaticResource.NotFoundStatusCode;
                    objResult.Message = StaticResource.NotFoundMessage;
                    return(new OkObjectResult(objResult));
                }
            }
            catch (Exception ex)
            {
                HttpContext.RiseError(ex);
                objResult.Data    = null;
                objResult.Status  = StaticResource.FailStatusCode;
                objResult.Message = StaticResource.FailMessage;
            }
            return(new OkObjectResult(objResult));
        }
Esempio n. 2
0
        public async Task <IEnumerable <PractitionersList> > GetPractitionersList(PractitionersRequest practitioners)
        {
            try
            {
                IEnumerable <PractitionersList> companyDetails;
                using (IDbConnection con = new SqlConnection(_connectionString))
                {
                    companyDetails = await con.QueryAsync <PractitionersList>("dbo.SSP_getPractitionersList", new
                    {
                        FirstName = practitioners.FirstName,
                        LastName  = practitioners.LastName,
                        Email     = practitioners.Email,
                        UserName  = practitioners.UserName,
                        Keywords  = practitioners.Keywords,
                        OffSet    = practitioners.OffSet,
                        Limit     = practitioners.Limit,
                    }, commandType : CommandType.StoredProcedure);
                }

                return(companyDetails);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public async Task <IEnumerable <PractitionersList> > GetPractitionersList(PractitionersRequest practitioners)
 {
     try
     {
         return(await this._superAdminRepo.GetPractitionersList(practitioners));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }