public string[] Send_Message_MoneyTrans() { string[] result = new string[2]; int success = 0; int fail = 0; foreach (MessageObject_MoneyTran item in messagesObjs_moneyTrans) { CCSBAL bal = new CCSBAL(); CommonBAL comBal = new CommonBAL(); Thread.Sleep(5000); try { client.Timeout = 15000; //string userState = "Test Message"; client.Send(item.Mail); if (item.MessageInfoBo.Payment_Media == "EFT" && item.MessageInfoBo.Deposit_Withdraw == "Withdraw") { bal.CCS_Email_NotificationSent(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_EftWithdraw, string.Empty, comBal.GetCurrentServerDate().ToShortDateString()); } else if (item.MessageInfoBo.Payment_Media != "EFT" && item.MessageInfoBo.Deposit_Withdraw == "Withdraw") { bal.CCS_Email_NotificationSent(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_MoneyWithdraw, string.Empty, comBal.GetCurrentServerDate().ToShortDateString()); } else if (item.MessageInfoBo.Deposit_Withdraw == "Deposit") { bal.CCS_Email_NotificationSent(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_MoneyDeposit, string.Empty, comBal.GetCurrentServerDate().ToShortDateString()); } success = success + 1; } catch (Exception ex) { if (item.MessageInfoBo.Payment_Media == "EFT" && item.MessageInfoBo.Deposit_Withdraw == "Withdraw") { bal.CCS_Email_NotificationFailure(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_EftWithdraw, string.Empty, comBal.GetCurrentServerDate().ToShortDateString(), ex.Message); } else if (item.MessageInfoBo.Payment_Media != "EFT" && item.MessageInfoBo.Deposit_Withdraw == "Withdraw") { bal.CCS_Email_NotificationFailure(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_MoneyWithdraw, string.Empty, comBal.GetCurrentServerDate().ToShortDateString(), ex.Message); } else if (item.MessageInfoBo.Deposit_Withdraw == "Deposit") { bal.CCS_Email_NotificationFailure(item.MessageInfoBo.Cust_Code, item.MessageInfoBo.ReferenceNo, Indication_EmailNotification.Email_NotificationType_MoneyDeposit, string.Empty, comBal.GetCurrentServerDate().ToShortDateString(), ex.Message); } fail = fail + 1; } item.Mail.Dispose(); } result[0] = Convert.ToString(success); result[1] = Convert.ToString(fail); return(result); }
public string[] Send_Message_TradeConfirmation() { string[] result = new string[2]; int success = 0; int fail = 0; foreach (MessageObject_TradeConfirm item in messagesObjs_tradeConfirm) { CCSBAL bal = new CCSBAL(); CommonBAL comBal = new CommonBAL(); Thread.Sleep(5000); try { client.Timeout = 25000; client.Send(item.Mail); bal.CCS_Email_NotificationSent(item.MessageInfoBo.Cust_Code, Indication_EmailNotification.Email_NotificationType_TradeConfirmation, "HTML Formatted Email", comBal.GetCurrentServerDate().ToShortDateString()); success = success + 1; } catch (Exception ex) { bal.CCS_Email_NotificationFailure(item.MessageInfoBo.Cust_Code, Indication_EmailNotification.Email_NotificationType_TradeConfirmation, item.Mail.Body, comBal.GetCurrentServerDate().ToShortDateString(), ex.Message); fail = fail + 1; } } result[0] = Convert.ToString(success); result[1] = Convert.ToString(fail); return(result); }