Пример #1
0
        public CamProfile ReadAssetProfile(string DriveID)
        {
            CamProfile camProfile = new CamProfile();

            if (IsProfile(DriveID))
            {
                camProfile = (CamProfile)FileCrypto.LoadConfig(Path.Combine(DriveID, "C3Sentinel.Dat")) ?? new CamProfile();
            }
            return(camProfile);
        }
Пример #2
0
        public Account GetProfileAccount(string DriveID)
        {
            Account    account    = null;
            Guid       id         = Guid.Empty;
            CamProfile camProfile = this.ReadAssetProfile(DriveID);

            if (camProfile != null)
            {
                using (RPM_Product rpmProduct = new RPM_Product())
                {
                    Inventory inventory = rpmProduct.GetInventory(camProfile.InventoryID);
                    if (inventory != null)
                    {
                        id = inventory.AccountID;
                    }
                }
            }
            if (id != Guid.Empty)
            {
                using (RPM_Account rpmAccount = new RPM_Account())
                    account = rpmAccount.GetAccount(id);
            }
            return(account);
        }
Пример #3
0
 public bool SaveAssetProfile(string DriveID, CamProfile rec)
 {
     FileCrypto.Save((object)rec, Path.Combine(DriveID, "C3Sentinel.Dat"));
     new FileInfo(Path.Combine(DriveID, "C3Sentinel.Dat")).Attributes = FileAttributes.Hidden;
     return(IsProfile(DriveID));
 }