public ActionResult BuyerRequests()
        {
            if (Session["UserID"] == null)
            {
                return(RedirectToAction("Login", "Authentication", new { ReturnUrl = @"/RegisteredUser/BuyerRequests" }));
            }

            int UID = Convert.ToInt32(User.Identity.Name);
            BuyerRequestsModel br = new BuyerRequestsModel();
            DownloadsModel     dm = DownloadRepository.GetDownloads(UID, 0);

            foreach (DownloadsModel.InnerClassDownload d in dm.DownloadProperty)
            {
                UserProfileModel usrp = UserRepository.GetUserData(d.Buyer.UserID);
                br.BRequests.Add(new BuyerRequestsModel.BuyerRequest()
                {
                    BuyerEmail   = d.Buyer.Email,
                    BuyerPhone   = usrp.PhoneNo != null ? usrp.CountryCode + " " + usrp.PhoneNo : "N/A",
                    NoteTitle    = d.NoteTitle,
                    NoteID       = d.NoteID,
                    NoteCategory = d.NoteCategory,
                    SellType     = d.IsPaid ? "Paid" : "Free",
                    DownloadID   = d.DownloadID,
                    ReqTime      = (System.DateTime)d.RequestTime,
                    Price        = (int)d.PurchasedPrice
                });
            }
            ViewBag.Authorized = true;
            ViewBag.Title      = "BuyerRequests";
            return(View(br));
        }
        public ActionResult SoldNotes()
        {
            if (Session["UserID"] == null)
            {
                return(RedirectToAction("Login", "Authentication", new { ReturnUrl = @"/RegisteredUser/SoldNotes" }));
            }

            int UserID = Convert.ToInt32(User.Identity.Name);

            DownloadsModel soldNotes = DownloadRepository.GetDownloads(UserID, 2); // DownnloadStatus : 2 for sold notes

            ViewBag.Authorized = true;
            ViewBag.Title      = "SoldNotes";

            return(View(soldNotes));
        }
        public ActionResult Downloads()
        {
            if (Session["UserID"] == null)
            {
                return(RedirectToAction("Login", "Authentication", new { ReturnUrl = @"/RegisteredUser/Downloads" }));
            }

            int UserID = Convert.ToInt32(User.Identity.Name);

            DownloadsModel DownloadedNotes = DownloadRepository.GetDownloads(UserID, 1); // DownnloadStatus : 1 for downloads

            ViewBag.LoadAjaxJS           = true;
            ViewBag.LoadValidationScript = true;
            ViewBag.Authorized           = true;
            ViewBag.Title = "Downloads";
            return(View(DownloadedNotes));
        }