public BE_User SetNewPassword(VE_User _VeUser) { _database = new MySQLDatabase(connectionString); int idMail = 2; BE_Mail _BeMail = GetMailInfo(idMail); _VeUser.passwordHash = BE.Security.Encriptar(_VeUser.passwordHash); BE_User _BeUser = new DA_User(_database).setNewPassword(_VeUser); string body = _BeMail.bodyMail; body = body.Replace("@FirstName", _VeUser.firstName); body = body.Replace("@LastName", _VeUser.lastName); if (_BeUser != null) { BL_Mail _BlMail = new BL_Mail(); _BlMail.SendEmail("*****@*****.**", _BeUser.userName, _BeMail.subjectMail, body); return(_BeUser); } else { throw new ApplicationException("Ususario incorrecto o inexistente"); } }
public BE_Json PruebaMail([FromBody] MailContent mailContent) { BE_Json objJson = null; var objListaAux = string.Empty; try { BL_Mail bL_Mail = new BL_Mail(); bL_Mail.connectionString = AppConfig.DbConnection; objListaAux = JsonConvert.SerializeObject(bL_Mail.PruebaMail(mailContent)); objJson = new BE_Json(); objJson.data = objListaAux; objJson.status = CManager.RESULTADO_WCF.OK; } catch (Exception ex) { objJson = new BE_Json(); objJson.data = "Hubo en error en servidor:" + ex.Message + ";" + ex.StackTrace + ";" + ex.ToString(); objJson.status = CManager.RESULTADO_WCF.ERROR; objJson.status = CManager.RESULTADO_WCF.ERROR; } finally { objListaAux = null; } return(objJson); }