コード例 #1
0
 public void SaveItemDocument()
 {
     foreach (DocumentModel document in SelectedFiles)
     {
         string fileExtension = ".jpg";
         string newName       = GenerateRandom.RandomString(8) + fileExtension;
         var    newDocument   = new DocumentModel();
         newDocument.Name = newName + fileExtension;
         string baseDirectory = @"C:\Users\jwhit\Documents\RobinBradley2021SavedDocuments\EquipmentDocuments\";
         string fullPath      = Path.Combine(baseDirectory, newName);
         System.IO.File.Copy(document.Name, fullPath);
         Documents.Add(newDocument);
     }
 }
コード例 #2
0
        public void RegisterAccount()
        {
            createAccount.SignIn();
            GenerateRandom generateRandom = new GenerateRandom();

            account            = new Account();
            account.Email      = GenerateRandom.RandomEmail();
            account.FirstName  = GenerateRandom.RandomName();
            account.LastName   = GenerateRandom.RandomLastName();
            account.Password   = GenerateRandom.RandomPassword();
            account.Address    = GenerateRandom.RandomString(6, false);
            account.PostalCode = "00000";
            account.Alias      = "Ninguna";
            account.Country    = "United States";
            account.State      = GenerateRandom.RandomState();
            account.City       = "Lima";
            account.Phone      = GenerateRandom.RandomPhone(9);
            createAccount.CreateAccount(account);
        }