Esempio n. 1
0
        public void editProfile(ProfileView data)
        {
            User user = _repository.Get(p => p.Account == data.Account);

            user.Name    = data.Name;
            user.Height  = data.Height;
            user.Weight  = data.Weight;
            user.Bodyfat = data.Bodyfat;
            user.BMR     = data.BMR;
            user.Disease = data.Disease;
            _repository.Update(user);
            _db.Save();
        }
Esempio n. 2
0
        private void InitializeProfile()
        {
            var profileModel           = LecturerProvider.GetMe();
            ProfilePresenter presenter = new ProfilePresenter(profileModel);

            var profileView = new ProfileView();

            compContainer.AttachView(profileView);

            profileView.AttachToPresenter(presenter, true);

            profileButton.Tag = profileView;
        }
Esempio n. 3
0
        public async Task <IActionResult> Index()
        {
            var user = await GetCurrentUserAsync();

            var model       = new ProfileView(context, user);
            var dateAndTime = DateTime.Now;
            var today       = dateAndTime.Date;

            List <Class> ClassList = await context.Class.Where(c => c.ApplicationUserId == user.Id).ToListAsync();

            List <Student>     s = new List <Student>();
            List <ClassMember> ListOfClassMembers = new List <ClassMember>();
            List <Attendance>  ListOfAttendance   = new List <Attendance>();

            foreach (Class c in ClassList)
            {
                List <ClassMember> cm = await context.ClassMember.Where(d => d.ClassId == c.ClassId).ToListAsync();

                foreach (ClassMember LocalClassMember in cm)
                {
                    Student student = await context.Student.Where(LocalStudent => LocalStudent.StudentId == LocalClassMember.StudentId).SingleOrDefaultAsync();

                    s.Add(student);
                    ListOfClassMembers.Add(LocalClassMember);

                    Attendance a = await context.Attendance.Where(b => b.ClassMemberId == LocalClassMember.ClassMemberId && b.Date == today).SingleOrDefaultAsync();

                    if (a == null)
                    {
                        Attendance attendance = new Attendance {
                            ClassMemberId = LocalClassMember.ClassMemberId, CurrentlyAbsent = false, Date = today
                        };
                        context.Add(attendance);
                        await context.SaveChangesAsync();

                        ListOfAttendance.Add(attendance);
                    }
                    else
                    {
                        ListOfAttendance.Add(a);
                    }
                }
            }

            model.Attendance      = ListOfAttendance;
            model.ClassMember     = ListOfClassMembers;
            model.Class           = ClassList;
            model.ApplicationUser = user;
            model.StudentList     = s;
            return(View(model));
        }
 void InitializeComponents()
 {
     lblEdit.Hidden    = LblCover.Hidden = true;
     profileTapGesture = new UITapGestureRecognizer(Opciones)
     {
         Enabled = true
     };
     ProfileView.AddGestureRecognizer(profileTapGesture);
     coverTapGesture = new UITapGestureRecognizer(Opciones)
     {
         Enabled = true
     };
     CoverView.AddGestureRecognizer(coverTapGesture);
 }
Esempio n. 5
0
        public void Init(MainForm main)
        {
            Main  = main;
            Model = main.Model;

            if (!DesignMode)
            {
                CSharpView.DocumentText = ContentPage;
                UpdateCodeView();
            }

            ProfileView.Init(main);
            NavButtons.Init(main);
        }
        public ProfileView Get()
        {
            var             c_userid = User.FindFirst(ClaimTypes.NameIdentifier).Value;
            ApplicationUser profile  = _repo.GetUserProfile(c_userid);
            ProfileView     pf       = new ProfileView()
            {
                First_Name      = profile.First_Name.ToString(),
                Last_Name       = profile.Last_Name.ToString(),
                Profile_Picture = profile.Profile_Picture.ToString(),
                Email           = profile.Email,
            };

            return(pf);
        }
Esempio n. 7
0
 public void Save(ProfileView viewTable)
 {
     if (viewTable.Id == null)
     {
         var domainTable = new ProfileTable();
         Mapper.Map(viewTable, domainTable);
         SaveDomain(domainTable);
     }
     else
     {
         var domainTable = Find(viewTable.Id);
         Mapper.Map(viewTable, domainTable);
         SaveDomain(domainTable);
     }
 }
Esempio n. 8
0
 void Refresh(ProfileView contents)
 {
     Gtk.Application.Invoke(delegate {
         if (contents.LoadProfile(proc.LogFile))
         {
             if (log_info == null || log_info.Filename != proc.LogFile)
             {
                 log_info = new LogInfo(proc.LogFile, log_info == null ? null : log_info.Detail);
                 history.LogFiles.Add(log_info);
             }
             save_action.Sensitive = true;
             show_system_nodes_action.Sensitive = contents.SupportsFiltering;
         }
     });
 }
