Esempio n. 1
0
 public JsonResult SaveShiipingMethod(int _shippingPaymentID, int _shippingMethodID)
 {
     string[] _Ids = new string[3];
     _Ids[0] = "Add";
     Domain.Models.ShippingPayment.ShippingPayment _shippingPayment = new Domain.Models.ShippingPayment.ShippingPayment();
     _shippingPayment = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingPayment>(_shippingPaymentService.getShippingPaymentByID(_shippingPaymentID));
     _shippingPayment.ShippingMethodID  = _shippingMethodID;
     _shippingPayment.ShippingPaymentID = _shippingPaymentService.updateShippingPayment(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingPayment>(_shippingPayment));
     _Ids[1] = _shippingMethodID.ToString();
     _Ids[2] = _shippingPaymentID.ToString();
     return(Json(_Ids, GlobalConst.Message.text_html, JsonRequestBehavior.AllowGet));
 }
Esempio n. 2
0
        public ActionResult IPN()
        {
            ShippingPaymentViewModel _shippingPaymentViewModel = new ShippingPaymentViewModel();

            _shippingPaymentViewModel.BillingAddressResults = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.BillingAddress>(_shippingPaymentService.getBillingAddressByUserID(HCRGUser.UID));
            var shipping = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingPayment>(_shippingPaymentService.GetShippingPaymentByUserID(HCRGUser.UID));

            Domain.Models.ShippingPayment.ShippingPayment shippingDetails = new Domain.Models.ShippingPayment.ShippingPayment();
            shippingDetails.UserID              = _shippingPaymentViewModel.BillingAddressResults.BAUserID;
            shippingDetails.BillingAddressID    = _shippingPaymentViewModel.BillingAddressResults.BillingAddressID;
            shippingDetails.ShippingAddressID   = 0;
            shippingDetails.ShippingMethodID    = 0;
            shippingDetails.ShippingPaymentID   = shipping.ShippingPaymentID;
            shippingDetails.TransactionNumber   = Request.QueryString["tx"];
            shippingDetails.TransactionDatetime = System.DateTime.Now;
            shippingDetails.PaymentStatus       = Request.QueryString["st"];

            if (shippingDetails.PaymentStatus == "Completed")
            {
                shippingDetails.IsPaymentRecevied = true;
                shippingDetails.CreatedOn         = System.DateTime.Now;
                shippingDetails.CreatedBy         = HCRGUser.UID;
                if (shipping.ShippingPaymentID != null)
                {
                    int ShippingPaymentID = _shippingPaymentService.updateShippingPayment(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingPayment>(shippingDetails));
                    _shippingPaymentService.addEducationShoppingRecordByShippingPaymentID(shippingDetails.ShippingPaymentID);
                }
                Domain.Models.UserModel.User _user = new Domain.Models.UserModel.User();
                _user = Mapper.Map <Domain.Models.UserModel.User>(_userService.GetUserByID(HCRGUser.UID));

                if ((_user.IsAllAccessPricing == true) && (_user.UserAllAccessPassID == null))
                {
                    Domain.Models.UserModel.UserAllAccessPass _userAllAccessPass = new Domain.Models.UserModel.UserAllAccessPass();
                    _userAllAccessPass.AAPCouponID = null;
                    _userAllAccessPass.IsAllAccessPricingAmountRecevied = true;
                    _userAllAccessPass.AllAccessStartDate = DateTime.Now;
                    _userAllAccessPass.AllAccessEndDate   = DateTime.Now.AddYears(1).AddDays(-1);
                    _userAllAccessPass.UserID             = HCRGUser.UID;
                    _userAllAccessPass.ShippingPaymentID  = shippingDetails.ShippingPaymentID;

                    _userService.addUserAllAccessPass(Mapper.Map <NEPService.UserService.UserAllAccessPass>(_userAllAccessPass));
                }
            }
            else
            {
                shippingDetails.IsPaymentRecevied = false;
            }
            return(View(shippingDetails));
        }
