public static AG_IAS_PAYMENT_HEADER ConvertToAG_IAS_PAYMENT_HEADER(this AG_IAS_TEMP_PAYMENT_HEADER item, BankType bankType) { AG_IAS_PAYMENT_HEADER entity = new AG_IAS_PAYMENT_HEADER(); entity.EFFECTIVE_DATE = item.EFFECTIVE_DATE; entity.SERVICE_CODE = item.SERVICE_CODE; entity.ID = item.ID; entity.RECORD_TYPE = item.RECORD_TYPE; entity.SEQUENCE_NO = item.SEQUENCE_NO; entity.BANK_CODE = item.BANK_CODE; entity.COMPANY_ACCOUNT = item.COMPANY_ACCOUNT; entity.COMPANY_NAME = item.COMPANY_NAME; entity.BANK = bankType.ToString("g"); return(entity); }
public override IDictionary <string, object> ToData(KindsOfTextCase txtCase) { Func <string, string> textFormat = (x) => VocaBase.TransformText(x, txtCase); var itemData = base.ToData(txtCase) ?? new Dictionary <string, object>(); if (Rssd != null) { itemData.Add(textFormat(nameof(Rssd)), Rssd.Value); } if (RoutingNumber != null) { itemData.Add(textFormat(nameof(RoutingNumber)), RoutingNumber.Value); } if (FdicNumber != null) { itemData.Add(textFormat(nameof(FdicNumber)), FdicNumber.Value); } itemData.Add(textFormat(nameof(TypeOfBank)), BankType.ToString()); itemData.Add(textFormat(nameof(IsInternational)), IsInternational); return(itemData); }
public static void ReadAllCustomer() { controller = "BankAccounts"; response = GlobalVariable.WebApiClient.GetAsync(controller).Result; IEnumerable <BankAccount> bankAccountList = response.Content.ReadAsAsync <IEnumerable <BankAccount> >().Result; var table = new ConsoleTable("CustomerID", "Full Name", "NRIC", "Date Of Birth", "Age", "Email", "Account Type", "AccountNo", "Account Balance", "Bank"); foreach (var item in bankAccountList) { AccountType accountType = item.AccountType; BankType bankType = item.Bank; table.AddRow(item.Customer.ID, item.Customer.Fullname, item.Customer.NRIC, string.Format("{0:yyyy/MM/dd}", item.Customer.DateOfBirth), item.Customer.Age, item.Customer.Email, accountType.ToString(), item.AccountNo, item.AccountBalance, bankType.ToString()); } table.Options.EnableCount = false; table.Write(); }
private static void ReadSingleCustomerForEdit(int CustomerID) { controller = "BankAccounts"; BankAccount GetBankAccountID = db.BankAccount.ReadByCustomerID(CustomerID); response = GlobalVariable.WebApiClient.GetAsync(string.Concat(controller, $"/{GetBankAccountID.ID}")).Result; BankAccount x = response.Content.ReadAsAsync <BankAccount>().Result; var table = new ConsoleTable("1", "2", "3", "4", "5", "6"); table.AddRow("Fullname", "NRIC", "Date Of Birth", "Age", "Email", "Bank"); BankType bankType = x.Bank; table.AddRow(x.Customer.Fullname, x.Customer.NRIC, string.Format("{0:yyyy/MM/dd}", x.Customer.DateOfBirth), x.Customer.Age, x.Customer.Email, bankType.ToString()); table.Options.EnableCount = false; table.Write(); }
/// <summary> /// Fetch the path in Resources to the three different sound banks for loading from the SoundBankType. /// </summary> /// <returns>Path to the Sound Bank.</returns> /// <param name="bankType">Type of sound bank to load.</param> string GetBankFilePath(BankType bankType) { string resourceBankPath = @"UnitySynth/SoundBank/"; string gmBankPath = resourceBankPath + @"GM/gm"; string fmBankPath = resourceBankPath + @"FM/fm"; string analogBankPath = resourceBankPath + @"Analog/analog"; switch (bankType) { case BankType.GeneralMidi: return gmBankPath; case BankType.FMSynthesis: return fmBankPath; case BankType.AnalogSynthesis: return analogBankPath; default: Debug.LogWarning ("BankType " + bankType.ToString() + " not found. Using General MIDI."); return gmBankPath; } }
public ActionResult Index(VMFundTransfer VMFundTransfer) { int CustomerID = Convert.ToInt32(Session["CustomerID"]); BankAccount bankAccount = db.BankAccount.ReadByCustomerID(CustomerID); VMFundTransfer fundTransfer = new VMFundTransfer(); ViewBag.AccountType = new SelectList(db.BankAccount.IReadByCustomerID(CustomerID), "AccountType", "AccountType"); ViewBag.AccountNo = new SelectList(db.BankAccount.IReadByCustomerID(CustomerID), "AccountNo", "AccountNo"); fundTransfer.AccountBalance = bankAccount.AccountBalance; BankAccount OwnerAccount = db.BankAccount.ReadByCustomerID(Convert.ToInt32(Session["CustomerID"])); BankAccount RecipientAccount = db.BankAccount.ReadByAccountNo(VMFundTransfer.RecipientAccount); if (RecipientAccount == null || RecipientAccount.Bank != VMFundTransfer.RecipientBank) { ViewBag.ErrorMessage = "Recipient Account Does Not Exist !"; return(View(fundTransfer)); } response = GlobalVariable.WebApiClient.GetAsync(string.Concat(controller, $"/{OwnerAccount.ID}")).Result; BankAccount Owner = response.Content.ReadAsAsync <BankAccount>().Result; response = GlobalVariable.WebApiClient.GetAsync(string.Concat(controller, $"/{RecipientAccount.ID}")).Result; BankAccount Recipient = response.Content.ReadAsAsync <BankAccount>().Result; Owner.AccountBalance -= VMFundTransfer.TransactionAmount; Recipient.AccountBalance += VMFundTransfer.TransactionAmount; TransferMode transferMode = VMFundTransfer.TransferMode; string transferModeChosen = transferMode.ToString(); decimal transferModeChargeAmount = Convert.ToDecimal(ConfigurationManager.AppSettings[$"{transferModeChosen}"]); Owner.AccountBalance -= transferModeChargeAmount; response = GlobalVariable.WebApiClient.PutAsJsonAsync(string.Concat(controller, $"/{Owner.ID}"), Owner).Result; if (response.IsSuccessStatusCode == false) { ViewBag.ErrorMessage = "Fund Transaction Fail !"; ViewBag.ErrorMessage2 = "Please Try Again Later."; return(View(fundTransfer)); } response = GlobalVariable.WebApiClient.PutAsJsonAsync(string.Concat(controller, $"/{Recipient.ID}"), Recipient).Result; if (response.IsSuccessStatusCode == false) { ViewBag.ErrorMessage = "Fund Transaction Fail !"; ViewBag.ErrorMessage2 = "Please Try Again Later."; return(View(fundTransfer)); } // GlobalVariable.SendEmail(Owner.Customer.Email, "Fund Transaction", $"Hi {Owner.Customer.Fullname},<br/>You did an {transferModeChosen} Transfer of RM {VMFundTransfer.TransactionAmount} on {DateTime.Now} to {Recipient.Customer.Fullname}.<br/>For enquiry, please call 999."); // GlobalVariable.SendEmail(Recipient.Customer.Email, "Fund Transaction", $"Hi {Recipient.Customer.Fullname},<br/>You receive an {transferModeChosen} Transfer of RM {VMFundTransfer.TransactionAmount} on {DateTime.Now} from {Owner.Customer.Fullname}.<br/>For enquiry, please call 999."); BankType recipientBankType = VMFundTransfer.RecipientBank; string recipientBank = recipientBankType.ToString(); BankTransaction OwnerBankTransaction = new BankTransaction(); OwnerBankTransaction.BankAccountID = Owner.ID; OwnerBankTransaction.TransactionDateTime = DateTime.Now; OwnerBankTransaction.TransactionAmount = VMFundTransfer.TransactionAmount; OwnerBankTransaction.TransferMode = VMFundTransfer.TransferMode; OwnerBankTransaction.Remarks = $"Transfer to {Recipient.Customer.Fullname} {recipientBankType}({Recipient.AccountNo})."; BankType ownerBankType = VMFundTransfer.RecipientBank; string ownerBank = ownerBankType.ToString(); BankTransaction RecipientBankTransaction = new BankTransaction(); RecipientBankTransaction.BankAccountID = Recipient.ID; RecipientBankTransaction.TransactionDateTime = DateTime.Now; RecipientBankTransaction.TransactionAmount = VMFundTransfer.TransactionAmount; RecipientBankTransaction.TransferMode = VMFundTransfer.TransferMode; RecipientBankTransaction.Remarks = $"Receive from {Owner.Customer.Fullname} {ownerBank}({Owner.AccountNo})."; controller = "BankTransactions"; response = GlobalVariable.WebApiClient.PostAsJsonAsync(controller, OwnerBankTransaction).Result; response = GlobalVariable.WebApiClient.PostAsJsonAsync(controller, RecipientBankTransaction).Result; ViewBag.SuccessMessage = "Fund Transaction Successful !"; return(View(fundTransfer)); }