Beispiel #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            string   systemName = textBox1.Text;
            TimeSpan splashTime;

            TimeSpan.TryParse(textBox2.Text, out splashTime);
            bool isMetroDefualt = checkBox1.Checked;

            var branding = _brandingTableAdapter.GetData();

            if (branding.Count <= 0)
            {
                if (_programIconByteArray == null && _programImage == null && systemName == null && systemName.Equals("") && systemName.Equals(" ") &&
                    _splashColourCode == null)
                {
                    MessageBox.Show(SSS_Library.Properties.Resources.BrandingErrorMessage, SSS_Library.Properties.Resources.BrandingErrorMessage);
                }
                else if (_programIconByteArray == null || _programImage == null || systemName == null || systemName.Equals("") || systemName.Equals(" ") ||
                         _splashColourCode == null || splashTime == null)
                {
                    var updateBranding = branding.First();

                    if (_programIconByteArray != null)
                    {
                        updateBranding.program_icon = _programIconByteArray;
                    }
                    if (_programImage != null)
                    {
                        updateBranding.system_logo = _programImage;
                    }
                    if (systemName != null && (!systemName.Equals("") || !systemName.Equals(" ")))
                    {
                        updateBranding.system_name = systemName;
                    }
                    if (_splashColourCode != null)
                    {
                        updateBranding.splash_colour = _splashColourCode;
                    }
                    if (splashTime != null)
                    {
                        updateBranding.splash_time = splashTime;
                    }

                    _brandingTableAdapter.Update(updateBranding);
                    MessageBox.Show(SSS_Library.Properties.Resources.BrandingUpdateSuccess, SSS_Library.Properties.Resources.BrandingUpdateSuccess);
                }
                else
                {
                    _brandingTableAdapter.Insert(_programIconByteArray, _programImage, systemName, _splashColourCode, splashTime, false, isMetroDefualt);
                    MessageBox.Show(SSS_Library.Properties.Resources.BrandingUpdateSuccess, SSS_Library.Properties.Resources.BrandingUpdateSuccess);
                }
            }
        }
        public static void CleanDatabase()
        {
            //make database newish
            //reset passwords
            var userProfileTableAdapter = new SSS_Library.IS2G10_DBSSSDataSetTableAdapters.USERPROFILETableAdapter();
            var userProfiles = userProfileTableAdapter.GetData();
            foreach (var userProfile in userProfiles)
            {
                userProfile.resetPassword = true;
                userProfileTableAdapter.Update(userProfile);
            }

            var brandingTableAdapter = new SSS_Library.IS2G10_DBSSSDataSetTableAdapters.BRANDINGTableAdapter();
            var branding = brandingTableAdapter.GetData();
            branding[0].is_system_clean = true;

            //kill all attendance and stuff like that.
        }
        public static void CleanDatabase()
        {
            //make database newish
            //reset passwords
            var userProfileTableAdapter = new SSS_Library.IS2G10_DBSSSDataSetTableAdapters.USERPROFILETableAdapter();
            var userProfiles            = userProfileTableAdapter.GetData();

            foreach (var userProfile in userProfiles)
            {
                userProfile.resetPassword = true;
                userProfileTableAdapter.Update(userProfile);
            }

            var brandingTableAdapter = new SSS_Library.IS2G10_DBSSSDataSetTableAdapters.BRANDINGTableAdapter();
            var branding             = brandingTableAdapter.GetData();

            branding[0].is_system_clean = true;

            //kill all attendance and stuff like that.
        }
Beispiel #4
0
        private async Task <int> BindBranding()
        {
            _branding = _brandingTableAdapter.GetData().FirstOrDefault();

            if (_branding != null)
            {
                _timeSpec          = _branding.splash_time.TotalMilliseconds;
                _splashImage       = SSS_Library.DataServices.ByteImageConverter.ConvertBytesToImage(_branding.system_logo);
                _programIcon       = SSS_Library.DataServices.ByteImageConverter.ConvertBytesToIcon(_branding.program_icon);
                _splashProgramName = _branding.system_name;
                _splashColour      = Color.FromName(_branding.splash_colour);
            }
            else
            {
                _timeSpec          = 5000;
                _splashImage       = null;
                _programIcon       = null;
                _splashProgramName = "Student Support Program Default";
                _splashColour      = SystemColors.Control;
            }
            return(0);
        }