Beispiel #1
0
 void LoadData()
 {
     BtnEdit.Title           = "Editar";
     LblChange.Hidden        = true;
     TxtNameAdmin.Enabled    = false;
     TxtPhoneAdmin.Enabled   = false;
     TxtAddressAdmin.Enabled = false;
     ViewProfilePicture.AddGestureRecognizer(profileTapGesture);
     EditMode = false;
 }
Beispiel #2
0
 void LoadData()
 {
     BtnEdit.Title      = "Editar";
     LblChange.Hidden   = true;
     TxtName.Enabled    = false;
     TxtPhone.Enabled   = false;
     TxtAddress.Enabled = false;
     ViewProfilePicture.AddGestureRecognizer(profileTapGesture);
     TxtName.Text    = AppDelegate.CurrentUser.Name;
     TxtPhone.Text   = AppDelegate.CurrentUser.Phone;
     TxtAddress.Text = AppDelegate.CurrentUser.Address;
     EditMode        = false;
 }
Beispiel #3
0
        public RedirectToRouteResult ImageUpload(ViewProfilePicture viewModelProfilePicture)
        {
            var user = (User)Session["User"];

            string messege = user.Profile.FristName + "  " + user.Profile.LastName + "Update Profile Picture";
            Post   post    = new Post();

            string path       = "";
            var    profilePic = viewModelProfilePicture.Picture;



            if (profilePic != null)
            {
                string pic = System.IO.Path.GetFileName(profilePic.FileName);
                path = System.IO.Path.Combine(
                    Server.MapPath("~/Image/ProfilePic"), pic);
                // file is uploaded
                profilePic.SaveAs(path);
                post.PostPicture = viewModelProfilePicture.Picture.FileName;
                post.UserPost    = messege;
            }
            else
            {
                post.PostPicture = "a";
                post.UserPost    = messege;
            }


            postManager.MakeAPost(post, user.Id);
            //get path
            var newuser = new User();

            newuser = user;
            newuser.Profile.Picture = viewModelProfilePicture.Picture.FileName;
            //save path to  database
            updatePicture.UpdateProfilePic(newuser);
            return(RedirectToAction("ProfileEdit"));
        }