public ActionResult SavePaymentMethod(AnFPaymentMethod anFPaymentMethod) { Operation objOperation = new Operation { Success = false }; if (ModelState.IsValid) { if (anFPaymentMethod.Id == 0) { if ((bool)Session["Add"]) { objOperation = _pmService.SaveAnFPaymentMethod(anFPaymentMethod); } else { objOperation.OperationId = -1; } } else { if ((bool)Session["Edit"]) { objOperation = _pmService.UpdateAnFPaymentMethod(anFPaymentMethod); } else { objOperation.OperationId = -2; } } } return Json(objOperation, JsonRequestBehavior.DenyGet); }
public Operation DeleteAnFPaymentMethod(AnFPaymentMethod objAnFPaymentMethod) { Operation objOperation = new Operation { Success = true, OperationId = objAnFPaymentMethod.Id }; _AnFPaymentMethodRepository.Delete(objAnFPaymentMethod); try { _UnitOfWork.Commit(); } catch (Exception) { objOperation.Success = false; } return objOperation; }
public Operation SaveAnFPaymentMethod(AnFPaymentMethod objAnFPaymentMethod) { Operation objOperation = new Operation { Success = true }; long Id = _AnFPaymentMethodRepository.AddEntity(objAnFPaymentMethod); objOperation.OperationId = Id; try { _UnitOfWork.Commit(); } catch (Exception ex) { objOperation.Success = false; } return objOperation; }