Пример #1
0
        public ActionResult TestimonialListingDetailsPartial(int?page)
        {
            var testimonialBA    = new Testimonial();
            var Testimonialmodel = new TestimonialModelWrapper();
            var lstTestimonial   = testimonialBA.GetAllTestimonial();
            var pageSize         = 3;
            var pageIndex        = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            foreach (var item in lstTestimonial)
            {
                item.ImagePath = CheckFileExists(item.ImagePath, "TestimonialImagePath", Convert.ToString(item.ID));
            }
            var lstTestimonialPages = lstTestimonial.ToPagedList(pageIndex, pageSize);

            return(PartialView("_TestimonialList", lstTestimonialPages));
        }
Пример #2
0
        public ActionResult GetAllTestimonial(int?page)
        {
            var pageSize  = 3;
            var pageIndex = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            var testimonialBA = new Testimonial();

            Session["TestimonialImages"] = null;
            var lstTestimonial = testimonialBA.GetAllTestimonial();

            foreach (var item in lstTestimonial)
            {
                item.ImagePath = CheckFileExists(item.ImagePath, "TestimonialImagePath", Convert.ToString(item.ID));
            }
            var lstTestimonialPages = lstTestimonial.ToPagedList(pageIndex, pageSize);

            return(View("Index", lstTestimonialPages));
        }
Пример #3
0
        public ActionResult Admin(int?page, string Tab = null, string sortingOrder = "RecentlyPosted", string searchText = "")
        {
            searchText = searchText.Replace("'", "''");
            Serialization    serialization            = new Serialization();
            DashboardWrapper dashboardWrapper         = new DashboardWrapper();
            Hashtable        HashCriteria             = new Hashtable();
            Hashtable        UsersHashCriteria        = new Hashtable();
            Hashtable        ResourcesHashCriteria    = new Hashtable();
            Hashtable        TestimonialsHashCriteria = new Hashtable();

            string actualCriteria;

            actualCriteria = serialization.SerializeBinary((object)HashCriteria);

            int pageSize  = 8;
            int pageIndex = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;

            if (Tab == "Users")
            {
                UserRegistration userRecords = new UserRegistration();
                UsersHashCriteria.Add("Name", searchText);
                UsersHashCriteria.Add("SortingOrder", sortingOrder);
                actualCriteria = serialization.SerializeBinary((object)UsersHashCriteria);
                var users = userRecords.GetUserSpecificDetails(actualCriteria);
                dashboardWrapper.Users          = (List <UserProfileEditModel>)(serialization.DeSerializeBinary(Convert.ToString(users)));
                dashboardWrapper.PagedListUsers = dashboardWrapper.Users.ToPagedList(pageIndex, pageSize);

                return(PartialView("_AdminUsersTab", dashboardWrapper.PagedListUsers));
            }
            else if (Tab == "Resources")
            {
                Learn learnBA = new Learn();
                ResourcesHashCriteria.Add("SortingOrder", sortingOrder);
                ResourcesHashCriteria.Add("SearchText", searchText);
                ResourcesHashCriteria.Add("IsAdminDashboard", "1");
                actualCriteria = serialization.SerializeBinary((object)ResourcesHashCriteria);
                var resourcesList = learnBA.GetLearnListingDetails(actualCriteria);
                dashboardWrapper.Resources         = (List <LearnModel>)(serialization.DeSerializeBinary(Convert.ToString(resourcesList)));
                dashboardWrapper.PagedListResource = dashboardWrapper.Resources.ToPagedList(pageIndex, pageSize);
                return(PartialView("_AdminResourcesTab", dashboardWrapper.PagedListResource));
            }
            else if (Tab == "Testimonials")
            {
                Testimonial testimonialBA = new Testimonial();
                TestimonialsHashCriteria.Add("SortingOrder", sortingOrder);
                TestimonialsHashCriteria.Add("SearchText", searchText);
                actualCriteria = serialization.SerializeBinary((object)TestimonialsHashCriteria);
                dashboardWrapper.Testimonials         = testimonialBA.GetAllTestimonial(actualCriteria);
                dashboardWrapper.PagedListTestimonial = dashboardWrapper.Testimonials.ToPagedList(pageIndex, pageSize);
                return(PartialView("_AdminTestimonialsTab", dashboardWrapper.PagedListTestimonial));
            }
            else
            {
                InvestorListings       investorListings       = new InvestorListings();
                InvestorListingWrapper investorListingWrapper = new InvestorListingWrapper();
                investorListingWrapper.SortingOrder   = sortingOrder;
                investorListingWrapper.ListingTypeIds = string.Empty;
                HashCriteria.Add("ID", investorListingWrapper.ListingTypeIds);
                HashCriteria.Add("LocationName", investorListingWrapper.LocationName);
                HashCriteria.Add("SortingOrder", investorListingWrapper.SortingOrder);
                HashCriteria.Add("Name", searchText);
                HashCriteria.Add("LoanID", investorListingWrapper.LoanID);
                HashCriteria.Add("LienPositionID", investorListingWrapper.LienPositionID);
                HashCriteria.Add("LoanStatusID", investorListingWrapper.LoanStatusID);
                HashCriteria.Add("State", investorListingWrapper.State);
                HashCriteria.Add("LoanTypeID", investorListingWrapper.LoanTypeID);
                HashCriteria.Add("Address", investorListingWrapper.Address);
                HashCriteria.Add("PropertyTypeID", investorListingWrapper.PropertyTypeID);
                HashCriteria.Add("MinPrincipalBalance", 0);
                HashCriteria.Add("MaxPrincipalBalance", 0);
                HashCriteria.Add("City", investorListingWrapper.City);
                HashCriteria.Add("MinInterestRate", 0);
                HashCriteria.Add("MaxInterestRate", 0);
                HashCriteria.Add("MinAskingPrice", 0);
                HashCriteria.Add("MaxAskingPrice", 0);
                HashCriteria.Add("UserID", userID);
                actualCriteria = serialization.SerializeBinary((object)HashCriteria);
                var listing = investorListings.GetDealDetails(actualCriteria);
                dashboardWrapper.InvestorAdminListing   = (List <InvestorListingsModel>)(serialization.DeSerializeBinary(Convert.ToString(listing)));
                dashboardWrapper.PagedListAdminListings = dashboardWrapper.InvestorAdminListing.ToPagedList(pageIndex, pageSize);

                //Users default load
                actualCriteria = string.Empty;
                UserRegistration userRecords = new UserRegistration();
                UsersHashCriteria.Add("SortingOrder", sortingOrder);
                actualCriteria         = serialization.SerializeBinary((object)UsersHashCriteria);
                dashboardWrapper.Users = new List <UserProfileEditModel>();
                var users = userRecords.GetUserSpecificDetails(actualCriteria);
                dashboardWrapper.Users          = (List <UserProfileEditModel>)(serialization.DeSerializeBinary(Convert.ToString(users)));
                dashboardWrapper.PagedListUsers = dashboardWrapper.Users.ToPagedList(pageIndex, pageSize);

                //Resources default load
                actualCriteria = string.Empty;
                Learn learnBA = new Learn();
                //For Learn
                LearnModel learn = new LearnModel();

                ResourcesHashCriteria.Add("SortingOrder", sortingOrder);
                ResourcesHashCriteria.Add("IsAdminDashboard", "1");
                actualCriteria = serialization.SerializeBinary((object)ResourcesHashCriteria);
                var resourcesList = learnBA.GetLearnListingDetails(actualCriteria);
                dashboardWrapper.Resources         = (List <LearnModel>)(serialization.DeSerializeBinary(Convert.ToString(resourcesList)));
                dashboardWrapper.PagedListResource = dashboardWrapper.Resources.ToPagedList(pageIndex, pageSize);

                Testimonial testimonialBA = new Testimonial();
                TestimonialsHashCriteria.Add("SortingOrder", sortingOrder);
                TestimonialsHashCriteria.Add("SearchText", searchText);
                actualCriteria = serialization.SerializeBinary((object)TestimonialsHashCriteria);
                dashboardWrapper.Testimonials         = testimonialBA.GetAllTestimonial(actualCriteria);
                dashboardWrapper.PagedListTestimonial = dashboardWrapper.Testimonials.ToPagedList(pageIndex, pageSize);

                if (Tab != null)
                {
                    return(PartialView("_AdminListingsTab", dashboardWrapper.PagedListAdminListings));
                }
                return(View("AdminDashboard", dashboardWrapper));
            }
        }
