public List <InvestorListingsModel> GetFeaturedListingBottomSingleListing(string listingId = "")
        {
            var serialization          = new Serialization();
            var investorListingsBA     = new InvestorListings();
            var investorListingWrapper = new InvestorListingWrapper();
            var HashCriteria           = new Hashtable();
            var res = investorListingsBA.GetAllFeaturedList();

            investorListingWrapper.InvestorListings = (List <InvestorListingsModel>)(serialization.DeSerializeBinary(Convert.ToString(res)));
            if (investorListingWrapper.InvestorListings.Count > 4)
            {
                investorListingWrapper.FeaturedListings = investorListingWrapper.InvestorListings.GetRange(0, 4);
            }
            else
            {
                investorListingWrapper.FeaturedListings = investorListingWrapper.InvestorListings;
            }
            foreach (var item in investorListingWrapper.FeaturedListings)
            {
                item.ImagePath = CheckFileExists(item.ImagePath, "ListingImagePath", Convert.ToString(item.ID));
            }
            return(investorListingWrapper.FeaturedListings);
        }
        public ActionResult InvestorsListingDetails(int?page, InvestorListingWrapper model = null)
        {
            var    listingsBA = new Listings();
            var    serialization = new Serialization();
            var    investorListingsBA = new InvestorListings();
            var    HashCriteria = new Hashtable();
            var    actualCriteria = string.Empty;
            var    investorListingWrapper = new InvestorListingWrapper();
            string minPrincipalBalance = string.Empty, maxPrincipalBalance = string.Empty, minInterestRate = string.Empty, maxInterestRate = string.Empty;
            double minAskingPrice = 0.0, maxAskingPrice = 0.0;

            string[] principle_tokens, asking_tokens, interest_tokens;
            if (page != null)
            {
                model.LoanID          = Convert.ToInt32(Session["LoanID"]);
                model.LienPositionID  = Convert.ToInt32(Session["LienPositionID"]);
                model.LoanStatusID    = Convert.ToInt32(Session["LoanStatusID"]);
                model.State           = Convert.ToString(Session["State"]);
                model.LoanTypeID      = Convert.ToInt32(Session["LoanTypeID"]);
                model.Address         = Convert.ToString(Session["Address"]);
                model.PropertyTypeID  = Convert.ToInt32(Session["PropertyTypeID"]);
                model.PricipalBalance = Convert.ToString(Session["PricipalBalance"]);
                model.City            = Convert.ToString(Session["City"]);
                model.AskingPrice     = Convert.ToString(Session["AskingPrice"]);
                model.InterestRate    = Convert.ToString(Session["InterestRate"]);
            }
            else
            {
                RemoveTempDataForInvestor();
            }

            model.SortingOrder = "RecentlyPosted";
            var pageSize  = 3;
            var pageIndex = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            //Split the data for Principal Balanace, Asking value and Interest rate
            string principleBalance = Convert.ToString(model.PricipalBalance);

            if (principleBalance != "0" && principleBalance != null)
            {
                principle_tokens    = principleBalance.Split('-');
                minPrincipalBalance = principle_tokens[0];
                maxPrincipalBalance = principle_tokens[1];
            }
            else
            {
                minPrincipalBalance = "0";
                maxPrincipalBalance = "0";
            }

            string askingPrice = Convert.ToString(model.AskingPrice);

            if (askingPrice != "0" && askingPrice != null)
            {
                asking_tokens  = askingPrice.Split('-');
                minAskingPrice = Convert.ToDouble(asking_tokens[0]);
                maxAskingPrice = Convert.ToDouble(asking_tokens[1]);
            }
            else
            {
                minAskingPrice = 0.0;
                maxAskingPrice = 0.0;
            }

            string interestRate = Convert.ToString(model.InterestRate);

            if (interestRate != "0" && interestRate != null)
            {
                interest_tokens = interestRate.Split('-');
                minInterestRate = interest_tokens[0];
                maxInterestRate = interest_tokens[1];
            }
            else
            {
                minInterestRate = "0";
                maxInterestRate = "0";
            }

            var res = investorListingsBA.GetAllFeaturedList();

            investorListingWrapper.FeaturedListings          = (List <InvestorListingsModel>)(serialization.DeSerializeBinary(Convert.ToString(res)));
            investorListingWrapper.PagedListFeaturedListings = investorListingWrapper.FeaturedListings.ToPagedList(1, 4);

            HashCriteria.Add("LoanID", model.LoanID);
            HashCriteria.Add("LienPositionID", model.LienPositionID);
            HashCriteria.Add("LoanStatusID", model.ActualLoanStatusID);
            HashCriteria.Add("State", model.State);
            HashCriteria.Add("LoanTypeID", model.ListingTypeID);
            HashCriteria.Add("Address", model.Address);
            HashCriteria.Add("PropertyTypeID", model.PropertyTypeID);
            HashCriteria.Add("MinPrincipalBalance", minPrincipalBalance);
            HashCriteria.Add("MaxPrincipalBalance", maxPrincipalBalance);
            HashCriteria.Add("City", model.City);
            HashCriteria.Add("MinInterestRate", minInterestRate);
            HashCriteria.Add("MaxInterestRate", maxInterestRate);
            HashCriteria.Add("MinAskingPrice", minAskingPrice);
            HashCriteria.Add("MaxAskingPrice", maxAskingPrice);
            HashCriteria.Add("SortingOrder", model.SortingOrder);
            HashCriteria.Add("UserID", userID);
            actualCriteria = serialization.SerializeBinary((object)HashCriteria);
            var result = investorListingsBA.GetDealDetails(actualCriteria);

            investorListingWrapper.InvestorListings = (List <InvestorListingsModel>)(serialization.DeSerializeBinary(Convert.ToString(result)));
            var tempInvestorListings = new List <InvestorListingsModel>();

            foreach (var item in investorListingWrapper.InvestorListings)
            {
                tempInvestorListings.Add(item);
                item.ImagePath = CheckFileExists(item.ImagePath, "ListingImagePath", Convert.ToString(item.ID));
            }
            investorListingWrapper.PagedListInvestorListings = tempInvestorListings.ToPagedList(pageIndex, pageSize);
            foreach (var item in investorListingWrapper.PagedListFeaturedListings)
            {
                item.ImagePath = CheckFileExists(item.ImagePath, "ListingImagePath", Convert.ToString(item.ID));
            }
            investorListingWrapper.ListingTypeList = investorListingsBA.GetListingTypes();
            var resultListingLoanInfo = listingsBA.GetListingDefaultValuesForLoanInformation();
            var listingModel          = (LoanInformation)(serialization.DeSerializeBinary(Convert.ToString(resultListingLoanInfo)));

            investorListingWrapper.LienPosition = listingModel.LienPositionType;
            investorListingWrapper.ListingType  = listingsBA.GetListingLoanTypes();
            var resultListing   = listingsBA.GetListingDefaultValuesForPropertyInformation();
            var listingModelnew = (PropertyInformation)(serialization.DeSerializeBinary(Convert.ToString(resultListing)));

            investorListingWrapper.PropertyType = listingModelnew.PropertyType;
            return(View("InvestorsListingDetails", investorListingWrapper));
        }
