public ActionResult AddFdAccount(FdAccount fdAccount) { ViewData["disablecontrols"] = false; if (ModelState.IsValid) { if (fdAccount.Id == 0) { fdAccount.CreationDate = fdAccount.FdMemberAccount.CreationDate = fdAccount.CreationDate = DateTime.Now; fdAccount.FdAmount = fdAccount.FdMemberAccount.AmountTransaction.Amount.Value; fdAccount.FdMemberAccount.AccountTypeId = (int)AccountType.Fd; fdAccount.FdMemberAccount.AmountTransaction.TransactionType = (int)TransactionType.Credit; fdAccount.FdMemberAccount.AmountTransaction.StatusId = (int)AmountTransactionStatus.Pending; fdAccount.FdMemberAccount.AmountTransaction.Id = Common.UniqueTransactionId(); fdAccount.FdMemberAccount.AmountTransactions.Add(fdAccount.FdMemberAccount.AmountTransaction); var newRecord = Repository.Instance.Insert(fdAccount, true); } else { Repository.Instance.Update(fdAccount); Repository.Instance.Commit(); } return(RedirectToAction("AddFdAccount")); } return(View()); }
public ActionResult AddFdAccount(int?Id = null, bool?IsView = false) { ViewData["disablecontrols"] = false; if (IsView == true) { ViewData["disablecontrols"] = true; } var k = new FdAccount(); k.FdMemberAccount = k.FdMemberAccount ?? new MemberAccount(); return(View(k)); }