Пример #4
0
        public ActionResult HomePage()
        {
            if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated && SessionController.UserSession.UserId == null)
            {
                return(RedirectToAction("LogOff", "Login"));
            }
            var           testimonialBA            = new Testimonial();
            var           homePageBA               = new HomePage();
            var           homeModel                = new HomePageModel();
            var           testimonialModel         = new TestimonialModel();
            var           lstResources             = new List <HomePageLatestResources>();
            Hashtable     TestimonialsHashCriteria = new Hashtable();
            Serialization serialization            = new Serialization();
            string        actualCriteria;

            homeModel.resourceList = homePageBA.GetLatestNewsandArticlesForHomePage();
            homeModel.brokerList   = homePageBA.GetListingDetailsForHomePage();
            //Get latest 3 resources with images, show teaser content and teaser content is less than 3 then show basic content
            foreach (var resource in homeModel.resourceList)
            {
                if (resource.ContentType == 0)
                {
                    lstResources.Add(resource);
                }
            }
            if (lstResources.Count < 3)
            {
                foreach (var resource in homeModel.resourceList)
                {
                    if (resource.ContentType == 1)
                    {
                        lstResources.Add(resource);
                    }
                }
            }
            homeModel.resourceList = lstResources;
            foreach (var resource in homeModel.resourceList)
            {
                if (resource.ContentFor == (Convert.ToInt32(ContentFor.All)))
                {
                    resource.ContentName = Convert.ToString(ContentFor.All);
                }
                else if (resource.ContentFor == (Convert.ToInt32(ContentFor.Investor)))
                {
                    resource.ContentName = Convert.ToString(ContentFor.Investor);
                }
                else if (resource.ContentFor == (Convert.ToInt32(ContentFor.Broker)))
                {
                    resource.ContentName = Convert.ToString(ContentFor.Broker);
                }
                resource.LearnCategory = resource.LearnCategory;
            }

            if (homeModel.brokerList.Count > 3)
            {
                homeModel.brokerList = homePageBA.GetListingDetailsForHomePage().GetRange(0, 4);
            }

            foreach (var item in homeModel.brokerList)
            {
                item.ImagePath = CheckFileExists(item.ImagePath, "ListingImagePath", Convert.ToString(item.ID));
            }
            foreach (var item in homeModel.resourceList)
            {
                item.ImagePath = CheckFileExists(item.ImagePath, "LearnImagePath", Convert.ToString(item.ID));
            }

            TestimonialsHashCriteria.Add("SortingOrder", "RecentlyPosted");
            TestimonialsHashCriteria.Add("SearchText", null);
            actualCriteria = serialization.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));
            }
            return(View(homeModel));
        }
Пример #5
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));
        }