Esempio n. 3
0
        public ActionResult SelectYourRole()
        {
            var           testimonialBA            = new Testimonial();
            var           sharedFunction           = new SharedFunctions();
            Hashtable     TestimonialsHashCriteria = new Hashtable();
            Serialization serializationTestimonial = new Serialization();
            string        actualCriteria;

            if (SessionController.UserSession.RoleType != null)
            {
                //Navigate admin to his dashboard
                if (SessionController.UserSession.RoleType == "Admin")
                {
                    return(RedirectToAction("InvestorsListingDetails", "InvestorListings"));
                }
                //To check if user is paid or not then show the contents
                var userID = Convert.ToInt64(SessionController.UserSession.UserId);
                if (userID > 0 && Convert.ToString(userID) != null)
                {
                    List <UserProfileEditModel> userprofileModel = sharedFunction.GetUserRole(userID);
                    UserProfileEditModel        userprofile      = userprofileModel.FirstOrDefault();
                    var IsPaid = Convert.ToBoolean(userprofile.IsPaid);
                    var IsActiveSubscription = Convert.ToBoolean(SessionController.UserSession.IsPaid);
                    if (IsActiveSubscription)
                    {
                        if (IsPaid)
                        {
                            if (SessionController.UserSession.RoleType == "Investor")
                            {
                                return(RedirectToAction("InvestorsListingDetails", "InvestorListings"));
                            }
                            if (SessionController.UserSession.RoleType == "Broker")
                            {
                                return(RedirectToAction("Broker", "Dashboard"));
                            }
                        }
                    }
                }
            }
            var homeModel = new HomePageModel();

            TestimonialsHashCriteria.Add("SortingOrder", "RecentlyPosted");
            TestimonialsHashCriteria.Add("SearchText", null);
            actualCriteria = serializationTestimonial.SerializeBinary((object)TestimonialsHashCriteria);

            homeModel.TestimonialList = testimonialBA.GetAllTestimonial(actualCriteria);

            if (homeModel.TestimonialList.Count > 5)
            {
                homeModel.TestimonialList = testimonialBA.GetAllTestimonial().OrderByDescending(x => x.CreatedDate).ToList();
                homeModel.TestimonialList = homeModel.TestimonialList.GetRange(0, 5);
            }

            foreach (var item in homeModel.TestimonialList)
            {
                item.ImagePath = CheckFileExists(item.ImagePath, "TestimonialImagePath", Convert.ToString(item.ID));
            }

            var serialization      = new Serialization();
            var investorListingsBA = new InvestorListings();
            var result             = investorListingsBA.GetAllFeaturedList();

            homeModel.FeaturedList = (List <InvestorListingsModel>)(serialization.DeSerializeBinary(Convert.ToString(result)));
            if (homeModel.FeaturedList.Count < 5)
            {
                homeModel.FeaturedList = homeModel.FeaturedList.GetRange(0, homeModel.FeaturedList.Count);
            }
            else
            {
                homeModel.FeaturedList = homeModel.FeaturedList.GetRange(0, 4);
            }
            foreach (var item in homeModel.FeaturedList)
            {
                item.ImagePath = CheckFileExists(item.ImagePath, "ListingImagePath", Convert.ToString(item.ID));
            }
            return(View("SelectYourRole", homeModel));
        }