public ActionResult SavePaymentTerm(AnFPaymentTerm anFPaymentTerm)
        {
            Operation objOperation = new Operation { Success = false };

            if (ModelState.IsValid)
            {
                if (anFPaymentTerm.Id == 0)
                {
                    if ((bool)Session["Add"])
                    {
                        objOperation = _ptService.SaveAnFPaymentTerm(anFPaymentTerm);
                    }
                    else { objOperation.OperationId = -1; }
                }
                else
                {
                    if ((bool)Session["Edit"])
                    {
                        objOperation = _ptService.UpdateAnFPaymentTerm(anFPaymentTerm);
                    }
                    else { objOperation.OperationId = -2; }
                }
            }

            return Json(objOperation, JsonRequestBehavior.DenyGet);
        }
        public Operation DeleteAnFPaymentTerm(AnFPaymentTerm objAnFPaymentTerm)
        {
            Operation objOperation = new Operation { Success = true, OperationId = objAnFPaymentTerm.Id };
            _AnFPaymentTermRepository.Delete(objAnFPaymentTerm);

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception)
            {

                objOperation.Success = false;
            }
            return objOperation;
        }
        public Operation SaveAnFPaymentTerm(AnFPaymentTerm objAnFPaymentTerm)
        {
            Operation objOperation = new Operation { Success = true };

            long Id = _AnFPaymentTermRepository.AddEntity(objAnFPaymentTerm);
            objOperation.OperationId = Id;

            try
            {
                _UnitOfWork.Commit();
            }
            catch (Exception ex)
            {
                objOperation.Success = false;
            }
            return objOperation;
        }