Esempio n. 9
0
        public virtual async Task <IActionResult> GetProfile(string link)
        {
            int?userId = User?.UserId;

            ProfileView profileView = await profilePresenter.GetProfileAsync(link, userId);

            if (profileView == null)
            {
                return(NotFound());
            }

            profileView.ProfileVisitsCount += profilesVisitsCounterService.CountProfile(UserOrIpKey, profileView.Id);

            return(Json(profileView));
        }
Esempio n. 10
0
        public void RenderView(AppState astate)
        {
            if (!_initViews)
            {
                InitViews();
            }

            //background
            ShowBackground();

            //header
            ShowHeader();

            //add things based on appstate
            if (astate == AppState.ANNOUNCEMENTS)
            {
                AnnouncementsView.AddToView();

                //render sidebar thingy
                if (ButtonHandler.BARS_OPEN)
                {
                    //sidebar background fill rect, XBARINSET = space to main background
                    render(Access.newRect(0, 0, C.X_BAR_INSET, vc.ViewHeight, UIColor.White));

                    //add sidebar buttons for things, options mby

                    //little seperator for constant button and groups
                    render(Access.newRect(0, 96, C.X_BAR_INSET, 3, UIColor.Gray));
                }
            }
            else if (astate == AppState.TUTOR)
            {
            }
            else if (astate == AppState.PROFILE)
            {
                ProfileView.AddToView();
            }
            else if (astate == AppState.ROOM)
            {
                new RoomView(Room);
            }
            else if (astate == AppState.GRADES)
            {
                GradesView.AddToView();
            }

            ShowTaskbar();
        }
Esempio n. 11
0
 public TestClient(string baseUrl, ProfileView profile, TimeSpan timespan) : base(baseUrl, timespan)
 {
     //profile
     if (profile == null)
     {
         this.profile = new ProfileView()
         {
             Password = "******",
             UserId   = "09123456789"
         };
     }
     else
     {
         this.profile = profile;
     }
 }
Esempio n. 12
0
 public ActionResult Edit(ProfileView model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _Service.Save(model);
             return(RedirectToAction("Index"));
         }
         catch (Exception e)
         {
             ModelState.AddModelError(string.Empty, e.GetOriginalException().Message);
         }
     }
     return(View(model));
 }
// Main View
    // ProfilePage
    public void GoToProfilePage()
    {
        _activePageForward(this._profilePage);
        ProfileView Script = _profilePage.GetComponent <ProfileView> ();

        DataStore.Get <User> (Settings.application.UserID.ToString(), o => {
            if (o.Available)
            {
                Script.EnterPage(o);
            }
            else
            {
                Script.NotAvailable();
            }
        });
    }
Esempio n. 14
0
        void StartProfile(ProfileConfiguration config)
        {
            ProfileView view = new ProfileView();

            view.Show();
            View = view;
            logging_enabled_action.Visible = true;
            logging_enabled_action.Active  = config.StartEnabled;
            proc         = new ProfilerProcess(config);
            proc.Paused += delegate { Refresh(view); };
            proc.Exited += delegate { Refresh(view); logging_enabled_action.Visible = false; };
            proc.Start();
            log_info = new LogInfo(proc.LogFile, config.ToString());
            history.LogFiles.Prepend(log_info);
            history.Configs.Prepend(config);
        }
Esempio n. 15
0
        // override Finis

        #region Internal Functionality
        void InitializeComponents()
        {
            //Hidding components for edit
            lblEdit.Hidden = LblCover.Hidden = true;

            profileTapGesture = new UITapGestureRecognizer(ShowOptions)
            {
                Enabled = true
            };
            ProfileView.AddGestureRecognizer(profileTapGesture);
            coverTapGesture = new UITapGestureRecognizer(ShowOptions)
            {
                Enabled = true
            };
            CoverView.AddGestureRecognizer(coverTapGesture);
        }
