public bool RetrieveExpressImportStatus()
        {
            try
            {
                var headerValues = Request.Headers.GetValues("Authorization");
                var token = headerValues.FirstOrDefault();
                var credentialsFromToken = Token.GetCredentialsFromToken(token);

                var siteUrl = ConfigurationManager.AppSettings["url"];
                var sharepointContext = new SharepointContext(siteUrl, credentialsFromToken[0], credentialsFromToken[1]);

                var streamReader = new StreamReader(HttpContext.Current.Request.InputStream);
                var retrievedPostData = streamReader.ReadToEnd();
                var jObject = JObject.Parse(retrievedPostData);
                var resourceId = (string)jObject["resourceId"];

                var query = string.Format(Query.ExpressImport, resourceId);
                var retrievedListItems = sharepointContext.RetrieveListItems(query, List.ExpressImports);

                return retrievedListItems.ToList().Count != 0;
            }
            catch (Exception)
            {
                return false;
                throw;
            }
        }
        public List<CustomerModel> GetProjectsList()
        {
            try
            {
                var headerValues = Request.Headers.GetValues("Authorization");
                var token = headerValues.FirstOrDefault();
                var credentialsFromToken = Token.GetCredentialsFromToken(token);

                var siteUrl = ConfigurationManager.AppSettings["url"];
                var sharepointContext = new SharepointContext(siteUrl, credentialsFromToken[0], credentialsFromToken[1]);

                var retrievedListItems = sharepointContext.RetrieveListItems(Query.Customers, List.Customers);
                var customerList = retrievedListItems.Select(item => new CustomerModel(item)).ToList();

                return customerList.Count == 0 ? null : customerList;
            }
            catch (IdcrlException)
            {
                return null;
            }
            catch (InvalidOperationException)
            {
                return null;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List<ResourceModel> GetAuthenticationWithToken()
        {
            try
            {
                var headerValues = Request.Headers.GetValues("Authorization");
                var token = headerValues.FirstOrDefault();

                var siteUrl = ConfigurationManager.AppSettings["url"];
                var credentialsFromToken = Token.GetCredentialsFromToken(token);
                var sharepointContext = new SharepointContext(siteUrl, credentialsFromToken[0], credentialsFromToken[1]);
                var query = string.Format(Query.ResourceId, credentialsFromToken[0]);

                const string listTitle = List.Resources;

                var retrievedListItems = sharepointContext.RetrieveListItems(query, listTitle);
                var idList = retrievedListItems.Select(item => new ResourceModel(item)).ToList();

                return idList.Count == 0 ? null : idList;
            }
            catch (IdcrlException)
            {
                return null;
            }
        }
        public List<ResourceModel> AuthenticationWithCredentials()
        {
            try
            {
                var streamReader = new StreamReader(HttpContext.Current.Request.InputStream);
                var retrievedPostData = streamReader.ReadToEnd();
                var jObject = JObject.Parse(retrievedPostData);
                var username = Token.DecryptStringAes((string)jObject["username"]);
                var password = Token.DecryptStringAes((string)jObject["password"]);

                var siteUrl = ConfigurationManager.AppSettings["url"];
                var sharepointContext = new SharepointContext(siteUrl, username, password);
                var query = string.Format(Query.ResourceId, username);

                var retrievedListItems = sharepointContext.RetrieveListItems(query, List.Resources);
                var idList = retrievedListItems.Select(item => new ResourceModel(item)).ToList();

                return idList.Count == 0 ? null : idList;
            }
            catch (IdcrlException)
            {
                return null;
            }
        }