private void SendEmail(string Password, string User) { MParameter parameterBE = new MParameter(); List <MParameter> parameterBEs = new List <MParameter>(); int Val = 0; parameterBE.Code = "MAIL_PASSUSER"; parameterBEs = BParameter.List(parameterBE, ref Val); _MAwsEmail.Subject = "UNITLIFE - User generation"; _MAwsEmail.Message = parameterBEs[0].Valor1.Replace("[Password]", UEncrypt.Decrypt(Password)); _MAwsEmail.ToEmail = User; BAwsSDK.SendEmailAsync(_MAwsEmail); }
private void SendSESValidate(string Email) { int val = 0; MParameter parameterBE = new MParameter(); List <MParameter> parameterBEs = new List <MParameter>(); parameterBE.Code = "MAIL_VALIDATE"; parameterBEs = BParameter.List(parameterBE, ref val); if (val.Equals(0)) { _MAwsEmail.Subject = "UNITLIFE - Registration"; _MAwsEmail.Message = parameterBEs[0].Valor1; _MAwsEmail.ToEmail = Email; BAwsSDK.SendEmailAsync(_MAwsEmail); } }
private void SendSES(string Password, string Email) { int val = 0; MParameter parameterBE = new MParameter(); List <MParameter> parameterBEs = new List <MParameter>(); parameterBE.Code = "MAIL_PASS"; parameterBEs = BParameter.List(parameterBE, ref val); if (val.Equals(0)) { _MAwsEmail.Subject = "UNITLIFE - User generation"; _MAwsEmail.Message = parameterBEs[0].Valor1.Replace("[Password]", UEncrypt.Decrypt(Password)); _MAwsEmail.ToEmail = Email; BAwsSDK.SendEmailAsync(_MAwsEmail); } }
public CreateDonorResponse UpdateDonor([FromBody] DonorRequest request) { CreateDonorResponse response = new CreateDonorResponse(); MDonor donor = new MDonor(); BaseRequest baseRequest = new BaseRequest(); try { /*METODO QUE VALIDA EL TOKEN DE APLICACIÓN*/ if (!BAplication.ValidateAplicationToken(request.ApplicationToken)) { response.Code = "2"; response.Message = Messages.ApplicationTokenNoAutorize; return(response); } /*************FIN DEL METODO*************/ string webRoot = _env.ContentRootPath; string rootPath = _appSettings.Value.rootPath; string DonorPath = _appSettings.Value.DonorPath; donor.DonorId = request.Donor.DonorId; donor.Cellphone = request.Donor.Cellphone; donor.Email = request.Donor.Email; donor.CountryId = request.Donor.CountryId; donor.FirstName = request.Donor.FirstName; donor.LastName = request.Donor.LastName; donor.Gender = request.Donor.Gender; donor.Birthday = request.Donor.Birthday; donor.Address = request.Donor.Address; donor.Photo = DonorPath + "/" + request.Donor.Photo.Replace(Constant.S3Server, string.Empty).Replace(DonorPath + "/", string.Empty); donor.Status = 1; baseRequest.Session = request.Session; byte[] FileByte = request.FileByte ?? Encoding.ASCII.GetBytes(""); if (BSession.ValidateSession(1, baseRequest.Session.Token, baseRequest.Session.UserId).Equals(1)) { if (!FileByte.Length.Equals(0)) { try { donor.Photo = donor.DonorId.ToString() + request.PhotoExtension; //Grabamos el archivo Uri webRootUri = new Uri(webRoot); string path = webRootUri.AbsolutePath + rootPath + DonorPath; var pathSave = Path.Combine(path, donor.Photo); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } if (System.IO.File.Exists(pathSave)) { System.IO.File.Delete(pathSave); } System.IO.File.WriteAllBytes(pathSave, FileByte); if (!BAwsSDK.UploadS3(_MAwsS3, pathSave, DonorPath, donor.Photo)) { response.Message = String.Format(Messages.ErrorLoadPhoto, "Donor"); } System.IO.File.Delete(pathSave); donor.Photo = DonorPath + "/" + donor.Photo; } catch (Exception ex) { response.Message = String.Format(Messages.ErrorUpdate, "Banner") + ex.Message; response.Donor = donor; return(response); } } int CodeResult = BDonor.Update(donor); response.Code = CodeResult.ToString(); //0=> Ëxito | 1=> Validación de Sistema | 2 => Error de Excepción if (CodeResult == 0) { response.Message = Messages.Success; } else { response.Message = String.Format(Messages.ErrorUpdate, "Banner"); } } else { response.Code = "1"; //0=> Ëxito | 1=> Validación de Sistema | 2 => Error de Excepción response.Message = Messages.ApplicationTokenNoAutorize; } } catch (Exception ex) { response.Code = "2"; response.Message = ex.Message; } response.Donor = donor; response.Donor.Token = request.Session.Token; return(response); }