Esempio n. 16
0
 public HttpResponseMessage EditPassword(Guid id, [FromBody] PassowrdChange password)
 {
     try
     {
         var user = userRepository.GetUserById(id);
         HttpResponseMessage result = null;
         if (user != null && password.oldpassword != null && password.newpassword != null)
         {
             if (password.oldpassword != password.newpassword)
             {
                 if (user.password == password.oldpassword)
                 {
                     user.password = password.newpassword;
                     userRepository.UpdateUser(user);
                     userRepository.Save();
                     ProfileView profile = new ProfileView();
                     var         entity  = userRepository.GetUserById(id);
                     profile.email      = entity.email;
                     profile.image      = entity.image;
                     profile.name       = entity.name;
                     profile.userid     = entity.id;
                     profile.totallikes = likeRepository.UserTotalLikes(id);
                     profile.team       = (entity.Team == null) ? "Not Joined a Team" : entity.Team.name;
                     profile.rank       = userRepository.UserRank(id);
                     result             = Request.CreateResponse(HttpStatusCode.OK, profile);
                 }
                 else
                 {
                     result = Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Wrong old password");
                 }
             }
             else
             {
                 result = Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Old Passowrd equals new password");
             }
         }
         else
         {
             result = Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Nul opjects");
         }
         return(result);
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }
Esempio n. 17
0
        public MainPage(Login user, Window window)
        {
            InitializeComponent();
            this.window          = window;
            this.user            = user;
            DockGrid.DataContext = this.user;

            if (user.role.Equals("admin"))
            {
                DataContext           = new DashBoardView(this);
                formButton.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                DataContext = new ProfileView(user);
            }
        }
Esempio n. 18
0
        public async Task <IActionResult> Update(ProfileView model)
        {
            foreach (Attendance a in model.Attendance)
            {
                Attendance OriginalAttendance = await context.Attendance.Where(o => o.AttendanceId == a.AttendanceId).SingleAsync();

                if (ModelState.IsValid && a.CurrentlyAbsent != OriginalAttendance.CurrentlyAbsent)
                {
                    OriginalAttendance.CurrentlyAbsent      = a.CurrentlyAbsent;
                    context.Entry(OriginalAttendance).State = EntityState.Modified;
                    context.Update(OriginalAttendance);
                    context.SaveChanges();
                }
            }
            return(RedirectToAction("Index", new RouteValueDictionary(
                                        new { controller = "Profile", action = "Index" })));
        }
Esempio n. 19
0
        void InitializeComponents()
        {
            LblEdit.Hidden = true;
            LblTap.Hidden  = true;

            editTapGesture = new UITapGestureRecognizer(ShowOptions)
            {
                Enabled = true
            };
            ProfileView.AddGestureRecognizer(editTapGesture);

            tapTapGesture = new UITapGestureRecognizer(ShowOptions)
            {
                Enabled = true
            };
            BottomView.AddGestureRecognizer(tapTapGesture);
        }
        public ActionResult ShowProfile(ProfileView model, HttpPostedFileBase file)
        {
            var user = Membership.GetUser(User.Identity.Name);

            user.Email = model.Register.Email;
            Membership.UpdateUser(user);

            //saving image
            if (file != null)
            {
                SaveImageToDatabase(file);
            }

            Author author = new Author();

            author.Username = User.Identity.Name;
            if (model.Author.Fullname != null)
            {
                author.Fullname = model.Author.Fullname;
            }
            if (model.Author.Expertise != null)
            {
                author.Expertise = model.Author.Expertise;
            }
            if (model.Author.About != null)
            {
                author.About = model.Author.About;
            }
            using (var d = new ApplicationDbContext())
            {
                var auth = d.Authors.FirstOrDefault(x => x.Username == user.UserName);
                if (auth == null)
                {
                    d.Authors.Add(author);
                    d.SaveChanges();
                }
                else
                {
                    auth.Fullname  = author.Fullname;
                    auth.Expertise = author.Expertise;
                    auth.About     = author.About;
                    d.SaveChanges();
                }
            }
            return(RedirectToAction("Index", "Posts"));
        }
Esempio n. 21
0
        getAlignInts()
        {
            Alignment          objAlignCL = Align.getAlignment("RIVER_CL");
            List <XALGNS>      xAlgns     = new List <XALGNS>();
            XALGNS             xAlgn      = new XALGNS();
            ObjectIdCollection ids        = Align.getAlignmentIDs();

            for (int i = 0; i < ids.Count; i++)
            {
                Alignment objAlign = (Alignment)ids[i].getEnt();

                Point3dCollection varPntInt = new Point3dCollection();
                objAlignCL.IntersectWith(objAlign, Intersect.OnBothOperands, varPntInt, IntPtr.Zero, IntPtr.Zero);

                if (varPntInt.Count == 0)
                {
                    return;
                }
                for (int j = 0; j < varPntInt.Count; j++)
                {
                    Point3d pnt3d = varPntInt[j];
                    double  dblStation = 0, dblOffset = 0;
                    objAlign.StationOffset(pnt3d.X, pnt3d.Y, ref dblStation, ref dblOffset);
                    xAlgn = new XALGNS {
                        Name = objAlign.Name, XSTA = System.Math.Round(dblStation, 3)
                    };

                    ProfileView objProfileView = Prof.getProfileView(objAlign.Name, objAlign.Name);
                    Extents3d   ext3d          = (Extents3d)objProfileView.Bounds;
                    Point3d     pnt3dMin       = ext3d.MinPoint;
                    Point3d     pnt3dMax       = ext3d.MaxPoint;

                    double dblStaStart  = objProfileView.StationStart;
                    double dblElevStart = objProfileView.ElevationMin;

                    Profile objProfile = Prof.getProfile(objAlign.ObjectId, objAlign.Name);
                    double  dblElev    = objProfile.ElevationAt(dblStation);

                    Point3d pnt3dIns = new Point3d(pnt3dMin.X + dblStation - dblStaStart,
                                                   pnt3dMin.Y + (dblElev - dblElevStart) * 10,
                                                   0);
                    Draw.addCircle(pnt3dIns, 2);
                }
            }
        }
        public async Task <IActionResult> Index()
        {
            var user = await GetCurrentUserAsync();

            List <Class> ClassList = await context.Class.ToListAsync();

            foreach (Class c in ClassList)
            {
                List <ClassMember> cm = await context.ClassMember.Where(d => d.ClassId == c.ClassId).ToListAsync();

                c.ClassMember = cm;
            }
            var model = new ProfileView(context, user);

            model.Class           = ClassList;
            model.ApplicationUser = user;
            return(View(model));
        }
Esempio n. 23
0
    public void SwitchView()
    {
        switch (_menuScreensService.MenuStates)
        {
        case MenuScreensService.MenuScreens.Login:
            LoginView loginView = _menuFactory.CreateConcreteLoginView();
            loginView.transform.SetParent(gameObject.transform);
            loginView.OnLoginViewSetDel = SetState;                                                                             // nie korzysta z DelegateService, jego delegat jest nieco inny od pozostałych
            break;

        case MenuScreensService.MenuScreens.MainMenu:
            MainLobbyView mainLobbyView = _menuFactory.CreateConcreteMainLobbyView();
            mainLobbyView.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState;
            break;

        case MenuScreensService.MenuScreens.HowtoPlay:
            HowToPlayView howToPlay = _menuFactory.CreateConcreteHowToPlayView();
            howToPlay.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState;
            break;

        case MenuScreensService.MenuScreens.Credits:
            CreditsView creditsView = _menuFactory.CreateConcreteCreditsView();
            creditsView.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState;
            break;

        case MenuScreensService.MenuScreens.Achievements:
            AchievementsView achievementsView = _menuFactory.CreateConcreteAchievementsView();
            achievementsView.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState;
            break;

        case MenuScreensService.MenuScreens.Profile:
            ProfileView profileView = _menuFactory.CreateConcreteProfileView();
            profileView.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState; break;

        case MenuScreensService.MenuScreens.NewGame:
            SceneManager.LoadScene("Game");
            break;
        }
    }
Esempio n. 24
0
        public void NavigateTo(NodeModel node)
        {
            if (node.ObjType != XObjType.Method)
            {
                return;
            }

            var xNode = node.XNode;

            if (xNode == SelectedNode)
            {
                return;
            }

            SelectedNode = xNode;
            ProfileView.NavigateTo(node);

            RefreshView();
        }
Esempio n. 25
0
        // GET api/<controller>
        public IEnumerable <ProfileView> Get()
        {
            int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);

            ProfileView[] m_ProfileViews = new ProfileView().GetProfileViews(_UserID);

            m_ProfileViews = m_ProfileViews.Take(15).ToArray();

            foreach (ProfileView _EachProfileView in m_ProfileViews)
            {
                if (_EachProfileView.OtherUserDetails.ProfilePhoto != null)
                {
                    string PhotoPath = ConfigurationManager.AppSettings["PhotosFolder"].ToString() + _EachProfileView.OtherUserDetails.ProfilePhoto.PhotoPath;
                    _EachProfileView.OtherUserDetails.ProfilePhoto.EncryptPath = new EncryptDecrypt().Encrypt(PhotoPath + "&100&100");
                }
            }

            return(m_ProfileViews);
        }
        public async void Show(string tenatName, string tenatSurname, string tenantPassword)
        {
            Profile = await Server.GetTenantProfile(tenatName, tenatSurname, tenantPassword);

            tblName.Text    = $"{tblName.Text}: {Profile.Name}";
            tblSurname.Text = $"{tblSurname.Text}: {Profile.Surname}";
            tblManagementCompanyName.Text = $"{tblManagementCompanyName.Text}: {Profile.NameManagmentCompany}";
            tblAddress.Text        = $"{tblAddress.Text}: {Profile.Address}";
            tblEntranceNumber.Text = $"{tblEntranceNumber.Text}: {Profile.EntranceNumber}";
            tblFlatNumber.Text     = $"{tblFlatNumber.Text} {Profile.FlatNumber}";
            if (Profile.HasMeeting != null)
            {
                var button = CreateBtnGoToMeeting();
                spMain.Children.Add(button);
            }

            lastItem = 1;
            this.Show();
        }
