コード例 #1
0
        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);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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;
        }