|
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
/// <summary>
/// Summary description for SiteInfo
/// </summary>
public class SiteInfo
{
int _siteID=-1;
string _dataTransferProcNameName;
string _headerImagePath;
int _headerHeight;
int _headerWidth;
string _headerText;
string _styleSheetName;
int _daysToRemember;
string _webServiceKey;
string _returnUrl;
public SiteInfo()
{
}
public int SiteID
{
get { return _siteID; }
set { _siteID = value; }
}
public string DataTransferProcName
{
get { return _dataTransferProcNameName; }
}
public string HeaderImagePath
{
get { return _headerImagePath; }
}
public int HeaderHeight
{
get { return _headerHeight; }
}
public int HeaderWidth
{
get { return _headerWidth; }
}
public string HeaderText
{
get { return _headerText; }
}
public string StyleSheetName
{
get { return _styleSheetName; }
}
public int DaysToRemember
{
get { return _daysToRemember; }
}
public string WebServiceKey
{
get { return _webServiceKey; }
}
public string ReturnUrl
{
get { return _returnUrl; }
set { _returnUrl = value; }
}
public void RetrieveSiteInfo()
{
if (_siteID == -1)
throw new Exception("SiteID is missing");
SqlDataReader rd = null;
try
{
Database db = DatabaseFactory.CreateDatabase();
rd = (SqlDataReader) db.ExecuteReader("SiteInfo_GetSiteInfo", new object[] { _siteID });
if (rd.Read())
{
_dataTransferProcNameName = rd["DataTransferProcName"].ToString();
_headerImagePath = rd["HeaderImagePath"].ToString();
_headerHeight = Convert.ToInt16((rd["HeaderHeight"] == DBNull.Value ? -1 : rd["HeaderHeight"]));
_headerWidth = Convert.ToInt16((rd["HeaderWidth"] == DBNull.Value ? -1 : rd["HeaderWidth"]));
_styleSheetName = rd["StyleSheetName"].ToString();
_daysToRemember = Convert.ToInt16(rd["DaysToRemember"] == DBNull.Value ? 0 : rd["DaysToRemember"]);
_webServiceKey = rd["WebServiceKey"].ToString();
}
}
catch (Exception)
{
throw;
}
finally
{
if (rd != null)
rd.Close();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Web & Database Developer. Design and implement web and database applications utilizing Microsoft and other development tools.