Exemplo n.º 1
0
        public ActionResult UserVideo(ProfileModel Model)
        {
            UserBM CurrentUser = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
            if (CurrentUser != null)
            {
                if (Model.UserVideoModel.Id == 0)
                {

                    UserVideoBM UserVideoBM = new UserVideoBM();
                    UserVideoBM.VideoResumeUrl = Model.UserVideoModel.VideoResumeUrl;
                    UserVideoBM.ArtWorkYouTube1 = Model.UserVideoModel.ArtWorkYouTube1;
                    UserVideoBM.ArtWorkYouTube2 = Model.UserVideoModel.ArtWorkYouTube2;
                    UserVideoBM.ArtWorkYouTube3 = Model.UserVideoModel.ArtWorkYouTube3;
                    UserVideoBM.ArtWorkYouTube4 = Model.UserVideoModel.ArtWorkYouTube4;
                    UserVideoBM.ArtWorkYouTube5 = Model.UserVideoModel.ArtWorkYouTube5;
                    UserVideoBM.ArtWorkUrl1 = Model.UserVideoModel.ArtWorkUrl1;
                    UserVideoBM.ArtWorkUrl2 = Model.UserVideoModel.ArtWorkUrl2;
                    UserVideoBM.ArtWorkUrl3 = Model.UserVideoModel.ArtWorkUrl3;

                    UserVideoBM.UserId = CurrentUser.Id;
                    UserVideoBM.CreatedBy = CurrentUser.Id;
                    UserVideoBM.CreationDate = DateTime.Now;
                    UserVideoBL.Create(UserVideoBM);
                    TempData["Success"] = "Record saved Successfully.";
                }
                else
                {
                    UserVideoBM UserVideoBM = UserVideoBL.GetUserVideo().Where(p => p.UserId == CurrentUser.Id).FirstOrDefault();

                    UserVideoBM.VideoResumeUrl = Model.UserVideoModel.VideoResumeUrl;
                    UserVideoBM.ArtWorkYouTube1 = Model.UserVideoModel.ArtWorkYouTube1;
                    UserVideoBM.ArtWorkYouTube2 = Model.UserVideoModel.ArtWorkYouTube2;
                    UserVideoBM.ArtWorkYouTube3 = Model.UserVideoModel.ArtWorkYouTube3;
                    UserVideoBM.ArtWorkYouTube4 = Model.UserVideoModel.ArtWorkYouTube4;
                    UserVideoBM.ArtWorkYouTube5 = Model.UserVideoModel.ArtWorkYouTube5;
                    UserVideoBM.ArtWorkUrl1 = Model.UserVideoModel.ArtWorkUrl1;
                    UserVideoBM.ArtWorkUrl2 = Model.UserVideoModel.ArtWorkUrl2;
                    UserVideoBM.ArtWorkUrl3 = Model.UserVideoModel.ArtWorkUrl3;

                    UserVideoBM.UserId = CurrentUser.Id;
                    UserVideoBM.CreatedBy = CurrentUser.Id;
                    UserVideoBM.CreationDate = DateTime.Now;
                    UserVideoBM.ModifiedBy = CurrentUser.Id;
                    UserVideoBM.ModificationDate = DateTime.Now;
                    UserVideoBL.Update(UserVideoBM);
                }

            }
            else
            {
                TempData["Error"] = "Please Login.";
            }

            return RedirectToAction("EditProfile");
        }
Exemplo n.º 2
0
        public ActionResult UserQualification(ProfileModel Model)
        {
            UserBM CurrentUser = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
            if (CurrentUser != null)
            {

                UserQualificatinBM UserQualificatinBM = new UserQualificatinBM();
                UserQualificatinBM.SchoolName = Model.UserQualificatinModel.SchoolName;
                UserQualificatinBM.Degree = Model.UserQualificatinModel.Degree;
                UserQualificatinBM.Percentage = Model.UserQualificatinModel.Percentage;
                UserQualificatinBM.Description = Model.UserQualificatinModel.Description;
                UserQualificatinBM.StartDate = Model.UserQualificatinModel.StartDate;
                UserQualificatinBM.EndDate = Model.UserQualificatinModel.EndDate;
                UserQualificatinBM.Specialization = Model.UserQualificatinModel.Specialization;
                UserQualificatinBM.UserId = CurrentUser.Id;
                UserQualificatinBM.CreatedBy = CurrentUser.Id;
                UserQualificatinBM.CreationDate = DateTime.Now;
                UserQualificationBL.Create(UserQualificatinBM);
                TempData["Success"] = "Record saved Successfully.";

            }
            else
            {
                TempData["Error"] = "Please Login.";
            }

            return RedirectToAction("EditProfile");
        }
