Ejemplo n.º 1
0
        /// <summary>
        /// Purpose: Grabs configuration information based on configuration code
        /// Accepts: String
        /// Returns: Hashtable
        /// </summary>
        public Hashtable GetConfigurationByCode(string code)
        {
            Configuration obj = new Configuration();
            QuickStart_DBEntities dbContext;
            Hashtable hsh = new Hashtable();
            try
            {
                dbContext = new QuickStart_DBEntities();
                obj = dbContext.Configurations.FirstOrDefault(c => c.ConfigurationCode == code);
                if (obj != null)
                {
                    hsh["configurationcode"] = obj.ConfigurationCode;
                    hsh["description"] = obj.Description;
                    hsh["value"] = obj.Value;
                    hsh["isyesnovalue"] = obj.IsYesNoValue;
                    hsh["yesnovalue"] = obj.YesNoValue;
                    hsh["modified"] = obj.Modified;
                }
            }
            catch (Exception ex)
            {
                ErrorLoggerData.ErrorRoutine(ex, "ConfigurationData", "GetConfigurationByCode");
            }

            return hsh;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Configurations EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToConfigurations(Configuration configuration)
 {
     base.AddObject("Configurations", configuration);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new Configuration object.
 /// </summary>
 /// <param name="configurationCode">Initial value of the ConfigurationCode property.</param>
 public static Configuration CreateConfiguration(global::System.String configurationCode)
 {
     Configuration configuration = new Configuration();
     configuration.ConfigurationCode = configurationCode;
     return configuration;
 }