예제 #1
0
        //  public List<Designa> IndustryList { get; set; }

        public ProfileModel()
        {
            UserProfessionalQualificationModel = new UserProfessionalQualificationBM();
            IndustryList = commonBL.GetIndustry();
            DegreeList   = commonBL.GetDegree();
            UserGeneralInformationModel        = new UserGeneralInformationBM();
            UserPersonalInformationModel       = new UserPersonalInformationBM();
            UserProfessionalQualificationModel = new UserProfessionalQualificationBM();
            UserQualificatinModel = new UserQualificatinBM();
            UserVideoModel        = new UserVideoBM();
        }
예제 #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"));
        }