public ActionResult MainPage() { var viewModel = new MainPageViewModel(); //creates new mainpageviewmodel using (var db = new FurryEntities()) //creating a new furryentities called db....allows access to the db { List <Profile> profiles = db.Profiles.ToList(); //grabbing all the profiles from the db foreach (var profile in profiles) //goes through each profile { var viewModelProfile = new ViewProfile { ProfileId = profile.ProfileId, DisplayName = profile.DisplayName, Gender = profile.Gender, GenderSeeking = profile.GenderSeeking, Avatar = profile.Avatar, City = profile.City }; //creates the parameters of the view model viewModel.Profiles.Add(viewModelProfile); //adds this profile to the viewmodel's list } } return(View(viewModel)); //returns view, passing viewmodel to it }
void InitializeComponents() { //Booleano para el botón edit. editModeEnabled = false; //A ambos se les pone ese atributo. LblProfile.Hidden = LblBottom.Hidden = true; //El Enabled = false es para que esté deshabilitada la gestura por default. //Para el profile. profileTapGesture = new UITapGestureRecognizer(ShowOptions) { Enabled = false }; ViewProfile.AddGestureRecognizer(profileTapGesture); //Para el bottom. bottomTapGesture = new UITapGestureRecognizer(ShowOptions) { Enabled = false }; ViewBottom.AddGestureRecognizer(bottomTapGesture); BtnEdit.Clicked += BtnEdit_Clicked; }
void OnClicViewDetails(GameObject go) { if (player.slotServer == GameModelPhom.YourController.slotServer) { return; } ViewProfile.Create(player); }
public ActionResult AllProfiles(int Id) { ViewProfile vp = new ViewProfile(); vp.User = lh.GetUser(Id); vp.Profiles = lh.GetProfiles(Id); return(View(vp)); }
public async Task <ActionResult> ViewProfile(ViewProfile model) { if (!ModelState.IsValid) { return(View(model)); } var store = new UserStore <ApplicationUser>(new ApplicationDbContext()); var manager = new UserManager <ApplicationUser>(store); var currentUser = manager.FindByEmail(model.Email); currentUser.Email = model.Email; currentUser.FirstName = model.FirstName; currentUser.LastName = model.LastName; currentUser.PhoneNumber = model.PhoneNumber; currentUser.ShortDescription = model.ShortDescription; currentUser.UserPhoto = model.UserPhoto; currentUser.DateOfBirth = model.DateOfBirth; currentUser.Work_Title1 = model.Work_Title1; currentUser.Work_Title2 = model.Work_Title2; currentUser.Work_TItle3 = model.Work_TItle3; currentUser.Work_Name1 = model.Work_Name1; currentUser.Work_Name2 = model.Work_Name2; currentUser.Work_Name3 = model.Work_Name3; currentUser.Work_Description1 = model.Work_Description1; currentUser.Work_Description2 = model.Work_Description2; currentUser.Work_Description3 = model.Work_Description3; currentUser.Work_DateStart1 = model.Work_DateStart1; currentUser.Work_DateStart2 = model.Work_DateStart2; currentUser.Work_DateStart3 = model.Work_DateStart3; currentUser.Work_DateEnd1 = model.Work_DateEnd1; currentUser.Work_DateEnd2 = model.Work_DateEnd2; currentUser.Work_DateEnd3 = model.Work_DateEnd3; currentUser.Edu_Title1 = model.Edu_Title1; currentUser.Edu_Title2 = model.Edu_Title2; currentUser.Edu_Title3 = model.Edu_Title3; currentUser.Edu_School1 = model.Edu_School1; currentUser.Edu_School2 = model.Edu_School2; currentUser.Edu_School3 = model.Edu_School3; currentUser.Edu_Description1 = model.Edu_Description1; currentUser.Edu_Description2 = model.Edu_Description2; currentUser.Edu_Description3 = model.Edu_Description3; currentUser.Edu_DateStart1 = model.Edu_DateStart1; currentUser.Edu_DateStart2 = model.Edu_DateStart2; currentUser.Edu_DateStart3 = model.Edu_DateStart3; currentUser.Edu_DateEnd1 = model.Edu_DateEnd1; currentUser.Edu_DateEnd2 = model.Edu_DateEnd2; currentUser.Edu_DateEnd3 = model.Edu_DateEnd3; currentUser.Skill1 = model.Skill1; currentUser.Skill2 = model.Skill2; currentUser.Skill3 = model.Skill3; currentUser.Hobbies_Desc = model.Hobbies_Desc; currentUser.Visibility = model.Visibility; currentUser.Success = model.Success; currentUser.CV_Category = model.CV_Category; return(RedirectToAction("ListCV")); }
public ActionResult ViewProfile(string email) { ApplicationUser appUser = new ApplicationUser(); appUser = UserManager.FindByEmail(email); ViewProfile cv = new ViewProfile(); cv.Email = appUser.Email; cv.FirstName = appUser.FirstName; cv.LastName = appUser.LastName; cv.PhoneNumber = appUser.PhoneNumber; cv.ShortDescription = appUser.ShortDescription; cv.UserPhoto = appUser.UserPhoto; cv.DateOfBirth = appUser.DateOfBirth; cv.Work_Title1 = appUser.Work_Title1; cv.Work_Title2 = appUser.Work_Title2; cv.Work_TItle3 = appUser.Work_TItle3; cv.Work_Name1 = appUser.Work_Name1; cv.Work_Name2 = appUser.Work_Name2; cv.Work_Name3 = appUser.Work_Name3; cv.Work_Description1 = appUser.Work_Description1; cv.Work_Description2 = appUser.Work_Description2; cv.Work_Description3 = appUser.Work_Description3; cv.Work_DateStart1 = appUser.Work_DateStart1; cv.Work_DateStart2 = appUser.Work_DateStart2; cv.Work_DateStart3 = appUser.Work_DateStart3; cv.Work_DateEnd1 = appUser.Work_DateEnd1; cv.Work_DateEnd2 = appUser.Work_DateEnd2; cv.Work_DateEnd3 = appUser.Work_DateEnd3; cv.Edu_Title1 = appUser.Edu_Title1; cv.Edu_Title2 = appUser.Edu_Title2; cv.Edu_Title3 = appUser.Edu_Title3; cv.Edu_School1 = appUser.Edu_School1; cv.Edu_School2 = appUser.Edu_School2; cv.Edu_School3 = appUser.Edu_School3; cv.Edu_Description1 = appUser.Edu_Description1; cv.Edu_Description2 = appUser.Edu_Description2; cv.Edu_Description3 = appUser.Edu_Description3; cv.Edu_DateStart1 = appUser.Edu_DateStart1; cv.Edu_DateStart2 = appUser.Edu_DateStart2; cv.Edu_DateStart3 = appUser.Edu_DateStart3; cv.Edu_DateEnd1 = appUser.Edu_DateEnd1; cv.Edu_DateEnd2 = appUser.Edu_DateEnd2; cv.Edu_DateEnd3 = appUser.Edu_DateEnd3; cv.Skill1 = appUser.Skill1; cv.Skill2 = appUser.Skill2; cv.Skill3 = appUser.Skill3; cv.Hobbies_Desc = appUser.Hobbies_Desc; cv.Visibility = appUser.Visibility; cv.Success = appUser.Success; cv.CV_Category = appUser.CV_Category; return(View(cv)); }
private void ViewProfileExecute() { try { ViewProfile viewProfile = new ViewProfile(User.UserID); viewProfile.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public ActionResult AllProfiles1() { if (Session["userId"] != null) { User user = lh.GetUser(Convert.ToInt32(Session["UserId"])); ViewProfile viewprofile = new ViewProfile(); viewprofile.User = user; viewprofile.Profiles = lh.GetProfiles(user.Id); return(View(viewprofile)); } else { return(RedirectToAction("Home", "Student")); } }
public ActionResult Profile() { var cookievalue = FormsAuthentication.Decrypt(Request.Cookies[FormsAuthentication.FormsCookieName].Value); ViewProfile viewModel; using (var db = new MyWordEntities()) { var profile = db.Profiles.FirstOrDefault(x => x.ProfileId == new Guid(cookievalue.UserData)); viewModel = new ViewProfile { DisplayName = profile.DisplayName, Comment = profile.Comment, Email = profile.Email, }; } return(View(viewModel)); }
public async Task <IActionResult> ViewProfile(int?id) { if (id == null) { NotFound(); } var user = await _userManager.Users.FirstOrDefaultAsync(u => u.Id == id); var model = new ViewProfile() { UserName = user.UserName, Email = user.Email, DateJoined = user.DateJoined, UserCars = _context.Cars.Where(c => c.UserId == user.Id).ToList(), CarsAmount = _context.Cars.Where(c => c.UserId == user.Id).Count(), UserPictures = _context.Pictures.Where(p => p.UserId == user.Id).ToList(), City = user.City }; return(View(model)); }
public ActionResult ViewProfile() { var email = (string)Session["Email"]; Patient pa = new Data.Patient(); pa = obj1.Patients.Where(m => m.email == email).FirstOrDefault(); ViewProfile obj = new ViewProfile(); obj.email = pa.email; obj.id = pa.id; obj.Address = pa.address; obj.blood_group = pa.blood_group; obj.name = pa.name; obj.contact = pa.contact; obj.emergency_contact = pa.emergency_contact; obj.gender = pa.gender; obj.date = pa.dob != null ? (pa.dob.ToString()).Split(' ')[0] : string.Empty; return(View(obj)); }
public ActionResult Dashboard() { if (Request.Cookies["user"] != null && Request.Cookies["user"]["Role"] == "Teacher") { if ((new LearningHandler().GetNumberOfProfiles(Request.Cookies["user"]["Email"])) < 5) { ViewBag.TotalProfiles = true; } else { ViewBag.TotalProfiles = false; } string id = Request.Cookies["user"]["Id"]; ViewProfile vp = new ViewProfile(); vp.Profiles = new LearningHandler().GetProfiles(int.Parse(id)).ToList(); vp.User = new LearningHandler().GetUser(int.Parse(id)); return(View(vp)); } else { return(RedirectToAction("Login", "Account")); } }
public ActionResult AppUserProfile() { var cookievalue = FormsAuthentication.Decrypt(Request.Cookies[FormsAuthentication.FormsCookieName].Value); ViewProfile viewModel; using (var db = new FurryEntities()) { var profile = db.Profiles.FirstOrDefault(x => x.ProfileId == new Guid(cookievalue.UserData)); viewModel = new ViewProfile { ProfileId = profile.ProfileId, AboutMe = profile.AboutMe, Avatar = profile.Avatar, Birthdate = profile.Birthdate, City = profile.City, Country = profile.Country, DisplayName = profile.DisplayName, Gender = profile.Gender, GenderSeeking = profile.GenderSeeking, JsonAttributes = profile.JsonAttributes, }; } return(View(viewModel)); }
void OnClickBtnInfo(GameObject targetObject) { ViewProfile.Create(mUser); }
public ActionResult Detail(string profileID) { ProDetailViewModel model = new ProDetailViewModel(); if (!String.IsNullOrEmpty(profileID)) { int profileIDNum = 0; try { profileIDNum = Int32.Parse(profileID); } catch (Exception) { TempData["errormessage"] = "Lỗi dữ liệu!"; return(RedirectToAction("Index", "Home")); } model.profile = profileUnitOfWork.ProfileRepository.GetByID(profileIDNum); if (model.profile != null && model.profile.IsDeleted == false) { AspNetUser recruiter = profileUnitOfWork.AspNetUserRepository.Get(ss => ss.UserName == User.Identity.Name).FirstOrDefault(); ViewProfile viewProfile = profileUnitOfWork.ViewProfileRepository.Get(s => s.RecruiterID == recruiter.Id && s.ProfileID == profileIDNum).FirstOrDefault(); if (viewProfile == null) { ViewProfile newViewProfile = new ViewProfile(); newViewProfile.RecruiterID = recruiter.Id; newViewProfile.ProfileID = profileIDNum; newViewProfile.ViewedDate = DateTime.Now; profileUnitOfWork.ViewProfileRepository.Insert(newViewProfile); profileUnitOfWork.Save(); } else { viewProfile.ViewedDate = DateTime.Now; profileUnitOfWork.ViewProfileRepository.Update(viewProfile); profileUnitOfWork.Save(); } model.cities = profileUnitOfWork.CityRepository.Get(filter: d => d.IsDeleted == false).OrderBy(d => d.Name).AsEnumerable(); model.schoolLevels = profileUnitOfWork.SchoolLevelRepository.Get(filter: d => d.IsDeleted == false).OrderByDescending(d => d.LevelNum).AsEnumerable(); model.languages = profileUnitOfWork.LanguageRepository.Get(filter: d => d.IsDeleted == false).OrderBy(d => d.Name).AsEnumerable(); model.levels = profileUnitOfWork.LevelRepository.Get(filter: d => d.IsDeleted == false).OrderByDescending(d => d.LevelNum).AsEnumerable(); model.jobLevels = profileUnitOfWork.JobLevelRepository.Get(filter: d => d.IsDeleted == false).OrderByDescending(d => d.LevelNum).AsEnumerable(); model.categories = profileUnitOfWork.CategoryRepository.Get(filter: d => d.IsDeleted == false).OrderBy(d => d.Name).AsEnumerable(); ExpectedCity expectedCity = profileUnitOfWork.ExpectedCityRepository.Get(filter: d => d.ProfileID == profileIDNum && d.IsDeleted == false).FirstOrDefault(); if (expectedCity != null) { model.expectedCity = expectedCity.CityID; } ExpectedCategory expectedCategory = profileUnitOfWork.ExpectedCategoryRepository.Get(filter: d => d.ProfileID == profileIDNum && d.IsDeleted == false).FirstOrDefault(); if (expectedCategory != null) { model.categoryID = expectedCategory.CategoryID; } model.contact = profileUnitOfWork.ContactRepository.GetByID(model.profile.JobSeekerID); model.employmentHistory = profileUnitOfWork.EmploymentHistoryRepository.Get(s => s.ProfileID == profileIDNum && s.IsDeleted == false).LastOrDefault(); model.educationHistory = profileUnitOfWork.EducationHistoryRepository.Get(s => s.ProfileID == profileIDNum && s.IsDeleted == false).LastOrDefault(); model.referencePerson = profileUnitOfWork.ReferencePersonRepository.Get(s => s.ProfileID == profileIDNum && s.IsDeleted == false).LastOrDefault(); return(View(model)); } else { TempData["errormessage"] = "Không tìm thấy thông tin hồ sơ!"; return(RedirectToAction("Index", "Home")); } } else { TempData["errormessage"] = "Dữ liệu không hợp lệ!"; return(RedirectToAction("Index", "Home")); } }
public ActionResult EditProfile(ViewProfile user) { if (ModelState.IsValid) { var email = (string)Session["Email"]; Patient pa = new Data.Patient(); pa = obj1.Patients.Where(m => m.email == email).FirstOrDefault(); if (user.name != null) { pa.name = user.name; } if (user.contact != null) { pa.contact = user.contact; } if (user.emergency_contact != null) { pa.emergency_contact = user.emergency_contact; } if (user.Address != null) { pa.address = user.Address; } if (user.gender != null) { pa.gender = user.gender; } if (user.blood_group != null) { pa.blood_group = user.blood_group; } if (user.dob != null) { pa.dob = user.dob; } if (user.new_password != null && user.current_password != null) { if (string.Equals(user.current_password, pa.password)) { pa.password = user.new_password; } else { ViewBag.a = "Enter your current password"; return(View("EditProfile")); } } obj1.Patients.AddOrUpdate(pa); obj1.SaveChanges(); return(RedirectToAction("ViewProfile", "ViewProfile")); } return(RedirectToAction("ViewProfile", "ViewProfile")); }
public ActionResult EditProfile() { ViewProfile obj = new ViewProfile(); return(View(obj)); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["pageid"] != null) { return; } Miami.Substitute.Bll.Job job = new Miami.Substitute.Bll.Job(); JobList.DataSource = job.SearchOpenJobs(DateTime.Now.Date.AddDays(-1), DateTime.Now.AddYears(10), 2); JobList.DataBind(); DataView dv = job.SearchOpenJobs(DateTime.Now.Date.AddDays(-1), DateTime.Now.AddYears(10), 3); if (dv != null && dv.Count > 0) { ResponseGridView.DataSource = dv; ResponseGridView.DataBind(); } else { ResponseGridView.Visible = false; lblResponseTitle.Visible = false; } Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User(); dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId); if (Session["IsCounted"] == null || Convert.ToInt32(Session["IsCounted"]) == 0) { user.InsertUsage(2, Convert.ToInt32(dv[0]["LocationId"].ToString())); Session["IsCounted"] = 1; } dv.Table.Columns.Add("FullName", Type.GetType("System.String")); dv[0]["FullName"] = dv[0]["FirstName"] + " " + dv[0]["MiddleName"] + (String)(dv[0]["MiddleName"].ToString().Length > 0 ? ". " : "") + dv[0]["LastName"]; dv.Table.Columns.Add("ContactInfo", Type.GetType("System.String")); dv[0]["ContactInfo"] = dv[0]["Address"] + "<br>" + dv[0]["Address2"] + "<br>" + dv[0]["Phone"] + "<br>" + dv[0]["EmailProfile"]; dv.Table.Columns.Add("JobCode", Type.GetType("System.String")); dv[0]["JobCode"] = dv[0]["JobPosition"] + " / " + dv[0]["JobAssignmentDescription"]; if (user.FirstName.Length > 0) { lblName.Text = "Hi, " + Convert.ToString(user.FirstName[0].ToString().ToUpper() + user.FirstName.ToLower().Substring(1, user.FirstName.Length - 1)).TrimEnd(' '); } dv.Table.Columns.Add("SubjectLevel", Type.GetType("System.String")); dv[0]["SubjectLevel"] = "<table border='0' cellspacing='0' cellpadding='0'>"; //DataView dvCoverage = user.LoadCoverage(Micajah.Common.Security.UserContext.Current.UserId); //if (dvCoverage != null && dvCoverage.Table != null && dvCoverage.Table.Rows.Count > 0) //{ // foreach (DataRow dr in dvCoverage.Table.Rows) // { // if (!dr.IsNull("SubjectName") && !dr.IsNull("LevelName") && !dr.IsNull("ExpireYear") != null) // dv[0]["SubjectLevel"] += "<tr><td><b>" + dr["SubjectName"].ToString() + "</b></td><td><b> / </b></td><td><b>" + dr["LevelName"].ToString() + "</b></td><td><b> / </b></td><td><b>" + dr["ExpireYear"].ToString() + "</b></td></tr>"; // } //} dv[0]["SubjectLevel"] += "</table>"; ViewProfile.DataSource = dv; ViewProfile.DataBind(); Master.VisibleLeftArea = false; Master.VisibleMainMenu = false; Master.VisiblePageTitle = false; Master.VisibleBreadCrumbs = false; }
public ViewProfileViewModel(ViewProfile viewProfileOpen, int id) { viewProfile = viewProfileOpen; IDD = id; Profile = (from r in context.tblProfiles where r.UserID == IDD select r).FirstOrDefault(); }
public void OnClickUserOnline(GameObject go) { ViewProfile.Create(this.user); }