public ResourceLink(int id) { var dataRow = SqlHelpers.Select(SqlStatements.SQL_GET_RESOURCE_LINK_BY_ID.FormatWith(id)).Rows[0]; Id = dataRow["Id"].ToString().GetInt32(); Title = dataRow["Title"].ToString(); Description = dataRow["Description"].ToString(); URL = dataRow["URL"].ToString(); ThumbNail = dataRow["ThumbNail"].ToString(); Count = dataRow["Count"].ToString().GetInt32(); LastClicked = dataRow["LastClicked"].ToString().GetAsDate(); Active = dataRow["Active"].ToString().GetAsBool(); }
protected void Page_Load(object sender, EventArgs e) { // Set page name in the title section SessionInfo.CurrentPage = PageNames.Home; TitleTag.Text = SessionInfo.DisplayCurrentPage; HomePageBottom.Text = SessionInfo.PageContent(PageContentBlocks.HomePageBottom); var senText = SqlHelpers.Select(SqlStatements.SQL_SELECT_RANDOM_SAYING); if (!senText.IsNullOrEmpty()) { SentimentalTitle.Text = senText.Rows[0][0].ToString(); SentimentalText.Text = senText.Rows[0][1].ToString(); } }
public void LoadUserDetails(string id) { try { var dataRow = SqlHelpers.Select(SqlStatements.SQL_GET_USER_DETAILS.FormatWith(id)).Rows[0]; if (dataRow.IsNullOrEmpty()) { return; } Id = dataRow["Id"].ToString(); DisplayName = dataRow["DisplayName"].ToString(); UserName = dataRow["UserName"].ToString(); Notes = "Last Visit: {0}".FormatWith(dataRow["LastVisit"].ToString().GetAsDate().ToShortDateString()); } catch (Exception ex) { LogError("SystemUser: Load User method", ex); throw new ApplicationException("Record not found"); } }
private static SystemSettings LoadSystemSettings() { try { var dataRow = SqlHelpers.Select(SqlStatements.SQL_GET_MAIL_SETTINGS).Rows[0]; return(new SystemSettings() { Id = dataRow["Id"].ToString(), MailServer = dataRow["MailServer"].ToString(), ServerPort = dataRow["ServerPort"].ToString().GetInt32(), SmtpUser = dataRow["SmtpUser"].ToString(), SmtpPassword = dataRow["SmtpPassword"].ToString().DecryptString(), FromEmail = dataRow["FromEmail"].ToString(), FromUsername = dataRow["FromUsername"].ToString(), RequireAuth = dataRow["RequireAuth"].ToString().GetAsBool(), RequireSsl = dataRow["RequireSsl"].ToString().GetAsBool() }); } catch (Exception ex) { SqlHelpers.Insert(SqlStatements.SQL_LOG_EXCEPTION.FormatWith(DateTime.Now.ConvertSqlDateTime(), "SystemSettings", ex.Message.FixSqlString(), ex.StackTrace.FixSqlString())); throw new ApplicationException("Sql Server Not accessible"); } }
//Admin public static DataTable GetRegistrationList() => SqlHelpers.Select(SqlStatements.SQL_GET_REGISTRATION_LIST);
public static DataTable GetAdminResourceLinks() => SqlHelpers.Select(SqlStatements.SQL_GET_ALL_RESOURCE_LINKS);
public static DataTable GetAllPageLocations() => SqlHelpers.Select(SqlStatements.SQL_GET_PAGE_LOCATIONS);
//Pages public static DataTable GetAllSentimentalSayings() => SqlHelpers.Select(SqlStatements.SQL_SELECT_ALL_SAYINGS);
//public static DataTable GetClientList() => SqlHelpers.Select(SqlStatements.SQL_GET_CLIENT_LIST); public static DataTable GetAdminList() => SqlHelpers.Select(SqlStatements.SQL_GET_ADMIN_LIST);