// You will need to amend this method retrieve data from database public TDMaster GetTDbyAccount(string acc) { // Hard-code TDMaster to test the form string custId = "S1111111D"; double principal = 50000; int term = 3; double rate = 1.5; double interest = principal * rate / 100; DateTime mDate = DateTime.Now.AddMonths(term); double mAmt = principal + interest; string mode = "Not renewing"; TDMaster td1 = new TDMaster(acc, custId, principal, term, interest, mDate, mAmt, rate, mode) { EffectiveFrom = DateTime.Now }; // The above hardcoding codes should be replaced by the database retrieval return(td1); }
// You will need to amend this method retrieve data from database public List <TDMaster> GetTDbyCustId(string custId) { // Hard-code TDMaster to test the form List <TDMaster> tdList = new List <TDMaster>(); string acc = "1000101"; double principal = 50000; int term = 3; double rate = 1.25; double interest = principal * rate / 100; DateTime mDate = DateTime.Now.AddMonths(term); double mAmt = principal + interest; string mode = "Not renewing"; TDMaster td1 = new TDMaster(acc, custId, principal, term, interest, mDate, mAmt, rate, mode) { EffectiveFrom = DateTime.Now }; tdList.Add(td1); acc = "1000102"; principal = 10000; term = 6; rate = 1.5; interest = principal * rate / 100; mDate = DateTime.Now.AddMonths(term); mAmt = principal + interest; mode = "P+I"; td1 = new TDMaster(acc, custId, principal, term, interest, mDate, mAmt, rate, mode) { EffectiveFrom = DateTime.Now }; tdList.Add(td1); return(tdList); }