Пример #1
0
        ///// <summary>
        ///// Action for display the profile page of a current login user
        ///// </summary>
        ///// <returns></returns>
        //public ActionResult MyProfile()
        //{
        //    MyProfileComplexViewModel model = new MyProfileComplexViewModel();
        //    return View(model);
        //}
        /// <summary>
        /// Action for Display the payment Listing by user
        /// </summary>
        /// <returns></returns>
        public ActionResult MyPayments()
        {
            ViewBag.ActiveMenu = "LiMyPayments";
            ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
            PaymentObject paymentobj = new PaymentObject();
            PaymentEngine paymentEngine = new PaymentEngine();

            string response = paymentEngine.GetPaymentHistoryJSON(Request.Cookies["sessionkey"].Value);
            responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
            paymentobj = (PaymentObject)Serializer.JSONStringToObject<PaymentObject>(responseObject.ResultObjectJSON);
            int totalPagesCount = (int)Math.Ceiling((float)responseObject.ResultObjectRecordCount / (float)_PageSize);
            ViewBag.TotalPagesCount = totalPagesCount;
            ViewBag.PageNumber = 1;
            ViewBag.TotalRecordCount = responseObject.ResultObjectRecordCount;
            return View();
            //ViewBag.ActiveMenu = "LiMyPayments";
            //int totalRecords = 0;
            //PaymentListViewModel model = null;
            //List<PaymentListViewModel> modelList = new List<PaymentListViewModel>();
            //model = new PaymentListViewModel();
            //model.ProblemID = 10522;
            //model.ProblemTitle = "Washing Machine";
            //model.OppositeUserFirstName = "Chester";
            //model.OppositeUserLastName = "Benington";
            //model.OppositeUserImagepath = ServerSettings.WebApplicationURL + "/upload/profilepic/profile.jpg";
            //model.PaymentDate = DateTime.Now;
            //model.Amount = Convert.ToDecimal(15000.99);
            //modelList.Add(model);

            //model = new PaymentListViewModel();
            //model.ProblemID = 10522;
            //model.ProblemTitle = "Freeze Cooling";
            //model.OppositeUserFirstName = "Chester";
            //model.OppositeUserLastName = "Benington";
            //model.OppositeUserImagepath = ServerSettings.WebApplicationURL + "/upload/profilepic/profile.jpg";
            //model.PaymentDate = DateTime.Now;
            //model.Amount = Convert.ToDecimal(7850.75);
            //modelList.Add(model);

            //model = new PaymentListViewModel();
            //model.ProblemID = 10522;
            //model.ProblemTitle = "DVD Player";
            //model.OppositeUserFirstName = "Alex";
            //model.OppositeUserLastName = "D'Souza";
            //model.OppositeUserImagepath = ServerSettings.WebApplicationURL + "/upload/profilepic/Sean-McPheat-Profile-Pic.jpg";
            //model.PaymentDate = DateTime.Now;
            //model.Amount = Convert.ToDecimal(3000.99);
            //modelList.Add(model);
            //if (modelList.Count > 0)
            //{
            //    totalRecords = 2;
            //}
            //int totalPagesCount = (int)Math.Ceiling((float)totalRecords / (float)_PageSize);
            //ViewBag.TotalPagesCount = totalPagesCount;
            //ViewBag.PageNumber = 1;
            //return View(modelList);
        }
Пример #2
0
 /// <summary>
 /// Get payment page
 /// </summary>
 /// <param name="pPageIndex">Index of a page that needs to be fetched</param>
 /// <returns></returns>
 public ActionResult GetPaymentPage(int pPageIndex)
 {
     PaymentObject paymentobj = new PaymentObject();
     ResponseObjectForAnything responseObject = new ResponseObjectForAnything();
     PaymentEngine paymentEngine = new PaymentEngine();
     string response = paymentEngine.GetPaymentHistoryJSON(Request.Cookies["sessionkey"].Value);
     responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response);
     paymentobj = (PaymentObject)Serializer.JSONStringToObject<PaymentObject>(responseObject.ResultObjectJSON);
     return PartialView("_PaymentList", paymentobj.PaymentMade);
     //int totalRecords = 0;
     //PaymentListViewModel model = null;
     //List<PaymentListViewModel> modelList = new List<PaymentListViewModel>();
     //model = new PaymentListViewModel();
     //model.ProblemID = 10522;
     //model.ProblemTitle = "DVD Player";
     //model.OppositeUserFirstName = "Alex";
     //model.OppositeUserLastName = "D'Souza";
     //model.OppositeUserImagepath = ServerSettings.WebApplicationURL + "/upload/profilepic/Sean-McPheat-Profile-Pic.jpg";
     //model.PaymentDate = DateTime.Now;
     //model.Amount = Convert.ToDecimal(3000.99);
     //modelList.Add(model);
     //if (modelList.Count > 0)
     //{
     //    totalRecords = 2;
     //}
     //int totalPagesCount = (int)Math.Ceiling((float)totalRecords / (float)_PageSize);
     //ViewBag.TotalPagesCount = totalPagesCount;
     //ViewBag.PageNumber = pPageIndex;
     //return PartialView("_PaymentList", payment);
 }