public Operation DeleteAnFChequeBook(AnFChequeBook objAnFChequeBook) { Operation objOperation = new Operation { Success = true, OperationId = objAnFChequeBook.Id }; _AnFChequeBookRepository.Delete(objAnFChequeBook); try { _UnitOfWork.Commit(); } catch (Exception) { objOperation.Success = false; } return objOperation; }
public ActionResult SaveChequeBook(AnFChequeBookViewModel anFChequeBookViewModel) { Operation objOperation = new Operation { Success = false }; if (ModelState.IsValid) { AnFChequeBook anFChequeBook = new AnFChequeBook(); anFChequeBook.Id = anFChequeBookViewModel.Id; anFChequeBook.ChequeBookNo = anFChequeBookViewModel.ChequeBookNo; anFChequeBook.IssueDate = anFChequeBookViewModel.IssueDate; anFChequeBook.AnFChartOfAccountId = anFChequeBookViewModel.AnFChartOfAccountId; anFChequeBook.NoofPage = anFChequeBookViewModel.NoofPage; anFChequeBook.StartingPageNo = anFChequeBookViewModel.StartingPageNo; anFChequeBook.EndingPageNo = anFChequeBookViewModel.EndingPageNo; if (anFChequeBook.Id == 0) { if ((bool)Session["Add"]) { objOperation = _chequeBookService.SaveAnFChequeBook(anFChequeBook); } else { objOperation.OperationId = -1; } } else { if ((bool)Session["Edit"]) { objOperation = _chequeBookService.UpdateAnFChequeBook(anFChequeBook); } else { objOperation.OperationId = -2; } } } return Json(objOperation, JsonRequestBehavior.DenyGet); }
public Operation SaveAnFChequeBook(AnFChequeBook objAnFChequeBook) { Operation objOperation = new Operation { Success = true }; long Id = _AnFChequeBookRepository.GetLastId(); objAnFChequeBook.Id = Id; _AnFChequeBookRepository.Add(objAnFChequeBook); objOperation.OperationId = Id; try { _UnitOfWork.Commit(); } catch (Exception ex) { objOperation.Success = false; } return objOperation; }