Esempio n. 27
0
File: Prof.cs Progetto: 15831944/EM
        addProfileView(ObjectId alignID, Point3d pnt3dIns)
        {
            ObjectId    id    = ProfileView.Create(alignID, pnt3dIns);
            ProfileView pview = null;

            try
            {
                using (Transaction tr = BaseObjs.startTransactionDb())
                {
                    pview = (ProfileView)tr.GetObject(id, OpenMode.ForRead);
                    tr.Commit();
                }
            }
            catch (System.Exception ex)
            {
                BaseObjs.writeDebug(string.Format("{0} Prof.cs: line: 118", ex.Message));
            }
            return(pview);
        }
Esempio n. 28
0
        public ChangeWin(string ID, int a, PersonalInfoUC PUC, ProfileView PV, MainWindow Window)
        {
            InitializeComponent();

            switch (a)
            {
            case 1:
                SingleContentChange LoginChangeUC = new SingleContentChange("Nowy login", ID, 1, this, PUC, PV, Window);
                StackContent.Children.Add(LoginChangeUC);
                break;

            case 2:
                PassContentChange PassChangeUC = new PassContentChange(ID, this);
                StackContent.Children.Add(PassChangeUC);
                break;

            case 3:
                SingleContentChange FNChangeUC = new SingleContentChange("Nowe imię", ID, 3, this, PUC, PV, Window);
                StackContent.Children.Add(FNChangeUC);
                break;

            case 4:
                SingleContentChange LNChangeUC = new SingleContentChange("Nowe nazwisko", ID, 4, this, PUC, PV, Window);
                StackContent.Children.Add(LNChangeUC);
                break;

            case 5:
                SingleContentChange EmailChangeUC = new SingleContentChange("Nowy E-Mail", ID, 5, this, PUC, PV, Window);
                StackContent.Children.Add(EmailChangeUC);
                break;

            case 6:
                DOBContentChange DOBChangeUC = new DOBContentChange(ID);
                StackContent.Children.Add(DOBChangeUC);
                break;

            case 7:
                SingleContentChange CityChangeUC = new SingleContentChange("Nowe miasto", ID, 7, this, PUC, PV, Window);
                StackContent.Children.Add(CityChangeUC);
                break;
            }
        }
