void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e) { //string previous = (e.PreviousSelection.FirstOrDefault() as ProfileLocal)?.Name; selectedItem = e.CurrentSelection.FirstOrDefault() as ProfileLocal; ProfilesSelected.Add(selectedItem); if (selectedItem.Logo == "mail3") { ProfileEmail E = Converter.ToProfileEmail(selectedItem); MainViewModel.GetInstance().DetailsBoxEdith.removeProfileEmail(E); } else if (selectedItem.Logo == "tel3") { ProfilePhone P = Converter.ToProfilePhone(selectedItem); MainViewModel.GetInstance().DetailsBoxEdith.removeProfilePhone(P); } else if (selectedItem.Logo == "whatsapp3") { ProfileWhatsapp W = Converter.ToProfileWhatsapp(selectedItem); MainViewModel.GetInstance().DetailsBoxEdith.removeProfileW(W); } else if (selectedItem.Logo != "mail3" && selectedItem.Logo != "tel3" && selectedItem.Logo != "whatsapp3") { ProfileSM SM = Converter.ToProfileSM(selectedItem); MainViewModel.GetInstance().DetailsBoxEdith.removeProfileSM(SM); } }
public void addProfileEmail(ProfileEmail _profileEmail) { var E = Converter.ToProfileLocalE(_profileEmail); ProfilePerfiles.Add(E); IsEmpty = false; }
public void updateProfileEmail(ProfileEmail _profileEmail) { int newIndex = ProfileEmail.IndexOf(selectedProfileEmail); ProfileEmail.Remove(selectedProfileEmail); ProfileEmail.Insert(newIndex, _profileEmail); }
void OnListViewItemTapped(object sender, ItemTappedEventArgs e) { ProfileEmail tappedItem = e.Item as ProfileEmail; var mainViewModel = MainViewModel.GetInstance(); mainViewModel.EditProfileEmail = new EditProfileEmailViewModel(tappedItem.ProfileEmailId); App.Navigator.PushAsync(new EditProfileEmailPage()); }
public void removeProfileEmail() { ProfileEmail.Remove(selectedProfileEmail); if (ProfileEmail.Count == 0) { EmptyList = true; } }
public void updateProfile(ProfileEmail _profileEmail) { int newIndex = profileEmail.IndexOf(selectedProfile); profileEmail.Remove(selectedProfile); profileEmail.Insert(newIndex, _profileEmail); selectedProfile = null; }
public async Task <ActionResult> DeleteConfirmed(int id) { ProfileEmail profileEmail = await db.ProfileEmails.FindAsync(id); db.ProfileEmails.Remove(profileEmail); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public bool updateProfileEmail(ProfileEmail _profileEmail) { int newIndex = ProfileEmail.IndexOf(selectedProfileEmail); ProfileEmail.Remove(selectedProfileEmail); ProfileEmail.Insert(newIndex, _profileEmail); IsUp = true; return(IsUp); }
public async Task <IHttpActionResult> PostProfileEmail(ProfileEmail profileEmail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ProfileEmails.Add(profileEmail); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = profileEmail.ProfileEmailId }, profileEmail)); }
public static ProfileLocal ToProfileLocalE1(ProfileEmail profile) { return(new ProfileLocal { ProfileId = profile.ProfileEmailId, ProfileName = profile.Name, value = profile.Email, Logo = "mail3", Exist = profile.Exist, UserId = profile.UserId, }); }
public async Task <ActionResult> Edit([Bind(Include = "ProfileEmailId,Name,Email,UserId")] ProfileEmail profileEmail) { if (ModelState.IsValid) { db.Entry(profileEmail).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.UserId = new SelectList(db.Users, "UserId", "FirstName", profileEmail.UserId); return(View(profileEmail)); }
private async Task <ProfileEmail> GetProfileEmail(int _ProfileEmailId) { var apiSecurity = Application.Current.Resources["APISecurity"].ToString(); profileEmail = new ProfileEmail(); profileEmail = await this.apiService.GetProfileEmail( apiSecurity, "/api", "/ProfileEmails/GetProfileEmail", _ProfileEmailId); return(profileEmail); }
void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e) { selectedItem = e.CurrentSelection.FirstOrDefault() as ProfileEmail; if (selectedItem == null) { return; } MainViewModel.GetInstance().EditProfileEmail = new EditProfileEmailViewModel(selectedItem.ProfileEmailId); App.Navigator.PushAsync(new EditProfileEmailPage()); if (MainViewModel.GetInstance().Profiles.IsUp == false) { EmailList.SelectedItem = null; } }
public async Task <IHttpActionResult> DeleteProfileEmail(int id) { ProfileEmail profileEmail = await db.ProfileEmails.FindAsync(id); if (profileEmail == null) { return(NotFound()); } db.ProfileEmails.Remove(profileEmail); await db.SaveChangesAsync(); return(Ok(profileEmail)); }
// GET: ProfileEmails/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProfileEmail profileEmail = await db.ProfileEmails.FindAsync(id); if (profileEmail == null) { return(HttpNotFound()); } return(View(profileEmail)); }
public void removeProfileEmail(ProfileEmail _profileEmail) { ProfileLocal E = Converter.ToProfileLocalE(_profileEmail); ProfileLocal Aux = new ProfileLocal(); foreach (ProfileLocal PLocal in ProfilePerfiles) { if (E.ProfileName == PLocal.ProfileName && E.value == PLocal.value) { Aux = PLocal; } } ProfilePerfiles.Remove(Aux); var A = ProfilePerfiles.Count; }
// GET: ProfileEmails/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProfileEmail profileEmail = await db.ProfileEmails.FindAsync(id); if (profileEmail == null) { return(HttpNotFound()); } ViewBag.UserId = new SelectList(db.Users, "UserId", "FirstName", profileEmail.UserId); return(View(profileEmail)); }
public void updateProfileEmail(ProfileEmail _profileEmail) { ProfileLocal E = Converter.ToProfileLocalE(_profileEmail); ProfileLocal Aux = new ProfileLocal(); int newIndex = 0; foreach (ProfileLocal PLocal in ProfilePerfiles) { if (E.ProfileName == PLocal.ProfileName && E.value == PLocal.value) { Aux = PLocal; newIndex = ProfilePerfiles.IndexOf(PLocal); } } ProfilePerfiles.Remove(Aux); ProfilePerfiles.Insert(newIndex, E); }
public async Task <IHttpActionResult> PutProfileEmail(ProfileEmail form) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } int id; dynamic jsonObject = form; try { id = jsonObject.ProfileEmailId; } catch { return(BadRequest("Missing parameter.")); } db.Entry(form).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProfileEmailExists(id)) { return(NotFound()); } else { throw; } } var profileEmail = await GetProfileEmails(). Where(u => u.ProfileEmailId == id).FirstOrDefaultAsync(); return(Ok(profileEmail)); }
private async void SaveProfileEmail() { if (string.IsNullOrEmpty(this.Name)) { await Application.Current.MainPage.DisplayAlert( Languages.Error, Languages.NameValidation, Languages.Accept); return; } if (string.IsNullOrEmpty(this.Email)) { await Application.Current.MainPage.DisplayAlert( Languages.Error, Languages.EmailValidation, Languages.Accept); return; } if (!RegexUtilities.IsValidEmail(this.Email)) { await Application.Current.MainPage.DisplayAlert( Languages.Error, Languages.EmailValidation2, Languages.Accept); return; } this.IsRunning = true; this.IsEnabled = false; var checkConnetion = await this.apiService.CheckConnection(); if (!checkConnetion.IsSuccess) { this.IsRunning = false; this.IsEnabled = true; await Application.Current.MainPage.DisplayAlert( Languages.Error, checkConnetion.Message, Languages.Accept); return; } var mainViewModel = MainViewModel.GetInstance(); var profileEmail = new ProfileEmail { Name = this.Name, Email = this.Email, UserId = mainViewModel.User.UserId, Exist = false }; var apiSecurity = Application.Current.Resources["APISecurity"].ToString(); var profileemail = await this.apiService.Post( apiSecurity, "/api", "/ProfileEmails", profileEmail); if (profileemail == default) { this.IsRunning = false; this.IsEnabled = true; await Application.Current.MainPage.DisplayAlert( Languages.Error, Languages.ErrorAddProfile, Languages.Accept); return; } var ProfileLocal = new Profile { UserId = mainViewModel.User.UserId, ProfileName = profileemail.Name, value = profileemail.Email, ProfileType = "Email", Logo = "email2", ProfileId = profileemail.ProfileEmailId, }; using (var conn = new SQLite.SQLiteConnection(App.root_db)) { conn.CreateTable <Profile>(); conn.Insert(ProfileLocal); } this.IsRunning = false; this.IsEnabled = true; //Agregar a la lista if (mainViewModel.ProfilesBYPESM != null) { mainViewModel.ProfilesBYPESM.addProfileEmail(profileemail); mainViewModel.ListOfNetworks.addProfileEmail(profileemail); } else { mainViewModel.Profiles.addProfileEmail(profileemail); } this.Name = string.Empty; this.Email = string.Empty; if (mainViewModel.ProfilesBYPESM != null) { await PopupNavigation.Instance.PopAsync(); } else { await App.Navigator.PopAsync(); } }
async void OnListViewItemTapped(object sender, ItemTappedEventArgs e) { ProfileEmail tappedItemEmail = e.Item as ProfileEmail; ProfilePhone tappedItemPhone = e.Item as ProfilePhone; ProfileSM tappedItemSM = e.Item as ProfileSM; ProfileWhatsapp tappedItemWhatsapp = e.Item as ProfileWhatsapp; if (tappedItemEmail != null) { MainViewModel.GetInstance().EditProfileEmail = new EditProfileEmailViewModel(tappedItemEmail.ProfileEmailId); await App.Navigator.PushAsync(new EditProfileEmailPage()); } else if (tappedItemPhone != null) { MainViewModel.GetInstance().EditProfilePhone = new EditProfilePhoneViewModel(tappedItemPhone.ProfilePhoneId); await App.Navigator.PushAsync(new EditProfilePhonePage(tappedItemPhone.ProfilePhoneId)); } else if (tappedItemSM != null) { switch (tappedItemSM.RedSocialId) { case 1: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileFacebookPage()); break; case 2: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileInstagramPage()); break; case 3: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileTwitterPage()); break; case 4: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileSnapchatPage()); break; case 5: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileLinkedinPage()); break; case 6: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileTiktokPage()); break; case 7: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileYoutubePage()); break; case 8: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileSpotifyPage()); break; case 9: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileTwitchPage()); break; case 10: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileWebPagePage()); break; case 11: MainViewModel.GetInstance().EdithProfile = new EdithProfileViewModel(tappedItemSM.ProfileMSId); await App.Navigator.PushAsync(new EditProfileTelegramPage()); break; default: break; } } else if (tappedItemWhatsapp != null) { MainViewModel.GetInstance().EditProfileWhatsApp = new EditProfileWhatsAppViewModel(tappedItemWhatsapp.ProfileWhatsappId); await App.Navigator.PushAsync(new EditProfileWhatsAppPage()); } }
void OnListViewItemTapped(object sender, ItemTappedEventArgs e) { ProfileEmail tappedItemEmail = e.Item as ProfileEmail; ProfilePhone tappedItemPhone = e.Item as ProfilePhone; ProfileSM tappedItemSM = e.Item as ProfileSM; ProfileWhatsapp tappedItemWhatsapp = e.Item as ProfileWhatsapp; if (tappedItemEmail != null) { if (tappedItemEmail.Exist == false) { PostProfileEmail(Box.BoxId, tappedItemEmail.ProfileEmailId); tappedItemEmail.Exist = true; MainViewModel.GetInstance().ProfilesBYPESM.updateProfileEmail(tappedItemEmail); MainViewModel.GetInstance().ListOfNetworks.updateProfileEmail(tappedItemEmail); MainViewModel.GetInstance().DetailsBox.addProfileEmail(tappedItemEmail); } else { DeleteProfileEmail(Box.BoxId, tappedItemEmail.ProfileEmailId); tappedItemEmail.Exist = false; MainViewModel.GetInstance().ProfilesBYPESM.updateProfileEmail(tappedItemEmail); MainViewModel.GetInstance().ListOfNetworks.updateProfileEmail(tappedItemEmail); MainViewModel.GetInstance().DetailsBox.removeProfileEmail(tappedItemEmail); } } else if (tappedItemPhone != null) { if (tappedItemPhone.Exist == false) { PostProfilePhone(Box.BoxId, tappedItemPhone.ProfilePhoneId); tappedItemPhone.Exist = true; MainViewModel.GetInstance().ProfilesBYPESM.updateProfilePhone(tappedItemPhone); MainViewModel.GetInstance().ListOfNetworks.updateProfilePhone(tappedItemPhone); MainViewModel.GetInstance().DetailsBox.addProfilePhone(tappedItemPhone); } else { DeleteProfilePhone(Box.BoxId, tappedItemPhone.ProfilePhoneId); tappedItemPhone.Exist = false; MainViewModel.GetInstance().ProfilesBYPESM.updateProfilePhone(tappedItemPhone); MainViewModel.GetInstance().ListOfNetworks.updateProfilePhone(tappedItemPhone); MainViewModel.GetInstance().DetailsBox.removeProfilePhone(tappedItemPhone); } } else if (tappedItemSM != null) { if (tappedItemSM.Exist == false) { PostProfileSM(Box.BoxId, tappedItemSM.ProfileMSId); tappedItemSM.Exist = true; MainViewModel.GetInstance().ProfilesBYPESM.updateProfileSM(tappedItemSM); MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(tappedItemSM); MainViewModel.GetInstance().DetailsBox.addProfileSM(tappedItemSM); } else { DeleteProfileSM(Box.BoxId, tappedItemSM.ProfileMSId); tappedItemSM.Exist = false; MainViewModel.GetInstance().ProfilesBYPESM.updateProfileSM(tappedItemSM); MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(tappedItemSM); MainViewModel.GetInstance().DetailsBox.removeProfileSM(tappedItemSM); } } else if (tappedItemWhatsapp != null) { if (tappedItemWhatsapp.Exist == false) { PostProfileWhatsapp(Box.BoxId, tappedItemWhatsapp.ProfileWhatsappId); tappedItemWhatsapp.Exist = true; MainViewModel.GetInstance().ProfilesBYPESM.updateProfileWhatsapp(tappedItemWhatsapp); MainViewModel.GetInstance().ListOfNetworks.updateProfileWhatsapp(tappedItemWhatsapp); MainViewModel.GetInstance().DetailsBox.addProfileW(tappedItemWhatsapp); } else { DeleteProfileWhatsapp(Box.BoxId, tappedItemWhatsapp.ProfileWhatsappId); tappedItemWhatsapp.Exist = false; MainViewModel.GetInstance().ProfilesBYPESM.updateProfileWhatsapp(tappedItemWhatsapp); MainViewModel.GetInstance().ListOfNetworks.updateProfileWhatsapp(tappedItemWhatsapp); MainViewModel.GetInstance().DetailsBox.removeProfileW(tappedItemWhatsapp); } } }
public void addProfileEmail(ProfileEmail _profileEmail) { var E = Converter.ToProfileLocalE1(_profileEmail); ProfilePerfiles.Add(E); }
void OnListViewItemTapped(object sender, ItemTappedEventArgs e) { ProfileLocal tappedItemProfile = e.Item as ProfileLocal; switch (tappedItemProfile.Logo) { case "mail2": ProfileEmail E = Converter.ToProfileEmail(tappedItemProfile); if (E.Exist == false) { PostProfileEmail(Box.BoxId, E.ProfileEmailId); E.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileEmail(E); MainViewModel.GetInstance().DetailsBox.addProfileEmail(E); } else { DeleteProfileEmail(Box.BoxId, E.ProfileEmailId); E.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileEmail(E); MainViewModel.GetInstance().DetailsBox.removeProfileEmail(E); } break; case "tel2": ProfilePhone P = Converter.ToProfilePhone(tappedItemProfile); if (P.Exist == false) { PostProfilePhone(Box.BoxId, P.ProfilePhoneId); P.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfilePhone(P); MainViewModel.GetInstance().DetailsBox.addProfilePhone(P); } else { DeleteProfilePhone(Box.BoxId, P.ProfilePhoneId); P.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfilePhone(P); MainViewModel.GetInstance().DetailsBox.removeProfilePhone(P); } break; case "facebook2": ProfileSM SMfb = Converter.ToProfileSM(tappedItemProfile); if (SMfb.Exist == false) { PostProfileSM(Box.BoxId, SMfb.ProfileMSId); SMfb.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMfb); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMfb); } else { DeleteProfileSM(Box.BoxId, SMfb.ProfileMSId); SMfb.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMfb); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMfb); } break; case "twitterlogo2": ProfileSM SMtwtt = Converter.ToProfileSM(tappedItemProfile); if (SMtwtt.Exist == false) { PostProfileSM(Box.BoxId, SMtwtt.ProfileMSId); SMtwtt.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMtwtt); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMtwtt); } else { DeleteProfileSM(Box.BoxId, SMtwtt.ProfileMSId); SMtwtt.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMtwtt); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMtwtt); } break; case "instagramlogo2": ProfileSM SMIns = Converter.ToProfileSM(tappedItemProfile); if (SMIns.Exist == false) { PostProfileSM(Box.BoxId, SMIns.ProfileMSId); SMIns.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMIns); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMIns); } else { DeleteProfileSM(Box.BoxId, SMIns.ProfileMSId); SMIns.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMIns); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMIns); } break; case "snapchat2": ProfileSM SMSnap = Converter.ToProfileSM(tappedItemProfile); if (SMSnap.Exist == false) { PostProfileSM(Box.BoxId, SMSnap.ProfileMSId); SMSnap.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMSnap); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMSnap); } else { DeleteProfileSM(Box.BoxId, SMSnap.ProfileMSId); SMSnap.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMSnap); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMSnap); } break; case "linkedin2": ProfileSM SMSLink = Converter.ToProfileSM(tappedItemProfile); if (SMSLink.Exist == false) { PostProfileSM(Box.BoxId, SMSLink.ProfileMSId); SMSLink.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMSLink); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMSLink); } else { DeleteProfileSM(Box.BoxId, SMSLink.ProfileMSId); SMSLink.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMSLink); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMSLink); } break; case "tiktok2": ProfileSM SMSTik = Converter.ToProfileSM(tappedItemProfile); if (SMSTik.Exist == false) { PostProfileSM(Box.BoxId, SMSTik.ProfileMSId); SMSTik.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMSTik); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMSTik); } else { DeleteProfileSM(Box.BoxId, SMSTik.ProfileMSId); SMSTik.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMSTik); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMSTik); } break; case "youtube2": ProfileSM SMYou = Converter.ToProfileSM(tappedItemProfile); if (SMYou.Exist == false) { PostProfileSM(Box.BoxId, SMYou.ProfileMSId); SMYou.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMYou); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMYou); } else { DeleteProfileSM(Box.BoxId, SMYou.ProfileMSId); SMYou.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMYou); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMYou); } break; case "spotify2": ProfileSM SMSP = Converter.ToProfileSM(tappedItemProfile); if (SMSP.Exist == false) { PostProfileSM(Box.BoxId, SMSP.ProfileMSId); SMSP.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMSP); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMSP); } else { DeleteProfileSM(Box.BoxId, SMSP.ProfileMSId); SMSP.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMSP); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMSP); } break; case "twitch2": ProfileSM SMTwc = Converter.ToProfileSM(tappedItemProfile); if (SMTwc.Exist == false) { PostProfileSM(Box.BoxId, SMTwc.ProfileMSId); SMTwc.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMTwc); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMTwc); } else { DeleteProfileSM(Box.BoxId, SMTwc.ProfileMSId); SMTwc.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMTwc); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMTwc); } break; case "gmail2": ProfileSM SMWeb = Converter.ToProfileSM(tappedItemProfile); if (SMWeb.Exist == false) { PostProfileSM(Box.BoxId, SMWeb.ProfileMSId); SMWeb.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMWeb); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMWeb); } else { DeleteProfileSM(Box.BoxId, SMWeb.ProfileMSId); SMWeb.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMWeb); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMWeb); } break; case "whatsapp2": ProfileWhatsapp W = Converter.ToProfileWhatsapp(tappedItemProfile); if (W.Exist == false) { PostProfileWhatsapp(Box.BoxId, W.ProfileWhatsappId); W.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileWhatsapp(W); MainViewModel.GetInstance().DetailsBox.addProfileW(W); } else { DeleteProfileWhatsapp(Box.BoxId, W.ProfileWhatsappId); W.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileWhatsapp(W); MainViewModel.GetInstance().DetailsBox.removeProfileW(W); } break; case "telegram2": ProfileSM SMT = Converter.ToProfileSM(tappedItemProfile); if (SMT.Exist == false) { PostProfileSM(Box.BoxId, SMT.ProfileMSId); SMT.Exist = true; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMT); MainViewModel.GetInstance().DetailsBox.addProfileSM(SMT); } else { DeleteProfileSM(Box.BoxId, SMT.ProfileMSId); SMT.Exist = false; MainViewModel.GetInstance().ListOfNetworks.updateProfileSM(SMT); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SMT); } break; default: break; } }
private async void UpdateBoxName(object sender, EventArgs e, int _BoxId, string _name, int _UserId, bool disabled) { //Actualizar el nombre de la Box var apiSecurity = Application.Current.Resources["APISecurity"].ToString(); Box = await this.apiService.GetBox( apiSecurity, "/api", "/Boxes", _BoxId); var box3 = new Box(); box3 = new Box { BoxId = Box.BoxId, BoxDefault = Box.BoxDefault, Name = NameEntry.Text, UserId = Box.UserId, Time = Box.Time, ColorBox = Box.ColorBox }; /*if (ColorH == "") * { * box3 = new Box * { * BoxId = Box.BoxId, * BoxDefault = Box.BoxDefault, * Name = NameEntry.Text, * UserId = Box.UserId, * Time = Box.Time, * ColorBox = Box.ColorBox * }; * } * else * { * box3 = new Box * { * BoxId = Box.BoxId, * BoxDefault = Box.BoxDefault, * Name = NameEntry.Text, * UserId = Box.UserId, * Time = Box.Time, * ColorBox = ColorH * }; * }*/ await MainViewModel.GetInstance().DetailsBoxEdith.EdithBox(box3); //BoxName = _name; foreach (ProfileLocal Prof in ProfilesSelected) { if (Prof.Logo == "mail3") { DeleteProfileEmail(_BoxId, Prof.ProfileId); ProfileEmail E = Converter.ToProfileEmail(Prof); MainViewModel.GetInstance().DetailsBox.removeProfileEmail(E); } else if (Prof.Logo == "tel3") { DeleteProfilePhone(_BoxId, Prof.ProfileId); ProfilePhone P = Converter.ToProfilePhone(Prof); MainViewModel.GetInstance().DetailsBox.removeProfilePhone(P); } else if (Prof.Logo == "whatsapp3") { DeleteProfileWhatsapp(_BoxId, Prof.ProfileId); ProfileWhatsapp W = Converter.ToProfileWhatsapp(Prof); MainViewModel.GetInstance().DetailsBox.removeProfileW(W); } else if (Prof.Logo != "mail3" && Prof.Logo != "tel3" && Prof.Logo != "whatsapp3") { DeleteProfileSM(_BoxId, Prof.ProfileId); ProfileSM SM = Converter.ToProfileSM(Prof); MainViewModel.GetInstance().DetailsBox.removeProfileSM(SM); } } await Navigation.PopPopupAsync(); }
//Actualizar lista Email public void addProfileEmail(ProfileEmail _profileEmail) { ProfileEmail.Add(_profileEmail); EmptyList = false; }
public ProfilesPage() { InitializeComponent(); MainViewModel.GetInstance().Profiles.GetListEmail(); selectedItem = null; #region Listas ProfileListEmail.IsVisible = true; ProfileListPhone.IsVisible = false; ProfileListFacebook.IsVisible = false; ProfileListInstagram.IsVisible = false; ProfileListLinkedin.IsVisible = false; ProfileListSnapchat.IsVisible = false; ProfileListSpotify.IsVisible = false; ProfileListTelegram.IsVisible = false; ProfileListTiktok.IsVisible = false; ProfileListTwitch.IsVisible = false; ProfileListTwitter.IsVisible = false; ProfileListWebPage.IsVisible = false; ProfileListWhatsapp.IsVisible = false; ProfileListYoutube.IsVisible = false; #endregion #region Buttons ButtonEmail.IsVisible = true; ButtonFacebook.IsVisible = false; ButtonInstagram.IsVisible = false; ButtonLinkedin.IsVisible = false; ButtonPhone.IsVisible = false; ButtonSnapchat.IsVisible = false; ButtonSpotify.IsVisible = false; ButtonTelegram.IsVisible = false; ButtonTiktok.IsVisible = false; ButtonTwitch.IsVisible = false; ButtonTwitter.IsVisible = false; ButtonWebPage.IsVisible = false; ButtonWhatsapp.IsVisible = false; ButtonYoutube.IsVisible = false; #endregion #region Image ImageEmail.IsVisible = true; ImageFacebook.IsVisible = false; ImageInstagram.IsVisible = false; ImageLinkedIn.IsVisible = false; ImagePhone.IsVisible = false; ImageSnapchat.IsVisible = false; ImageSpotify.IsVisible = false; ImageTelegram.IsVisible = false; ImageTiktok.IsVisible = false; ImageTwitch.IsVisible = false; ImageTwitter.IsVisible = false; ImageWeb.IsVisible = false; ImageWhatsapp.IsVisible = false; ImageYoutube.IsVisible = false; #endregion #region Commands ButtonFacebook.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Facebook")); ButtonInstagram.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Instagram")); ButtonLinkedin.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Linkedin")); ButtonSnapchat.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Snapchat")); ButtonSpotify.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Spotify")); ButtonTelegram.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Telegram")); ButtonTiktok.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Tiktok")); ButtonTwitch.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Twitch")); ButtonTwitter.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Twitter")); ButtonWebPage.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "WebPage")); ButtonYoutube.Clicked += new EventHandler((sender, e) => ButtonSM_Clicked(sender, e, "Youtube")); #endregion }