public static void SendPowerOfAttorney(string CardHolderName, string Amount, string LastFourDigits, string Parameter) { string id = Classes.encryption.Decrypt(Parameter); ClientModel client = new ClientModel(); using (NpgsqlConnection conn = Classes.DB.InstBTCDB("instbtc")) { client = Utilities.Clients.FindById(conn, Convert.ToInt32(id)); } PowerOfAttorneyModel powerOfAttorneyModel = new PowerOfAttorneyModel() { NameOfCardHolder = CardHolderName, NameOfClient = client.First_name + " " + client.Last_name, Amount = Amount, Date = DateTime.UtcNow, LastFourDigits = LastFourDigits }; Website.Models.Accounts.Account accounts = new Website.Models.Accounts.Account() { FirstName = client.First_name, LastName = client.Last_name }; PowerOfAttorneyGeneratedForm powerOfAttorneyGeneratedForm = new PowerOfAttorneyGeneratedForm(); MemoryStream memoryStream = new MemoryStream(); memoryStream = powerOfAttorneyGeneratedForm.CreatePackage(powerOfAttorneyModel); var bytes = memoryStream.ToArray(); MessagingUtilities.SendEmailWithAttachment(client.Email, EmailTemplateUtilities.SendPowerOfAttorneyTemplate(accounts), "Power of Attorney", bytes); }
public static AjaxResponse ChangeTransactionStatus(int tid, string selectedStatus, string cid) { using (NpgsqlConnection conn = Classes.DB.InstBTCDB("instbtc")) { bool updateResult = Transactions.UpdatePspStatus(conn, tid, selectedStatus); AjaxResponse res = new AjaxResponse() { Success = updateResult, Transaction_id = tid }; if (res.Success && selectedStatus == "Approved") { //Get Transaction Informations Transactions transaction = new Transactions(); transaction = Transactions.GetTransaction(conn, tid.ToString()); //Get Client Informations ClientModel clients = new ClientModel(); clients = Clients.FindById(conn, Convert.ToInt32(cid)); //Send Email To Client var message = EmailTemplateUtilities.GetDepositTemplate(transaction); EmailTemplateUtilities.SendEmail(clients.Email, message, "Get-Bitcoin Successful Deposit"); } return(res); } }
protected void _btnEmailTest_Click(object sender, EventArgs e) { var db = new UrbanDataContext(); User user = db.Manager.User.GetByKey(1); var keys = new List <KeyValuePair <string, string> >(); keys.Add(new KeyValuePair <string, string>("{!MainTitleHtml}", "Account Created")); keys.Add(new KeyValuePair <string, string>("{!Subtitle01Html}", "Action Required")); keys.Add(new KeyValuePair <string, string>("{!Subtitle01TextHtml}", "Congratulations on creating your account activation is still required. Please follow the links bellow.")); keys.Add(new KeyValuePair <string, string>("{!LinkHtml}", "http://UrbanScheduler.com")); keys.Add(new KeyValuePair <string, string>("{!LinkTextHtml}", "Click Here To Activate Account")); keys.Add(new KeyValuePair <string, string>("{!FormPerson}", "UrbanScheduler System")); EmailTemplateUtilities.EmailFromFromMaster(keys, "Test email", user, new List <int>()); //EmailUti1lities.SendEmail("Test Email", "Test Email", "Test Email", "Nate Email", "*****@*****.**", new List<int>()); }
protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["id"]; string client_id = Request.QueryString["client_id"]; if (id != null && id != "") { docid = Classes.encryption.Encryption(id); using (NpgsqlConnection conn = Classes.DB.InstBTCDB("instbtc")) { //Get Document Informations DocumentModel document = new DocumentModel(); document = Documents.GetDocument(conn, id); Decimal clientId = document.ClientId; aws_file = !string.IsNullOrEmpty(document.aws_file) ? document.aws_file : "#"; string base64image = document.Base64Doc; //Get Client Informations ClientModel clients = new ClientModel(); clients = Clients.GetClientsByDocId(conn, id); //Print Base 64 Image on Front imageContainer.InnerHtml = "<img id='imageEncoded' style='display:block; width:auto; height:500px; margin-left: auto; margin-bottom: 10px; box-shadow: 0px 0px 11px 1px #888888; cursor: pointer; margin-right: auto;' src='data:image/jpeg;base64," + base64image + "' onclick='openNewTab();'/>"; clientbtn.InnerHtml = "<a id='btnDocs' type='button' class='btn btn-info margin-bottom-10 margin-top-20 btn-sm' href='/client-detail.aspx?id=" + clientId + "'>Client Information</a>"; if (Request.HttpMethod == "POST") { string status = Request.Form["selectedStatus"]; string expiryDate = Request.Form["expiryDate"]; string cardLast4 = Request.Form["cardLast4"]; updateDocument(conn, id, status, expiryDate, cardLast4); //Send GetDocumentDeclinedTemplate on Email if Rejected if (status == "Rejected") { var message = EmailTemplateUtilities.GetDocumentDeclinedTemplate(clients, status); EmailTemplateUtilities.SendEmail(clients.Email, message, "Get-Bitcoin Documents Declined"); } //Send Email on Client If the Required Documents are all approved List <DocumentModel> ListOfDocuments = new List <DocumentModel>(); ListOfDocuments = Documents.VerifiedDocument(conn, document.ClientId.ToString()); bool verified = Documents.CheckVerifiedDocumentsNoCard(ListOfDocuments); if (verified) { if (document.Type == "Credit Card") { bool cardVerified = Documents.CheckVerifiedCard(ListOfDocuments); if (cardVerified) { //Send Email To Client var message = EmailTemplateUtilities.GetApproveStatusTemplate(clients, status); EmailTemplateUtilities.SendEmail(clients.Email, message, "Get-Bitcoin Documents Approved"); } } else { //Send Email To Client var message = EmailTemplateUtilities.GetApproveStatusTemplate(clients, status); EmailTemplateUtilities.SendEmail(clients.Email, message, "Get-Bitcoin Documents Approved"); } } currStatus.InnerText = document.Status.ToUpper(); currType.InnerText = document.Type.ToUpper(); currSubtype.InnerText = document.SubType.ToUpper(); } else { currStatus.InnerText = document.Status.ToUpper(); currType.InnerText = document.Type.ToUpper(); currSubtype.InnerText = document.SubType.ToUpper(); } } } else { Response.Redirect("/document-lists.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { string username = Classes.Cookie.GetCookie("ggZurkVKwLIM+SQ2NMcfsra8/nnrhm9u5sl4TMYTE2Y", false); var roles = Utilities.AccountUtilities.getUserRoles(username); RoleUtilities roleUtilities = new RoleUtilities(); List <RolesModel> rolesModels = new List <RolesModel>(); List <string> roleLists = roles.Split(',').ToList(); if (roleLists.Find(f => f.ToLower() == "12") == null) { Response.Redirect("/dashboard.aspx"); } if (Request.HttpMethod == "POST") { #region Assign Post Variables string ClientId = Request.Form["clientId"]; string PaymentReferrence = Request.Form["pspRef"]; string PaymentStatus = Request.Form["pspStatus"]; string CreditedStatus = Request.Form["creditedStatus"]; string PspId = Request.Form["ctl00$ctl00$MainContent$LMainContent$pspId"]; string Amount = Request.Form["amount"]; string Currency = Request.Form["currency"]; string Note = Request.Form["note"]; string CardLast4 = Request.Form["cardLast4"]; string CardExpiry = Request.Form["cardExpiry"]; string CardHolderName = Request.Form["cardHolder"]; string TradingAccountId = Request.Form["PIN"]; #endregion string PIN = !string.IsNullOrEmpty(TradingAccountId) ? TradingAccountId : string.Empty; #region Get Client Info ClientModel Info = new ClientModel(); using (NpgsqlConnection conn = Classes.DB.InstBTCDB("instbtc")) { Info = Clients.FindById(conn, int.Parse(ClientId)); } #endregion if (Info != null) { #region Creating the Transaction Object Classes.Instbtc.Models.TransactionModel Transaction = new Classes.Instbtc.Models.TransactionModel { Psp_ID = decimal.Parse(PspId), Deposit_Currency = Currency, Deposit_Amount = Convert.ToDecimal(Amount), Exchange_Currency = "BTC", Exchange_Amount = Convert.ToDecimal(Classes.Instbtc.Utilities.Conversion.GetBTCAmountRestSharp(Amount, Currency)), Created_Date = DateTime.UtcNow, Client_ID = Convert.ToDecimal(ClientId), Psp_Status = PaymentStatus, Credited_Status = CreditedStatus, PaymentReference = PaymentReferrence, Notes = Note, type = Classes.Instbtc.Models.TransactionType.DEPOSIT, CardLast4 = !string.IsNullOrEmpty(CardLast4) ? CardLast4 : "", CardHolderName = !string.IsNullOrEmpty(CardHolderName) ? CardHolderName : "", Transaction_Currency = "BTC" }; #endregion #region Create The Transaction var TransactionCheck = Utilities.Transactions.CheckTransactionIfExist(Transaction.PaymentReference); object result = new object(); if (string.IsNullOrEmpty(TransactionCheck)) { result = Classes.Instbtc.Create.Transactions.CreateTransaction(Transaction); } else { toastrUtilities.SessionPush("toast", new KeyValuePair <string, string>("error", $"Cant Create Transaction, Existing Detected!")); Response.Redirect("/transaction-lists.aspx"); } #endregion if (result.ToString() != "Internal Error" || result != null) { decimal OriginalDepositTransactionAmount = decimal.Parse(Transaction.Deposit_Amount.ToString()); decimal OriginalBtcExchangeAmount = decimal.Parse(Transaction.Exchange_Amount.ToString()); EmailTemplateUtilities.SendNotificationDeposit(Info.Id.ToString(), OriginalDepositTransactionAmount.ToString(), OriginalBtcExchangeAmount.ToString(), Transaction); //if (Info.Referral.ToLower() == "lblv" || Info.Referral.ToLower() == "tradershome" || Info.Referral.ToLower() == "profitix" || Info.Referral.ToLower() == "vlom" || Info.Referral.ToLower() == "uptos" || Info.Referral.ToLower() == "fundiza" || Info.Referral.ToLower() == "kiplar" || Info.Referral.ToLower() == "investigram" || Info.Referral.ToLower() == "commercewealth") //{ // try // { // var pspList = PspUtilities.GetPspById(Transaction.Psp_ID.ToString()); // var pspName = pspList.Where(w => w.Id == int.Parse(Transaction.Psp_ID.ToString()))?.FirstOrDefault()?.Name; // pspName = pspName.Replace("USD ", "").Replace("EUR ", "").Replace("AUD ", ""); // var res = BrandsIntegration.PushToBrand(Info, Transaction, PaymentStatus, result, $"[{pspName}] " + Note, PIN, pspName); // toastrUtilities.SessionPush("toast", new KeyValuePair<string, string>("success", $"{res}")); // } // catch (Exception ex) // { // toastrUtilities.SessionPush("toast", new KeyValuePair<string, string>("error", $"{ex.Message.ToString()}")); // } //} //else //{ // decimal OriginalDepositTransactionAmount = decimal.Parse(Transaction.Deposit_Amount.ToString()); // decimal OriginalBtcExchangeAmount = decimal.Parse(Transaction.Exchange_Amount.ToString()); // EmailTemplateUtilities.SendNotificationDeposit(Info.Id.ToString(), OriginalDepositTransactionAmount.ToString(), OriginalBtcExchangeAmount.ToString(), Transaction); //} } else { toastrUtilities.SessionPush("toast", new KeyValuePair <string, string>("error", $"An Error Occured Cant Create Transaction")); } } else { //Redirect Invalid Client Id; toastrUtilities.SessionPush("toast", new KeyValuePair <string, string>("error", $"No Client With this Id: {ClientId}")); Response.Redirect("/transaction-lists.aspx"); } } OptionUtilities optionUtilities = new OptionUtilities(); pspId.Items.AddRange(optionUtilities.GetPSPOptions()); }