Пример #1
0
        //
        // GET: /PaymentTypePerCaseDetails/
        public ActionResult PaymentTypePerCase(long?contractId, long?serviceTypeId, int paymentTypeId, bool isEdit)
        {
            PaymentTypePerCaseViewModel modelPaymentTypePerCaseViewModel = new PaymentTypePerCaseViewModel();

            if (isEdit)
            {
                PaymentTypePerCase paymentTypePerCaseForPost = new PaymentTypePerCase
                {
                    ServiceTypeId = serviceTypeId,
                    ContractId    = contractId,
                    PaymentTypeId = paymentTypeId,
                    UserName      = GetCurrentUserName()
                };
                //Get the Name of User logged in

                PaymentTypePerCase paymentTypePerCaseViewModelInfo =
                    PostApiResponse <PaymentTypePerCase>("PaymentTypePerCase",
                                                         "GetPaymentPerCaseDetails",
                                                         paymentTypePerCaseForPost);

                modelPaymentTypePerCaseViewModel = AutoMapper.Mapper.Map <PaymentTypePerCase, PaymentTypePerCaseViewModel>(paymentTypePerCaseViewModelInfo);
            }

            modelPaymentTypePerCaseViewModel.ContractId    = contractId;
            modelPaymentTypePerCaseViewModel.ServiceTypeId = serviceTypeId;
            modelPaymentTypePerCaseViewModel.PaymentTypeId = paymentTypeId;
            modelPaymentTypePerCaseViewModel.IsEdit        = isEdit;
            return(View(modelPaymentTypePerCaseViewModel));
        }
Пример #2
0
        public JsonResult AddEditPaymentPerCase(PaymentTypePerCaseViewModel info)
        {
            PaymentTypePerCase perCasePaymentInfo = AutoMapper.Mapper.Map <PaymentTypePerCaseViewModel, PaymentTypePerCase>(info);

            //Get the Name of User logged in
            perCasePaymentInfo.UserName = GetCurrentUserName();
            long perCaseId = PostApiResponse <long>("PaymentTypePerCase", "AddEditPaymentPerCaseDetails", perCasePaymentInfo);

            return(perCaseId > 0 ? Json(new { sucess = true, Id = perCaseId }) : Json(new { sucess = false }));
        }