Exemplo n.º 3
0
        public ActionResult UserProfessionalQualification(ProfileModel Model, FormCollection collection)
        {
            UserBM CurrentUser = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
            if (CurrentUser != null)
            {

                UserProfessionalQualificationBM UserProfessionalQualificationBM = new UserProfessionalQualificationBM();
                if (Model.UserProfessionalQualificationModel.Id == 0)
                {
                    UserProfessionalQualificationBM.IsCurrentJob = Model.UserProfessionalQualificationModel.IsCurrentJob;
                    UserProfessionalQualificationBM.CompanyName = Model.UserProfessionalQualificationModel.CompanyName;
                    UserProfessionalQualificationBM.StartDate = Model.UserProfessionalQualificationModel.StartDate;
                    UserProfessionalQualificationBM.EndDate = Model.UserProfessionalQualificationModel.EndDate;
                    UserProfessionalQualificationBM.Designation = Convert.ToInt32(collection["DesignationType"].ToString());//Note remove DS
                    UserProfessionalQualificationBM.Salary = Model.UserProfessionalQualificationModel.Salary;
                    UserProfessionalQualificationBM.UserRole = Model.UserProfessionalQualificationModel.UserRole;
                    UserProfessionalQualificationBM.Skill = Model.UserProfessionalQualificationModel.Skill;
                    UserProfessionalQualificationBM.IndustryTypeId = Model.UserProfessionalQualificationModel.IndustryTypeId;
                    UserProfessionalQualificationBM.UserId = CurrentUser.Id;
                    UserProfessionalQualificationBM.CreatedBy = CurrentUser.Id;
                    UserProfessionalQualificationBM.CreationDate = DateTime.Now;

                    UserProfessionalQualificationBL.Create(UserProfessionalQualificationBM);
                    TempData["Success"] = "Record saved Successfully.";
                }
                else
                {
                    UserProfessionalQualificationBM UserProfessionalQualificationBMupdate = new UserProfessionalQualificationBM();
                    UserProfessionalQualificationBMupdate = UserProfessionalQualificationBL.GetProfessionalQualificationById(Model.UserProfessionalQualificationModel.Id);

                    //UserProfessionalQualificationBMupdate.Id = Model.UserProfessionalQualificationModel.Id;
                    UserProfessionalQualificationBMupdate.IsCurrentJob = Model.UserProfessionalQualificationModel.IsCurrentJob;
                    UserProfessionalQualificationBMupdate = UserProfessionalQualificationBL.GetProfessionalQualificationById(Model.UserProfessionalQualificationModel.Id);
                    UserProfessionalQualificationBMupdate.CompanyName = Model.UserProfessionalQualificationModel.CompanyName;
                    UserProfessionalQualificationBMupdate.StartDate = Model.UserProfessionalQualificationModel.StartDate;
                    UserProfessionalQualificationBMupdate.EndDate = Model.UserProfessionalQualificationModel.EndDate;
                    UserProfessionalQualificationBMupdate.Designation = Convert.ToInt32(collection["DesignationType"].ToString());//Note remove DS
                    UserProfessionalQualificationBMupdate.Salary = Model.UserProfessionalQualificationModel.Salary;
                    UserProfessionalQualificationBMupdate.UserRole = Model.UserProfessionalQualificationModel.UserRole;
                    UserProfessionalQualificationBMupdate.Skill = Model.UserProfessionalQualificationModel.Skill;
                    UserProfessionalQualificationBMupdate.IndustryTypeId = Model.UserProfessionalQualificationModel.IndustryTypeId;
                    UserProfessionalQualificationBMupdate.UserId = CurrentUser.Id;
                    UserProfessionalQualificationBMupdate.CreatedBy = CurrentUser.Id;
                    UserProfessionalQualificationBMupdate.CreationDate = DateTime.Now;

                    UserProfessionalQualificationBL.Update(UserProfessionalQualificationBMupdate);
                    TempData["Success"] = "Record saved Successfully.";
                }

            }
            else
            {
                TempData["Error"] = "Please Login.";
            }

            return RedirectToAction("EditProfile");
        }
