public ActionResult Edit(int id) { AccountVM viewModel = new AccountVM(); AccountBAL balObject = new AccountBAL(); IQueryable <Entities.Account> entites = balObject.FindBy(a => a.SrNo == id); if (entites != null && entites.Count() > 0) { Entities.Account entity = entites.FirstOrDefault(); viewModel.SrNo = entity.SrNo; viewModel.NarrationDetails = entity.NarrationDetails; viewModel.TransactionType = entity.TransactionType; viewModel.PaymentMode = entity.PaymentMode; viewModel.Amount = entity.Amount; viewModel.Balance = entity.Balance; viewModel.TransactionDate = entity.TransactionDate; viewModel.Remark = entity.Remark; viewModel.CustomerName = entity.CustomerName; viewModel.BankName = entity.BankName; viewModel.ChqDDNumber = entity.ChqDDNumber; viewModel.ContactNo = entity.ContactNo; } return(View(viewModel)); }