Esempio n. 3
0
        public JsonResult SaveShiipingAddress(HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingAddress _shippingAddress)
        {
            string[] _Ids = new string[3];
            if (_shippingAddress.IsSaveShippingAddress.Value)
            {
                _shippingAddress.SAUserID = HCRGUser.UID;
                if (_shippingAddress.ShippingAddressID == 0)
                {
                    _Ids[0] = "Add";
                    _shippingAddress.ShippingAddressID = _shippingPaymentService.addShippingAddress(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingAddress>(_shippingAddress));
                    _Ids[1] = _shippingAddress.ShippingAddressID.ToString();
                    _Ids[2] = _shippingAddress.ShippingPaymentID.ToString();

                    Domain.Models.ShippingPayment.ShippingPayment _shippingPayment = new Domain.Models.ShippingPayment.ShippingPayment();
                    _shippingPayment = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingPayment>(_shippingPaymentService.getShippingPaymentByID(_shippingAddress.ShippingPaymentID));
                    _shippingPayment.ShippingAddressID = _shippingAddress.ShippingAddressID;
                    _shippingPayment.ShippingPaymentID = _shippingPaymentService.updateShippingPayment(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingPayment>(_shippingPayment));
                }
                else
                {
                    _shippingPaymentService.updateShippingAddress(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingAddress>(_shippingAddress));
                    _Ids[0] = "Update";
                    _Ids[1] = _shippingAddress.ShippingAddressID.ToString();
                    _Ids[2] = _shippingAddress.ShippingPaymentID.ToString();

                    Domain.Models.ShippingPayment.ShippingPayment _shippingPayment = new Domain.Models.ShippingPayment.ShippingPayment();
                    _shippingPayment = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingPayment>(_shippingPaymentService.getShippingPaymentByID(_shippingAddress.ShippingPaymentID));
                    _shippingPayment.ShippingAddressID = _shippingAddress.ShippingAddressID;
                    _shippingPayment.ShippingPaymentID = _shippingPaymentService.updateShippingPayment(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingPayment>(_shippingPayment));
                }
                return(Json(_Ids, GlobalConst.Message.text_html, JsonRequestBehavior.AllowGet));
            }
            else
            {
                _Ids[1] = "NoChnage";
                _Ids[1] = _shippingAddress.ShippingAddressID.ToString();
                _Ids[2] = _shippingAddress.ShippingPaymentID.ToString();
                return(Json(_Ids, GlobalConst.Message.text_html, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 4
0
        public JsonResult SaveBillingAddress(HCRGUniversityApp.Domain.Models.ShippingPayment.BillingAddress _billingAddress)
        {
            string[] _Ids = new string[3];
            if (_billingAddress.IsSaveBillingAddress.Value)
            {
                _billingAddress.BAUserID = HCRGUser.UID;
                if (_billingAddress.BillingAddressID == 0)
                {
                    if (!_billingAddress.IsSABillingAddressSame.Value)
                    {
                        _billingAddress.BillingAddressID = _shippingPaymentService.addBillingAddress(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.BillingAddress>(_billingAddress));
                        _Ids[0] = "Add";
                        _Ids[1] = _billingAddress.BillingAddressID.ToString();
                        Domain.Models.ShippingPayment.ShippingPayment _shippingPayment = new Domain.Models.ShippingPayment.ShippingPayment();
                        _shippingPayment = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingPayment>(_shippingPaymentService.getShippingPaymentByID(_billingAddress.ShippingPaymentID));
                        _shippingPayment.BillingAddressID  = _billingAddress.BillingAddressID;
                        _shippingPayment.ShippingPaymentID = _shippingPaymentService.updateShippingPayment(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingPayment>(_shippingPayment));

                        if (_shippingPayment.ShippingAddressID > 0)
                        {
                            Domain.Models.ShippingPayment.ShippingAddress _shippingAddress = new Domain.Models.ShippingPayment.ShippingAddress();
                            _shippingAddress = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingAddress>(_shippingPaymentService.getShippingAddressByID(_shippingPayment.ShippingAddressID));
                            _shippingAddress.SABillingAddressSame = false; // as user enter new address
                            _shippingAddress.ShippingAddressID    = _shippingPaymentService.updateShippingAddress(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingAddress>(_shippingAddress));
                        }
                        _Ids[2] = _shippingPayment.ShippingPaymentID.ToString();
                    }
                    else
                    {
                        _Ids[0] = "SABillingAddressSame";
                        _Ids[1] = "0";
                        _Ids[2] = _billingAddress.ShippingPaymentID.ToString();
                    }
                }
                else
                {
                    if (!_billingAddress.IsSABillingAddressSame.Value)
                    {
                        _shippingPaymentService.updateBillingAddress(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.BillingAddress>(_billingAddress));

                        _Ids[0] = "Update";
                        _Ids[1] = _billingAddress.BillingAddressID.ToString();

                        Domain.Models.ShippingPayment.ShippingPayment _shippingPayment = new Domain.Models.ShippingPayment.ShippingPayment();
                        _shippingPayment = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingPayment>(_shippingPaymentService.getShippingPaymentByID(_billingAddress.ShippingPaymentID));
                        _shippingPayment.BillingAddressID  = _billingAddress.BillingAddressID;
                        _shippingPayment.ShippingPaymentID = _shippingPaymentService.updateShippingPayment(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingPayment>(_shippingPayment));

                        if (_shippingPayment.ShippingAddressID > 0)
                        {
                            Domain.Models.ShippingPayment.ShippingAddress _shippingAddress = new Domain.Models.ShippingPayment.ShippingAddress();
                            _shippingAddress = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingAddress>(_shippingPaymentService.getShippingAddressByID(_shippingPayment.ShippingAddressID));
                            _shippingAddress.SABillingAddressSame = false; // as user enter new address
                            _shippingAddress.ShippingAddressID    = _shippingPaymentService.updateShippingAddress(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingAddress>(_shippingAddress));
                        }

                        _Ids[2] = _billingAddress.ShippingPaymentID.ToString();
                    }
                    else
                    {
                        Domain.Models.ShippingPayment.ShippingPayment _shippingPayment = new Domain.Models.ShippingPayment.ShippingPayment();
                        _shippingPayment = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingPayment>(_shippingPaymentService.getShippingPaymentByID(_billingAddress.ShippingPaymentID));
                        _shippingPayment.BillingAddressID  = _billingAddress.BillingAddressID;
                        _shippingPayment.ShippingPaymentID = _shippingPaymentService.updateShippingPayment(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingPayment>(_shippingPayment));

                        if (_shippingPayment.ShippingAddressID > 0)
                        {
                            Domain.Models.ShippingPayment.ShippingAddress _shippingAddress = new Domain.Models.ShippingPayment.ShippingAddress();
                            _shippingAddress = Mapper.Map <HCRGUniversityApp.Domain.Models.ShippingPayment.ShippingAddress>(_shippingPaymentService.getShippingAddressByID(_shippingPayment.ShippingAddressID));
                            _shippingAddress.SABillingAddressSame = true; // as user enter new address
                            _shippingAddress.ShippingAddressID    = _shippingPaymentService.updateShippingAddress(Mapper.Map <HCRGUniversityApp.NEPService.ShippingPaymentService.ShippingAddress>(_shippingAddress));
                        }

                        _Ids[0] = "SABillingAddressSame";
                        _Ids[1] = _billingAddress.BillingAddressID.ToString();
                        _Ids[2] = _billingAddress.ShippingPaymentID.ToString();
                    }
                }
                return(Json(_Ids, GlobalConst.Message.text_html, JsonRequestBehavior.AllowGet));
            }
            else
            {
                _Ids[1] = "NoChnage";
                _Ids[1] = _billingAddress.BillingAddressID.ToString();
                _Ids[2] = _billingAddress.ShippingPaymentID.ToString();
                return(Json(_Ids, GlobalConst.Message.text_html, JsonRequestBehavior.AllowGet));
            }
        }