Esempio n. 29
0
        public PersonalInfoUC(List <string> Credentials, ProfileView PV, MainWindow Window)
        {
            InitializeComponent();
            _PV              = PV;
            ID               = Credentials[0];
            pass             = Credentials[4];
            _Window          = Window;
            LoginLBL.Content = Credentials[3];

            for (int i = 0; i < Credentials[4].Count(); i++)
            {
                PassLBL.Content += "*";
            }

            FNLBL.Content    = Credentials[1];
            LNLBL.Content    = Credentials[2];
            EMAILLBL.Content = Credentials[5];
            DOBLBL.Content   = Credentials[8] + "." + Credentials[7] + "." + Credentials[6];
            CityLBL.Content  = Credentials[9];
        }
Esempio n. 30
0
File: Prof.cs Progetto: 15831944/EM
 removeProfileViews(Alignment align)
 {
     try
     {
         using (Transaction tr = BaseObjs.startTransactionDb())
         {
             ObjectIdCollection ids = align.GetProfileViewIds();
             foreach (ObjectId id in ids)
             {
                 ProfileView pview = (ProfileView)tr.GetObject(id, OpenMode.ForWrite);
                 pview.Erase();
             }
             tr.Commit();
         }
     }
     catch (System.Exception ex)
     {
         BaseObjs.writeDebug(string.Format("{0} Prof.cs: line: 308", ex.Message));
     }
 }
 /// <summary>
 /// Update profile.
 /// </summary>
 /// <param name="profileView">
 /// The profile view.
 /// </param>
 /// <returns>
 /// The update profile.
 /// </returns>
 public UpdateProfileResponse UpdateProfile(ProfileView profileView)
 {
     return new UpdateProfileResponse();
 }