private void InitializeProfile() { ProfileDatabase db = new ProfileDatabase(); Profile p = db.GetProfile(); CanDistributePoints.Text = p.distribute.ToString(); }
private void InitializeProfile() { ProfileDatabase db = new ProfileDatabase(); Profile p = db.GetProfile(); UserName.Text = p.name; UserEmail.Text = p.email; NotificationSwitch.Checked = p.emailNotificaion; new CacheUserAvatar(UserAvatar, Application.Context).Execute(p); }
private void InitializeProfile() { ProfileDatabase db = new ProfileDatabase(); Profile p = db.GetProfile(); UserName.Text = p.name; UserEmail.Text = p.email; Balance.Text = p.balance.ToString(); Rewards.Text = p.rewards.ToString(); Distribute.Text = p.distribute.ToString(); new CacheUserAvatar(UserAvatar, Application.Context).Execute(p); }
public UsersAdapter(List <UserListItem> users, SearchPersonActivity activity) { MeritMoneyUsers = users; this.activity = activity; ProfileDatabase db = new ProfileDatabase(); curUserId = db.GetProfile().ID; for (int i = 0; i < MeritMoneyUsers.Count; i++) { if (MeritMoneyUsers[i].ID == curUserId) { MeritMoneyUsers.RemoveAt(i); } } }
public void AddNewList(List <UserListItem> list) { ProfileDatabase pdb = new ProfileDatabase(); String curId = pdb.GetProfile().ID; for (int i = 0; i < list.Count; i++) { if (curId == list[i].ID) { list.RemoveAt(i); } } MeritMoneyUsers.Clear(); MeritMoneyUsers.AddRange(list); NotifyDataSetChanged(); }
public async void OnClick(IDialogInterface dialog, int which) { switch (which) { case (int)DialogButtonType.Neutral: dialog.Dismiss(); NumberOfPoints.Text = String.Empty; SendPointsButton.Enabled = false; break; case (int)DialogButtonType.Positive: try { ProfileDatabase pdb = new ProfileDatabase(); if (Convert.ToInt64(NumberOfPoints.Text) > pdb.GetProfile().distribute) { Toast.MakeText(this, "Unavailible points amount.", ToastLength.Short).Show(); break; } } catch (Exception) { Toast.MakeText(this, "Too many points to send.", ToastLength.Short).Show(); break; } ProgressDialog progressDialog = ProgressDialog.Show(this, "", "Sending points...", true); String name = userNameToDistribute.Text; userNameToDistribute.Text = String.Empty; String number = NumberOfPoints.Text; NumberOfPoints.Text = String.Empty; String notes = Notes.Text; Profile p = await MeritMoneyBrain.DistributePoints(number, userIDtoDistribute, notes); p.AvatarIsDefault = OperationWithBitmap.isDefault(p.imageUri); ProfileDatabase db = new ProfileDatabase(); db.Update(p); new UpdateProfileData(this, progressDialog, number, name).Execute(p); break; } }
public void AddList(List <UserListItem> list) { ProfileDatabase pdb = new ProfileDatabase(); String curId = pdb.GetProfile().ID; for (int i = 0; i < list.Count; i++) { if (curId == list[i].ID) { list.RemoveAt(i); } } int startingPos = MeritMoneyUsers.Count(); MeritMoneyUsers.AddRange(list); NotifyItemRangeInserted(startingPos, list.Count()); for (int i = startingPos; i < startingPos + list.Count(); i++) { new CacheListItemImage(this, i, Application.Context).Execute(MeritMoneyUsers[i]); } }
public UploadAvatarOnServer(CircularImageView image) { this.image = image; UserId = db.GetProfile().ID; }