public bool UpdateShare(Share share, SecureItem item, string newStatus) { try { ShareRequest reqData = new ShareRequest(); reqData.uuid = share.Id.ToString(); reqData.data = EncriptItemForShare(share, Encoding.UTF8.GetString(Convert.FromBase64String(share.ReceiverPrivateKey))); dynamic response = pbWebApi.RequestShare(reqData, String.Format("{0}|{1}", pbData.ActiveUser, pbData.DeviceUUID)); if (response.error != null) { MessageBox.Show(response.error.details.ToString(), response.error.message.ToString()); return(false); } share.Data = reqData.data; share.Status = reqData.status; pbData.AddOrUpdateShare(share); return(true); } catch { } return(false); }
public SecureItemWithPasswordViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { ListViewSecondName = Username = item.Data.username; Password = item.Data.password; ShowCopyPassword = true; InitCommand(); }
private void AddEmailToPI() { var SelectedCategory = new Folder(); SelectedCategory.Id = DefaultCategories.CategoryEmail; SelectedCategory.Name = DefaultCategories.CategoryEmail; SecureItem secureItem = new SecureItem() { SecureItemTypeName = DefaultProperties.SecurityItemType_PersonalInfo, Name = pbData.ActiveUser, Type = SecurityItemsDefaultProperties.SecurityItemSubType_PI_Email, Data = new SecureItemData() { email = pbData.ActiveUser, notes = "" }, Folder = SelectedCategory }; bool isExisting = pbData.IsSecureItemExistingBySimpleRule(pbData.ActiveUser, SecurityItemsDefaultProperties.SecurityItemSubType_PI_Email); if (!isExisting) { pbData.AddOrUpdateSecureItem(secureItem); } }
public CreditCardItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { IsDefaultImage = false; type = SecurityItemsDefaultProperties.SecurityItemType_DigitalWallet; subType = SecurityItemsDefaultProperties.SecurityItemSubType_DW_CreditCard; InitializeCollections(); NameOnCard = item.Data.nameOnCard; CardNumber = item.Data.cardNumber; if (item.Data.expires != null) { DateTime expires = new DateTime(); if (DateTime.TryParse(item.Data.expires, out expires)) { ExpiresMonth = expires.ToUniversalTime().Month.ToString(); ExpiresYear = expires.ToUniversalTime().Year.ToString(); } } if (item.Data.cardType != null) { SelectedCreditCard = CreditCards.FirstOrDefault(x => x.Type == item.Data.cardType); } IssuingBank = item.Data.issuingBank; SecurityCode = item.Data.security_code; PIN = item.Data.pin; IssueDate = item.Data.issueDate; }
public SecureItem GetSecureItem() { SecureItem secureItem = new SecureItem() { SecureItemTypeName = DefaultProperties.SecurityItemType_PasswordVault, Type = DefaultProperties.SecurityItemSubType_PV_Login, Site = new Site() { Name = this.SiteName, Uri = this.Url }, Name = this.SiteName, Data = new SecureItemData() { username = this.UserName, //!_common.IsEmailValid(this.UserName) ? this.UserName : null, //email = _common.IsEmailValid(this.UserName) ? this.UserName : null, // nickname = SiteName, re_enter_password = this.ReenterPassword, //ReenterMasterPassword, autologin = this.Autologin, //AutoLogin, notes = this.Notes, password = this.Password, sub_domain = this.Subdomain, //ThisSubdomainOnly, use_secure_browser = this.UseSecureBrowser, //UseSecureBrowser }, Folder = this.SelectedCategory }; return(secureItem); }
private bool SaveItem(SecureItem secureItem) { try { //if (urlChanged && Url != null && _common.IsUrlValid(Url, uriKind: UriKind.Absolute)) //{ // var siteId = pbData.GetSiteIdByUriFullSearch(new Uri(Url)); // secureItem.SiteData.Id = siteId; //} //bool updateSiteName = false; //if (string.IsNullOrEmpty(SiteName)) //{ // updateSiteName = true; //} if ((secureItem = pbData.AddOrUpdateSecureItem(secureItem)) == null) { Application.Current.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show("Error while saving item"); })); return(false); } return(true); //else //{ // //update shares // ShareCommon shareCommon = new ShareCommon(resolver); // shareCommon.UpdateShares(secureItem); // if (SecureItem == null) // { // var pw = inAppAnalyitics.Get<Events.PasswordVault, PasswordVaultItem>(); // pw.Log(new PasswordVaultItem(SecureItemAction.Added, ApplicationSource.MainUI)); // } // Task.Factory.StartNew(() => // { // sync.RegisterSites(); // if (updateSiteName) // { // secureItem.Name = pbData.GetSiteById(secureItem.SiteData.Id).FriendlyName; // } // pbData.AddOrUpdateSecureItem(secureItem); // }); //} } catch (Exception ex) { Application.Current.Dispatcher.BeginInvoke(new Action(() => { MessageBox.Show((string)Application.Current.FindResource("GeneralErrorText")); })); logger.Error(ex.Message); } return(false); }
public void UpdateShares(SecureItem item) { bkgUpdateShare = new BackgroundWorker(); bkgUpdateShare.WorkerReportsProgress = true; bkgUpdateShare.DoWork += bkgUpdateShare_DoWork; bkgUpdateShare.RunWorkerAsync(item); }
public PhoneSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PersonalInfo; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PI_PhoneNumber; Mobile = item.Data.phoneNumber; }
private void doAnalytics(ShareEventStatus?evStatus, SecureItem item) { if (evStatus.HasValue) { var analytics2 = inAppAnalyitics.Get <Events.Sharing, SharingItem>(); if (item.SecureItemTypeName == DefaultProperties.SecurityItemType_PasswordVault) { analytics2.Log(new SharingItem(ShareItemType.Password, evStatus.Value)); } if (item.SecureItemTypeName == DefaultProperties.SecurityItemType_DigitalWallet) { var shareType = SharingItem.GetShareEventItemTypeBaySecureItemType(item.Type); if (shareType.HasValue) { analytics2.Log(new SharingItem(shareType.Value, evStatus.Value)); } } if (item.SecureItemTypeName == DefaultProperties.SecurityItemType_PersonalInfo) { var shareType = SharingItem.GetShareEventItemTypeBaySecureItemType(item.Type); if (shareType.HasValue) { analytics2.Log(new SharingItem(shareType.Value, evStatus.Value)); } } } }
public WebsiteSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PasswordVault; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PV_Login; hasAddvancedSettings = true; Username = item.Data.username != null ? item.Data.username : item.Data.email; Password = item.Data.password; LastAccess = item.LastAccess; if (item.Site != null) { Url = item.Site.Uri; urlFromDb = item.Site.Uri; Autologin = item.Data.autologin; SubDomain = item.Data.sub_domain; UseSecureBrowser = item.Data.use_secure_browser; RequireMasterPassword = item.Data.require_master_password; var imagePath = GetImagePathForSite(item.Site.UUID, false); if (!string.IsNullOrEmpty(imagePath)) { IsDefaultImage = false; CanPickColor = false; Image = imagePath; } } InitCommand(); }
public EmailSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PersonalInfo; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PI_Email; EmailAddress = item.Data.email; }
public EmailAccountSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PasswordVault; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PV_EmailAccount; EmailAddress = item.Data.email; }
public MemberIDSecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_MemberIDs; FirstName = item.Data.firstName; LastName = item.Data.lastName; MemberID = item.Data.memberID; }
public AlarmCodeSecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_AlarmCode; Code = item.Data.alarm_code; AlarmCompany = item.Data.alarm_company; PhoneNumber = item.Data.phoneNumber; }
public NameSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PersonalInfo; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PI_Names; MiddleName = item.Data.middleName; LastName = item.Data.lastName; }
public SecureItemWithCountryViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { itemDataCountry = item.Data.country; if (item.Data.country != null && Countries != null) { SelectedCountry = Countries.SingleOrDefault(x => x.Code == item.Data.country); } }
public HealthInsuranceSecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_HealthInsurance; InsuranceCompany = item.Data.insurance_company; MemberID = item.Data.member_id; GroupNumber = item.Data.group_number; PrescriptionPlan = item.Data.prescription_plan; }
public EstatePlanSecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_EstatePlan; DocumentsLocation = item.Data.location_of_documents; Attorney = item.Data.attorney; Executor = item.Data.executor; Trustee = item.Data.trustee; }
public HotelRewardsSecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_HotelRewards; Hotel = item.Data.hotel; MembershipNumber = item.Data.membership_number; StatusLevel = item.Data.status_level; PhoneNumber = item.Data.phoneNumber; }
public FrequentFlyerSecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_FrequentFlyer; Airline = item.Data.airline; FrequentFlyerNumber = item.Data.frequent_flyer_number; StatusLevel = item.Data.status_level; AirlinePhoneNumber = item.Data.phoneNumber; }
public ServerSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PasswordVault; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PV_Server; Application = item.Data.application; ServerAddress = item.Data.server_address; Port = item.Data.port; }
public SocialSecuritySecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_SocialSecurity; FirstName = item.Data.firstName; LastName = item.Data.lastName; Number = item.Data.ssn; DateOfBirth = item.Data.dateOfBirth; }
public DatabaseSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PasswordVault; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PV_Database; ListViewSecondName = string.Empty; ServerAddress = item.Data.server_address; Port = item.Data.port; Database = item.Data.database; }
public AppSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PasswordVault; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PV_Application; ListViewSecondName = string.Empty; Application = item.Data.application; AppType = item.Data.type; }
public DriversLicenseSecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_DriverLicense; FirstName = item.Data.firstName; LastName = item.Data.lastName; Number = item.Data.driverLicenceNumber; Expires = item.Data.expires; State = item.Data.state; }
public AddressSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PersonalInfo; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PI_Address; Address1 = item.Data.address1; Address2 = item.Data.address2; City = item.Data.city; State = item.Data.state; ZipCode = item.Data.zipCode; }
public InsuranceSecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_Insurance; InsuranceType = item.Data.type; InsuranceCompany = item.Data.insurance_company; PolicyNumber = item.Data.policy_number; Agent = item.Data.agent; PhoneNumber = item.Data.agent_phone_number; RenewalDate = item.Data.renewal_date; }
public WifiSecureItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_PasswordVault; subType = SecurityItemsDefaultProperties.SecurityItemSubType_PV_WiFi; ListViewSecondName = SSID = item.Data.ssid; Authentication = item.Data.authentication; encryption = item.Data.encryption; FIPSMode = item.Data.fips_mode; KeyType = item.Data.key_type; }
public PrescriptionSecureItemViewModel(SecureItem item, Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_SecureNotes; subType = SecurityItemsDefaultProperties.SecurityItemSubType_SN_Prescription; Medicine = item.Data.medicine; Doctor = item.Data.doctor; DoctorPhone = item.Data.doctor_phone; Pharmacy = item.Data.pharmacy; PharmacyPhone = item.Data.pharmacy_phone; PrescriptionNumber = item.Data.prescription_number; Refills = item.Data.refills; }
public BankAccountItemViewModel(SecureItem item, System.Windows.Media.Brush defaultColor, ImageSource defaultIcon) : base(item, defaultColor, defaultIcon) { type = SecurityItemsDefaultProperties.SecurityItemType_DigitalWallet; subType = SecurityItemsDefaultProperties.SecurityItemSubType_DW_Bank; BankName = item.Data.bank_name; AccountName = item.Data.nameOnAccount; AccountNumber = item.Data.accountNumber; RoutingNumber = item.Data.iban; Pin = item.Data.pin; BankPhone = item.Data.bank_phone; BIC = item.Data.swift; }