Esempio n. 1
0
        public ActionResult Register()
        {
            UserModel Model = new UserModel();

            //    List<string> mylist = new List<string>({Id= "element1",Name= "element2" });
            CommunityBL CommunityBL = new BL.BusinessLayer.CommunityBL();

            Model.CommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId == 0).ToList();

            Model.SubCommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId != 0).ToList();
            return(View(Model));
        }
Esempio n. 2
0
        public ActionResult Profile()
        {
            CommonBL     commonBL    = new CommonBL();
            CommunityBL  CommunityBL = new BL.BusinessLayer.CommunityBL();
            CountryBL    CountryBL   = new BL.BusinessLayer.CountryBL();
            StateBL      StateBL     = new BL.BusinessLayer.StateBL();
            CityBL       CityBL      = new BL.BusinessLayer.CityBL();
            ProfileModel Model       = new ProfileModel();

            List <IndustryBM> IndustryList = commonBL.GetIndustry();

            Model.SucessMessage = (TempData["Success"] != null ? TempData["Success"].ToString() : string.Empty).ToString();
            Model.ErrorMessage  = (TempData["Error"] != null ? TempData["Error"].ToString() : string.Empty).ToString();

            if (Session["User"] != null)
            {
                UserBM CurrentUser = (UserBM)Session["User"];
                List <UserGeneralInformationBM> GenerealInfoList = UserGeneralInformationBL.GetGeneralInformation().Where(p => p.UserId == CurrentUser.Id).ToList();
                if (GenerealInfoList.Count > 0)
                {
                    Model.UserGeneralInformationModel = GenerealInfoList.FirstOrDefault();
                }
                if (Model.UserGeneralInformationModel == null)
                {
                    Model.UserGeneralInformationModel = new UserGeneralInformationBM();
                }

                List <UserVideoBM> UserVideoList = UserVideoBL.GetUserVideo().Where(p => p.UserId == CurrentUser.Id).ToList();
                if (UserVideoList.Count > 0)
                {
                    Model.UserVideoModel = UserVideoList.FirstOrDefault();
                }
                if (Model.UserVideoModel == null)
                {
                    Model.UserVideoModel = new UserVideoBM();
                }



                List <UserPersonalInformationBM> PersoalInfoList = UserPersonalInformationBL.GetPersonalInformation().Where(p => p.UserId == CurrentUser.Id).ToList();
                if (PersoalInfoList.Count > 0)
                {
                    Model.UserPersonalInformationModel = PersoalInfoList.FirstOrDefault();
                }
                if (Model.UserPersonalInformationModel == null)
                {
                    Model.UserPersonalInformationModel = new UserPersonalInformationBM();
                }



                Model.CommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId == 0).ToList();

                Model.SubCommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId != 0).ToList();
                Model.CountryList      = CountryBL.GetCountry();
                Model.StateList        = StateBL.GetState();
                Model.CityList         = CityBL.GetCities();

                return(View(Model));
            }
            return(RedirectToAction("Login"));
        }
Esempio n. 3
0
        public ActionResult Test()
        {
            UserModel Model = new UserModel();

            //    List<string> mylist = new List<string>({Id= "element1",Name= "element2" });
            CommunityBL CommunityBL = new BL.BusinessLayer.CommunityBL();

            Model.CommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId == 0).ToList();

            Model.SubCommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId != 0).ToList();
            return View(Model);
        }
Esempio n. 4
0
        public ActionResult EditProfile()
        {
            CommonBL commonBL = new CommonBL();
            CommunityBL CommunityBL = new BL.BusinessLayer.CommunityBL();
            CountryBL CountryBL = new BL.BusinessLayer.CountryBL();
            StateBL StateBL = new BL.BusinessLayer.StateBL();
            CityBL CityBL = new BL.BusinessLayer.CityBL();
            ProfileModel Model = new ProfileModel();

            List<IndustryBM> IndustryList = commonBL.GetIndustry();
            Model.SucessMessage = (TempData["Success"] != null ? TempData["Success"].ToString() : string.Empty).ToString();
            Model.ErrorMessage = (TempData["Error"] != null ? TempData["Error"].ToString() : string.Empty).ToString();

            if (SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User) != null)
            {

                UserBM CurrentUser = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
                Model.UserBM = CurrentUser;
                ViewBag.CurrentUser = CurrentUser.Name;
                List<UserGeneralInformationBM> GenerealInfoList = UserGeneralInformationBL.GetGeneralInformation().Where(p => p.UserId == CurrentUser.Id).ToList();
                if (GenerealInfoList.Count > 0)
                    Model.UserGeneralInformationModel = GenerealInfoList.FirstOrDefault();
                if (Model.UserGeneralInformationModel == null)
                    Model.UserGeneralInformationModel = new UserGeneralInformationBM();

                List<UserVideoBM> UserVideoList = UserVideoBL.GetUserVideo().Where(p => p.UserId == CurrentUser.Id).ToList();
                if (UserVideoList.Count > 0)
                    Model.UserVideoModel = UserVideoList.FirstOrDefault();
                if (Model.UserVideoModel == null)
                    Model.UserVideoModel = new UserVideoBM();

                //List<UserPersonalInformationBM> PersoalInfoList = UserPersonalInformationBL.GetPersonalInformation().Where(p => p.UserId == CurrentUser.Id).ToList();
                //if (PersoalInfoList.Count > 0)
                //    Model.UserPersonalInformationModel = PersoalInfoList.FirstOrDefault();
                //if (Model.UserPersonalInformationModel == null)
                //    Model.UserPersonalInformationModel = new UserPersonalInformationBM();

                Model.CommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId == 0).ToList();

                Model.SubCommunityList = CommunityBL.GetCommunity().Where(o => o.ParentId != 0).ToList();
                Model.CountryList = CountryBL.GetCountry();
                Model.StateList = StateBL.GetState();
                Model.CityList = CityBL.GetCities();

                return View(Model);
            }
            return RedirectToAction("Login");
        }