Exemplo n.º 4
0
        public ActionResult UpdatePersonalInformation(ProfileModel Model, FormCollection collection)
        {
            UserBM CurrentUser = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
            if (CurrentUser != null)
            {
                string test = collection["hdCommunityName"].ToString();
                string test2 = collection["hdSubCommunityName"].ToString();
                UserBL UserBL = new UserBL();
                CurrentUser.CountryId = Model.UserBM.CountryId;
                CurrentUser.StateId = Model.UserBM.StateId;
                CurrentUser.CityId = Model.UserBM.CityId;
                CurrentUser.CommunityId = Model.UserBM.CommunityId;
                CurrentUser.SubCommunityId = Model.UserBM.SubCommunityId;
                if (!string.IsNullOrEmpty(collection["hdCommunityName"].ToString()))
                    CurrentUser.CommunityName = collection["hdCommunityName"].ToString();
                if (!string.IsNullOrEmpty(collection["hdSubCommunityName"].ToString()))
                    CurrentUser.SubCommunityName = collection["hdSubCommunityName"].ToString();

                UserBL.UpdateUser(CurrentUser);
                SessionManager.InstanceCreator.Set<UserBM>(CurrentUser, SessionKey.User);
                TempData["Success"] = "Record saved Successfully.";

            }
            else
            {
                TempData["Error"] = "Please Login.";
            }

            return RedirectToAction("EditProfile");
        }
Exemplo n.º 5
0
        public ActionResult UpdateGeneralInformation(ProfileModel Model, HttpPostedFileBase file, FormCollection collection)
        {
            UserBM CurrentUser = SessionManager.InstanceCreator.Get<UserBM>(SessionKey.User);
            if (CurrentUser != null)
            {
                try
                {
                    if (Model.UserGeneralInformationModel.Id == 0)
                    {
                        if (file != null)
                        {
                            UserGeneralInformationBL UserGeneralInformationBL = new BL.BusinessLayer.UserGeneralInformationBL();

                            string ImageName = System.IO.Path.GetFileName(file.FileName);
                            string physicalPath = Server.MapPath("~/Images/" + ImageName);
                            file.SaveAs(physicalPath);
                            UserGeneralInformationBM UserGeneralInformation = new UserGeneralInformationBM();

                            UserGeneralInformation.Image = "/Images/" + ImageName;

                            UserGeneralInformation.PhoneNumber = Model.UserGeneralInformationModel.PhoneNumber;
                            UserGeneralInformation.Address1 = Model.UserGeneralInformationModel.Address1;
                            UserGeneralInformation.Address2 = Model.UserGeneralInformationModel.Address2;
                            UserGeneralInformation.FatherName = Model.UserGeneralInformationModel.FatherName;
                            UserGeneralInformation.Status = Model.UserGeneralInformationModel.Status;
                            UserGeneralInformation.UserId = CurrentUser.Id;
                            UserGeneralInformation.CreatedBy = CurrentUser.Id;
                            UserGeneralInformation.CreationDate = DateTime.Now;
                            UserGeneralInformationBL.Create(UserGeneralInformation);
                            //  TempData["Success"] = "Record saved Successfully.";
                            TempData["Success"] = "Record saved Successfully.";

                        }
                    }
                    else
                    {
                        //update code
                        UserGeneralInformationBM UserGeneralInformationBM = UserGeneralInformationBL.GetGeneralInformationByUserId(CurrentUser.Id);
                        UserGeneralInformationBM.CommunityId = Model.UserGeneralInformationModel.CommunityId;
                        UserGeneralInformationBM.SubCommunityId = Model.UserGeneralInformationModel.SubCommunityId;
                        // UserGeneralInformationBM.Image = "/Images/" + ImageName;
                        if (file != null)
                        {

                            string ImageName = System.IO.Path.GetFileName(file.FileName);
                            string physicalPath = Server.MapPath("~/Images/" + ImageName);
                            file.SaveAs(physicalPath);
                            UserGeneralInformationBM.Image = "/Images/" + ImageName;
                        }
                        UserGeneralInformationBM.PhoneNumber = Model.UserGeneralInformationModel.PhoneNumber;
                        UserGeneralInformationBM.Address1 = Model.UserGeneralInformationModel.Address1;
                        UserGeneralInformationBM.Address2 = Model.UserGeneralInformationModel.Address2;
                        UserGeneralInformationBM.FatherName = Model.UserGeneralInformationModel.FatherName;
                        UserGeneralInformationBM.Status = Model.UserGeneralInformationModel.Status;
                        UserGeneralInformationBM.UserId = CurrentUser.Id;
                        UserGeneralInformationBM.ModifiedBy = CurrentUser.Id;
                        UserGeneralInformationBM.ModificationDate = DateTime.Now;
                        UserGeneralInformationBL.Update(UserGeneralInformationBM);

                        TempData["Success"] = "Record saved Successfully.";
                    }
                }
                catch (Exception ex)
                {
                    TempData["Error"] = "An Error Occured.";
                }

            }
            else
            {
                TempData["Error"] = "Please Login.";
            }

            return RedirectToAction("EditProfile");
        }
Exemplo n.º 6
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");
        }