Ejemplo n.º 1
0
        public ActionResult Profile()
        {
            string          userName = this.User.Identity.Name;
            ParentProfileVM vm       = this.service.GetProfileVM(userName);

            return(this.View(vm));
        }
Ejemplo n.º 2
0
        public ParentProfileVM GetProfileVM(string userName)
        {
            ApplicationUser currentUser    = this.Context.Users.FirstOrDefault(x => x.UserName == userName);
            ParentProfileVM vm             = Mapper.Map <ApplicationUser, ParentProfileVM>(currentUser);
            Parent          currentParrent = this.Context.Parents.FirstOrDefault(parent => parent.User.Id == currentUser.Id);

            vm.Kids = Mapper.Map <IEnumerable <Student>, IEnumerable <StudentCourseVM> >(currentParrent.Kids);

            return(vm);
        }
 protected override void OnAppearing()
 {
     base.OnAppearing();
     BindingContext = vm = new ParentProfileVM();
     //childname.Text = "Name:-" + " " + SecureStorage.GetAsync("studentName").GetAwaiter().GetResult();
     //childroomno.Text = "Room Name:-" + " " + SecureStorage.GetAsync("roomName").GetAwaiter().GetResult();
     //childbedno.Text = "Bed No:-" + " " + SecureStorage.GetAsync("roomBedName").GetAwaiter().GetResult();
     //blockno.Text = "Block Name:-" + " " + SecureStorage.GetAsync("blockName").GetAwaiter().GetResult();
     //hostelname.Text = "Hostel name:-" + " " + SecureStorage.GetAsync("hostelName").GetAwaiter().GetResult();
 }