public async void Register()
        {
            if (string.IsNullOrEmpty(loginName) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(firstName) ||
                string.IsNullOrEmpty(password) || string.IsNullOrEmpty(numberOfAlbum))
            {
                await Application.Current.MainPage.DisplayAlert("Błąd", "Wymagane pola nie zostały uzupelnione", "OK");
            }
            else
            {
                User = new UserDetailData
                {
                    UserId        = Guid.NewGuid().ToString(),
                    LoginName     = loginName,
                    Password      = password,
                    FirstName     = firstName,
                    LastName      = lastName,
                    NumberOfAlbum = numberOfAlbum,
                    PhoneNumber   = phoneNumber,
                    Description   = desription,
                    Photo         = ImageToBytes(),
                    EmailAddress  = email,
                    WebsiteLink   = webLink
                };
                await DataStore.AddItemAsync(User);

                await Application.Current.MainPage.DisplayAlert("Zarejstrowano", "Konto zostało założone", "OK");
            }
        }
        public UserPage()
        {
            InitializeComponent();
            var user = new UserDetailData();

            viewModel      = new UserViewModel(user);
            BindingContext = viewModel;
        }
 public MenuPage(UserDetailData user)
 {
     InitializeComponent();
     MasterBehavior = MasterBehavior.Popover;
     MenuPages.Add((int)MenuItemType.MyData, (NavigationPage)Detail);
     User = user;
     //MasterPage.ListView.ItemSelected += ListView_ItemSelected;
 }
        public ActionResult Delete(string id)
        {
            UserDetailData item = ItemRepository.Remove(id);

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

            return(Ok());
        }
        public ActionResult <UserDetailData> GetItem(string id)
        {
            UserDetailData item = ItemRepository.Get(id);

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

            return(item);
        }
        public UserViewModel(UserDetailData user)
        {
            this.User = user;
            Title     = User.FirstName + " " + User.LastName;
            string site = "http://" + User.WebsiteLink;

            OpenWebsiteCommand = new Command(async() => await Browser.OpenAsync(site));
            SendEmailCommand   = new Command(async() => await Email.ComposeAsync("", "", User.EmailAddress));
            var message = new SmsMessage("", new[] { User.PhoneNumber });

            SendSmsCommand = new Command(async() => await Sms.ComposeAsync(message));
        }
示例#7
0
        public async void Refresh()
        {
            var user = await DataStore.GetItemAsync(User.UserId);

            this.User   = user;
            Name        = User.FirstName + " " + User.LastName;
            NOAlbum     = User.NumberOfAlbum;
            Description = User.Description;
            PNumber     = User.PhoneNumber;
            Email       = User.EmailAddress;
            WebUrl      = User.WebsiteLink;
        }
示例#8
0
 public UserDetailViewModel(UserDetailData user)
 {
     RefreshUserCommand = new Command(Refresh);
     Title       = "My page";
     this.User   = user;
     Name        = User.FirstName + " " + User.LastName;
     NOAlbum     = User.NumberOfAlbum;
     Description = User.Description;
     PNumber     = User.PhoneNumber;
     Email       = User.EmailAddress;
     WebUrl      = User.WebsiteLink;
     ImageS      = User.Photo;
 }
示例#9
0
        public IActionResult Details(long id)
        {
            User user = _db.Users.First(x => x.ID == id);

            user.PassWord = "******";

            UserDetailData data = new UserDetailData()
            {
                User       = user,
                Kitchens   = _db.Kitchens.Where(x => x.CompanyID == _userService.User.CompanyID),
                UserTitles = _db.UserTitles.Where(x => x.CompanyId == _userService.User.CompanyID)
            };

            return(View("Detail", data));
        }
        // public Command SendCommand { get; }
        // public UserMessage UM { get; set; }
        public MessageViewModel(UserDetailData recip, string senderId)
        {
            Recip    = recip;
            Title    = Recip.FirstName + " " + Recip.LastName;
            SenderId = senderId;
            Messages = new ObservableCollection <UserMessage>();

            LoadMessagesCommand = new Command(async() => await ExecuteLoadMessages());
            //SendCommand = new Command(Send);
            MessagingCenter.Subscribe <MessagePage, UserMessage>(this, "SendMessage", async(obj, message) =>
            {
                var newMessage = message as UserMessage;
                await MessageStore.AddMessageAsync(newMessage);
                Messages.Add(newMessage);
            });
        }
 public UserDetailsPage(UserDetailData user)
 {
     InitializeComponent();
     this.User      = user;
     BindingContext = viewModel = new UserDetailViewModel(User);
 }
示例#12
0
 public EditUserViewModel(UserDetailData user)
 {
     SaveEditUserCommand = new Command(save);
     User = user;
 }
 public EditUserDetailsPage(UserDetailData user)
 {
     InitializeComponent();
     BindingContext = new EditUserViewModel(user);
 }
 public void Post([FromBody] UserDetailData value)
 {
     ItemRepository.Update(value);
 }
 public ActionResult <UserDetailData> Create([FromBody] UserDetailData item)
 {
     ItemRepository.Add(item);
     return(CreatedAtAction(nameof(GetItem), new { item.UserId }, item));
 }