public Dal() { Config config = new Config(); this.server = config.GetSetting("server"); this.database = config.GetSetting("database"); this.username = config.GetSetting("username"); this.password = config.GetSetting("password"); Initialize(); }
public Email() { Config config = new Config(); this.smtpserver = config.GetSetting("smtp.server"); this.smtpport = Convert.ToInt16(config.GetSetting("smtp.port")); this.smtpusername = config.GetSetting("smtp.username"); this.smtppassword = config.GetSetting("smtp.password"); this.smtpssl = Convert.ToBoolean(config.GetSetting("smtp.ssl")); this.emailfromaddress = config.GetSetting("email.from.address"); this.emailfromfriendly = config.GetSetting("email.from.friendly"); this.emailreplyaddress = config.GetSetting("email.reply.address"); }
private void loadTemplate(String templateName) { try { Config config = new Config(); this.templatelocation = config.GetSetting("templatesfolder"); if (!this.templatelocation.EndsWith(@"\")) this.templatelocation += @"\"; using (StreamReader sr = new StreamReader(this.templatelocation + templateName + ".html")) { this.templatehtml = sr.ReadToEnd(); } } catch (Exception e) { throw new Exception("Unable to load print template", e); } }