public DTO.ApplicationStore GetApplicationStoreByStore(Guid storeCode, string nameApplication) { DTO.ApplicationStore result = null; var listAppStore = applicationStoreRepository.GetByStore(storeCode); if (!listAppStore.IsNull()) { var appStore = listAppStore.FirstOrDefault(x => x.Application.Name.ToLower() == nameApplication); if (!appStore.IsNull()) { result = new DTO.ApplicationStore(appStore, false); } } return(result); }
public IHttpActionResult SendPasswordEmail(DTO.AccountInput input) { try { DTO.ApplicationStore appStore = null; Guid?confId = null; if (base.IsMainAdmin) { appStore = appStoreApp.GetApplicationStoreByStoreTypeMain("Hagrid-UI-Login"); if (!appStore.IsNull()) { confId = appStore.ConfidentialClient; } } else { confId = base.ClientId; } if (!confId.HasValue) { throw new ArgumentException("Aplicação não encontrada"); } resetPasswordTokenApp.GenerateResetPasswordToken(input.Email, confId.Value); return(Ok()); } catch (LockedUpMemberException ex) { return(BadRequest(new ArgumentException(ex.Message))); } catch (ArgumentException ex) { return(BadRequest(ex)); } catch (Exception ex) { return(InternalServerError(ex)); } }
public DTO.ApplicationStore GetApplicationStoreByStoreTypeMain(string nameApplication) { DTO.ApplicationStore result = null; var apps = applicationRepository.List().FirstOrDefault(x => x.Name.ToLower() == nameApplication.ToLower()); if (apps != null) { var listAppStore = applicationStoreRepository.GetByStoreTypeMain(apps.Code.Value); if (!listAppStore.IsNull()) { var appStore = listAppStore.FirstOrDefault(x => x.Application.Name.ToLower() == nameApplication); if (!appStore.IsNull()) { return(new DTO.ApplicationStore(appStore, false)); } } } return(result); }