Exemplo n.º 1
0
        public ActionResult AddUpdateCardCharges(tbl_Card_Charges request, List <tbl_Regional_Charges> regionRequest = default(List <tbl_Regional_Charges>), int?RequestId = null)
        {
            //existing account type modification requests to be handled through System Request Section
            if (RequestId.HasValue)
            {
                var getSystemRequest    = new SystemRequestDataAccess().GetSystemRequest(RequestId.GetValueOrDefault(), "R");
                var CardChargesDetails  = CardChargesMethod.GetCardChargeDetail(request.ID);
                var existingJson        = CardChargesDetails == null ? null : CustomHelper.GetJson(CardChargesDetails);
                var updatedJson         = CustomHelper.GetJson(request);
                tbl_System_Requests row = new tbl_System_Requests();
                if (RequestId.GetValueOrDefault() <= 0)
                {
                    row = new tbl_System_Requests
                    {
                        AuthorizationStatus = "P",
                        CreatorID           = StateHelper.UserId,
                        IsActive            = true,
                        ExistingData        = existingJson,
                        UpdatedData         = updatedJson,
                        RequestType         = Constants.RequestTypes.CardCharges_SystemRequest
                    };
                }
                else
                {
                    row                       = getSystemRequest;
                    row.CreatorID             = StateHelper.UserId;
                    row.AuthorizationStatus   = "P";
                    row.AuthorizationComments = string.Empty;
                    row.UpdatedData           = updatedJson;
                    row.ExistingData          = existingJson;
                }

                var SystemRequestFlag = (RequestId.HasValue && RequestId.GetValueOrDefault() <= 0) ? new SystemRequestDataAccess().AddSystemRequest(row) : new SystemRequestDataAccess().UpdateSystemRequest(row);

                return(Json(new { IsSuccess = SystemRequestFlag, ErrorMessage = SystemRequestFlag == true ? string.Empty : CustomMessages.GenericErrorMessage, Response = SystemRequestFlag }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                request.IsActive = true;
                var response = request.ID <= 0 ? new CardChargesDataAccess().AddCardCharges(request) : new CardChargesDataAccess().UpdateCardCharges(request);
                return(Json(new { IsSuccess = response, ErrorMessage = response == true ? string.Empty : CustomMessages.GenericErrorMessage, Response = response }, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 2
0
        public ActionResult AddUpdateCardCharges(int?Id)
        {
            CardChargesVM viewModel = new CardChargesVM();

            ViewBag.RequestId = Id ?? 0;

            ViewBag.AccountTypes = new AccountTypeDataAccess().GetAccountTypes("A");
            ViewBag.CardTypes    = new CardTypesDataAccess().GetCardTypes("A");
            ViewBag.CardCharges  = new CardChargesDataAccess().GetCardChargesActiveInactive("A");

            //Modifications to be handled through system requests
            if (Id.HasValue)
            {
                viewModel = CardChargesMethod.GetCardChargeDetail(Id.GetValueOrDefault(), "R");
                if (Id > 0 && viewModel == null)
                {
                    return(RedirectToAction("ReviewCardChargesScreen", "Review"));
                }
            }

            ViewBag.Regions     = new RegionDataAccess().GetAllRegions();
            ViewBag.RequestType = "Add";
            return(View(viewModel));
        }
Exemplo n.º 3
0
        public ActionResult GetCardChargeDetail(int ID)
        {
            var response = CardChargesMethod.GetCardChargeDetail(ID);

            return(Json(new { IsSuccess = response == null ? false : true, Response = response }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public ActionResult GetRegionalChargesDetail(int cardChargeID, int regionID)
        {
            var response = CardChargesMethod.GetRegionalChargesDetail(cardChargeID, regionID);

            return(Json(new { IsSuccess = response == null ? false : true, Response = response }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 5
0
        public ActionResult GetCardChargeByCardTypeAccount(int CardTypeID, int AccountTypeID)
        {
            var response = CardChargesMethod.GetCardChargeByCardTypeAccount(CardTypeID, AccountTypeID);

            return(Json(new { IsSuccess = response == null ? false : true, Response = response }, JsonRequestBehavior.AllowGet));
        }