public virtual void SettingsDelete(Settings entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       m_DataContext.ndihdSettingsDelete(entity.Key);
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
Example #2
0
        private bool GetMenuVisibility(Settings setting)
        {
            bool visibility = false;

              if (setting != null)
              {
            try
            {
              visibility = bool.Parse(setting.Value);
            }
            catch
            {
              visibility = false;
            }
              }

              return visibility;
        }
Example #3
0
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="KeyVal">Value of 'cKey' field</param>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public Settings(DBString KeyVal,
             Settings origInstance)
     : base(KeyVal, origInstance)
 {
 }
Example #4
0
 // -------------------------------------------------------------------------------------
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="origInstance">Original document data to copy.</param>
 // -------------------------------------------------------------------------------------
 public Settings(Settings origInstance)
     : base(origInstance)
 {
 }
 public virtual void SettingsUpdate(Settings entity)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     m_DataContext.BeginNestedTran();
     try
     {
       int count;
       m_DataContext.ndihdSettingsUpdate(entity.Key,
                                     entity.Name,
                                     entity.Value,
                                     entity.CreatedDate, out count);
       if (count == 0) throw new ServiceUpdateException();
       m_DataContext.CommitNested();
     }
     catch
     {
       m_DataContext.RollbackNested();
       throw;
     }
     TraceCallReturnEvent.Raise();
     return;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
 public virtual Settings SettingsSelect(DBString KeyVal)
 {
     TraceCallEnterEvent.Raise();
       try
       {
     Settings result = null;
     DataSet entitySet = m_DataContext.ndihdSettingsSelect(KeyVal);
     if (entitySet.Tables[0].Rows.Count != 0)
     {
       result = new Settings(entitySet);
     }
     TraceCallReturnEvent.Raise();
     return result;
       }
       catch (Exception ex)
       {
     ExceptionManager.Publish(ex);
     TraceCallReturnEvent.Raise(false);
     throw;
       }
 }
Example #7
0
        // -------------------------------------------------------------------------------------
        /// <summary>
        /// Prepage Save action
        /// </summary>
        // -------------------------------------------------------------------------------------
        private void SaveData()
        {
            ISettingsService srvSettings = ServiceFactory.GetSettingsService();

              // Zöld szám láthatósága
              string keyname = "GreenNumber.Visibility";
              Settings setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = chkGreenNumberVisible.Checked ? "True" : "False";
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = chkGreenNumberVisible.Checked ? "True" : "False";
            srvSettings.SettingsInsert(settingnew);
              }
              keyname = "GreenNumber.Value";
              // Zöld szám értéke
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = txtGreenNumber.Text;
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = txtGreenNumber.Text;
            srvSettings.SettingsInsert(settingnew);
              }
              keyname = "DictionaryMenu.Visibility";

              // Szótár menüpont láthatósága
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = chkDictionary.Checked ? "True" : "False";
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = chkDictionary.Checked ? "True" : "False";
            srvSettings.SettingsInsert(settingnew);
              }
              // Kulcsszavas keresés menüpont láthatósága
              keyname = "SearchKeywordMenu.Visibility";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = chkSearchKeywordMenuVisible.Checked ? "True" : "False";
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = chkSearchKeywordMenuVisible.Checked ? "True" : "False";
            srvSettings.SettingsInsert(settingnew);
              }
              // Fórum menüpont láthatósága
              //setting = srvSettings.SettingsSelect("ForumMenu.Visibility");

              //if (setting != null)
              //{
              //  setting.Value = chkForumMenuVisible.Checked ? "True" : "False";
              //  srvSettings.SettingsUpdate(setting);
              //}

              // Keresés a fórumban menüpont láthatósága
              //setting = srvSettings.SettingsSelect("ForumItemSearchMenu.Visibility");
              //if (setting != null)
              //{
              //  setting.Value = chkForumItemSearchMenuVisible.Checked ? "True" : "False";
              //  srvSettings.SettingsUpdate(setting);
              //}

              //KEF-ek listája lapméret
              keyname = "KefList.GridPageCount";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = txtKefListCount.Text;
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = txtKefListCount.Text;
            srvSettings.SettingsInsert(settingnew);
              }

              //Szabadszöveges
              keyname = "Search.Freetext";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = txtFreeText.Text;
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = txtFreeText.Text;
            srvSettings.SettingsInsert(settingnew);
              }
              //Kulcsszavas
              keyname = "Search.Keyword";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = txtKeyWord.Text;
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = txtKeyWord.Text;
            srvSettings.SettingsInsert(settingnew);
              }
              //Megyék szerinti
              keyname = "Search.Map";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = txtMapSearch.Text;
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = txtMapSearch.Text;
            srvSettings.SettingsInsert(settingnew);
              }
              //Tematikus
              keyname = "Search.QuestionForm";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = txtQuestionForm.Text;
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = txtQuestionForm.Text;
            srvSettings.SettingsInsert(settingnew);
              }
              //Szervezetek
              keyname = "Search.Organisation";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = txtOrganisation.Text;
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = txtOrganisation.Text;
            srvSettings.SettingsInsert(settingnew);
              }
              //Program
              keyname = "Search.Program";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = txtProgram.Text;
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = txtProgram.Text;
            srvSettings.SettingsInsert(settingnew);
              }
              //Szakemberek
              keyname = "Search.Expert";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = txtExpert.Text;
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = txtExpert.Text;
            srvSettings.SettingsInsert(settingnew);
              }

              keyname = "OrgDataSource.Visibility";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = chkSource.Checked ? "True" : "False";
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = chkSource.Checked ? "True" : "False";
            srvSettings.SettingsInsert(settingnew);
              }

              keyname = "OrgDataWorkers.Visibility";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = chkWorkers.Checked ? "True" : "False";
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = chkWorkers.Checked ? "True" : "False";
            srvSettings.SettingsInsert(settingnew);
              }

              keyname = "OrgDataJob.Visibility";
              setting = srvSettings.SettingsSelect(keyname);

              if (setting != null)
              {
            setting.Value = chkJobs.Checked ? "True" : "False";
            srvSettings.SettingsUpdate(setting);
              }
              else
              {
            Settings settingnew = new Settings(keyname);
            settingnew.Name = keyname;
            settingnew.CreatedDate = DateTime.Now;
            settingnew.Value = chkJobs.Checked ? "True" : "False";
            srvSettings.SettingsInsert(settingnew);
              }

              MessageBox.Show("A beállításokat elmentettük!",
                      "NDI HelpDesk Adminisztrátor", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }