// INITIALIZER public Form(ref SQL SQL) { this.SQL = SQL; SQL.OpenDatabase(); }
public UIFS.SQL SQL; // SQL (a database) is essential and used everywhere in this module #endregion Fields #region Constructors public Reporting(ref SQL SQL) { this.SQL = SQL; // Load information needed to operate (settings) try { SQL.Query = SQL.SQLQuery.Reporting_Settings_FormLink; SQL.cmd = SQL.Command(SQL.Data); SQL.sdr = SQL.cmd.ExecuteReader(); SQL.sdr.Read(); // "FormLinks" is how the application lets UIFS know what Subjects/Details are "tied" to a UIFS.Form this.FormLinks = (FormLink)JsonConvert.DeserializeObject(SQL.sdr.GetString(0), typeof(FormLink)); SQL.sdr.Close(); } catch (Exception ex) { // ERROR: failed to load needed data for reporting engine SQL.WriteLog_Error(ex, "Failed to load needed data for reporting engine", "UIFS.Reporting()"); } }
void Session_Start(object sender, EventArgs e) { UIFS.SQL SQL = new UIFS.SQL(ConfigurationManager.AppSettings["SQL_Default"]); Session["SQL"] = SQL; }