Beispiel #1
0
 protected void Authorize(string taskName)
 {
     if (!AuthorizationProvider.Authorize(Thread.CurrentPrincipal, taskName))
     {
         ExceptionFactory.BusinessEntityException
         .Wrap <SecurityException>()
         .Add.Message(taskName + "User not Authorized for the Task : {0}")
         .Add.Arguments(this)
         .Raise();
     }
 }
Beispiel #2
0
        private static void Main()
        {
            var credential    = AuthorizationProvider.Authorize(AuthScopes);
            var driveService  = ServiceFactory.GetDriveService(credential);
            var sheetsService = ServiceFactory.GetSheetsService(credential);

            var files = Repository.GetFiles(driveService, MeasurementsFolderId);

            var data = Repository.ReadAllSheets(sheetsService, files);

            Processor.NormalizeDates(data);
            var measurementAverages = Processor.CalculateAverages(data).ToList();

            Repository.WriteData(measurementAverages);

            Console.WriteLine();
            Console.WriteLine("Done! Press any key to exit...");
            Console.Read();
        }