public ActionResult Edit(AccountVM viewModel) { try { // TODO: Add update logic here if (ModelState.IsValid) { Entities.Account entity = new Entities.Account(); entity.SrNo = viewModel.SrNo; entity.NarrationDetails = viewModel.NarrationDetails; entity.TransactionType = viewModel.TransactionType; entity.PaymentMode = viewModel.PaymentMode; entity.Amount = viewModel.Amount; entity.Balance = viewModel.Balance; entity.TransactionDate = viewModel.TransactionDate; entity.Remark = viewModel.Remark; entity.CustomerName = viewModel.CustomerName; entity.BankName = viewModel.BankName; entity.ChqDDNumber = viewModel.ChqDDNumber; entity.ContactNo = viewModel.ContactNo; AccountBAL balObject = new AccountBAL(); balObject.Edit(entity); TempData["Message"] = "Account updated successfully !!!"; } else { TempData["Error"] = "Some problem while updating account entry !!!"; } } catch { TempData["Error"] = "Some problem while updating account entry !!!"; } return(View(viewModel)); }