Exemple #1
0
        private void SetProfileContentTypeButton_Click(object sender, EventArgs e)
        {
            List <string> errors = new List <string>();

            SetProfileContentTypeButton.Enabled = false;
            int count = 0;
            var table = PoliticiansImagesData.GetAllData();

            foreach (var row in table)
            {
                count++;
                string politicianKey = row.PoliticianKey;
                byte[] blob          =
                    PoliticiansImagesBlobs.GetProfileOriginalByPoliticianKey(politicianKey);
                if (blob != null)
                {
                    string contentType = Images.GetContentType(blob);
                    if (contentType == null)
                    {
                        errors.Add(politicianKey);
                    }
                    else
                    {
                        PoliticiansImagesData.UpdateProfileOriginalContentTypeByPoliticianKey(
                            contentType, politicianKey);
                    }
                }
            }
        }