Пример #1
0
        void Save()
        {
            long configurationId = _configurationId.Text == "" ? 0 : Convert.ToInt64(_configurationId.Text);

            AWAPI_Data.Data.awConfiguration config = new AWAPI_Data.Data.awConfiguration();

            try
            {
                config.alias       = _alias.Text;
                config.title       = _title.Text;
                config.description = _description.Text;

                config.fileServiceUrl          = _fileServiceUrl.Text;
                config.contentServiceUrl       = _contentServiceUrl.Text;
                config.blogServiceUrl          = _blogServiceUrl.Text;
                config.pollServiceUrl          = _pollServiceUrl.Text;
                config.automatedTaskServiceUrl = _automatedTaskServiceUrl.Text;
                config.twitterServiceUrl       = _twitterServiceUrl.Text;
                config.weatherServiceUrl       = _weatherServiceUrl.Text;
                config.adminBaseUrl            = _adminBaseUrl.Text;
                config.fileDirectory           = _fileDirectory.Text;
                config.fileMimeXMLPath         = _fileMimeXMLPath.Text;
                config.fileSaveOnAmazonS3      = _fileSaveOnAmazonS3.Checked;
                config.fileAmazonS3AccessKey   = _fileAmazonS3AccessKey.Text;
                config.fileAmazonS3BucketName  = _fileAmazonS3BucketName.Text;
                config.fileAmazonS3SecreyKey   = _fileAmazonS3SecreyKey.Text;
                config.smtpServer = _smtpServer.Text;

                configurationId = _configLib.Save(configurationId,
                                                  config.alias, config.title, config.description, config.fileServiceUrl,
                                                  config.contentServiceUrl, config.blogServiceUrl, config.pollServiceUrl,
                                                  config.automatedTaskServiceUrl, config.twitterServiceUrl, config.weatherServiceUrl,
                                                  config.adminBaseUrl, config.fileDirectory, config.fileMimeXMLPath, config.fileSaveOnAmazonS3,
                                                  config.fileAmazonS3BucketName, config.fileAmazonS3AccessKey, config.fileAmazonS3SecreyKey,
                                                  config.smtpServer);

                _configurationId.Text = configurationId.ToString();

                ShowHideControls(true);

                PopulateList();

                AdminMaster.WriteMessage(AWAPI.Admin.AdminMaster.MessageType.INFO, "Configiration has been saved.");
            }
            catch (Exception ex)
            {
                AdminMaster.WriteMessage(AWAPI.Admin.AdminMaster.MessageType.ERROR, ex.Message);
            }
        }
Пример #2
0
        void Populate(long configId)
        {
            ResetControls();

            AWAPI_Data.Data.awConfiguration config = _configLib.Get(configId);
            if (config == null)
            {
                return;
            }

            _configurationId.Text = config.configurationId.ToString();
            _alias.Text           = config.alias;
            _title.Text           = config.title;
            _description.Text     = config.description;

            _fileServiceUrl.Text          = config.fileServiceUrl;
            _contentServiceUrl.Text       = config.contentServiceUrl;
            _blogServiceUrl.Text          = config.blogServiceUrl;
            _pollServiceUrl.Text          = config.pollServiceUrl;
            _automatedTaskServiceUrl.Text = config.automatedTaskServiceUrl;
            _twitterServiceUrl.Text       = config.twitterServiceUrl;
            _weatherServiceUrl.Text       = config.weatherServiceUrl;
            _adminBaseUrl.Text            = config.adminBaseUrl;
            _fileDirectory.Text           = config.fileDirectory;
            _fileMimeXMLPath.Text         = config.fileMimeXMLPath;
            _fileSaveOnAmazonS3.Checked   = config.fileSaveOnAmazonS3;
            _fileAmazonS3AccessKey.Text   = config.fileAmazonS3AccessKey;
            _fileAmazonS3BucketName.Text  = config.fileAmazonS3BucketName;
            _fileAmazonS3SecreyKey.Text   = config.fileAmazonS3SecreyKey;
            _smtpServer.Text = config.smtpServer;


            pnlAmaxonS3.Visible = config.fileSaveOnAmazonS3;

            ShowHideControls(true);
        }
 partial void UpdateawConfiguration(awConfiguration instance);
 partial void DeleteawConfiguration(awConfiguration instance);
 partial void InsertawConfiguration(awConfiguration instance);