Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     settings = CY.CYWebsite.Core.Business.Web_Settings.Load(0);
 }
Ejemplo n.º 2
0
        public CY.CYWebsite.Core.Business.Web_Settings SelectLatest()
        {
            SqlServerUtility db = new SqlServerUtility();

            SqlDataReader reader = db.ExecuteSqlReader(SqlSelectLatestSetting);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                CY.CYWebsite.Core.Business.Web_Settings setting = new CY.CYWebsite.Core.Business.Web_Settings();

                setting.Id = reader.GetInt32(0);

                if (!reader.IsDBNull(1)) setting.CompanyName = reader.GetString(1);
                if (!reader.IsDBNull(2)) setting.Copyright = reader.GetString(2);
                if (!reader.IsDBNull(3)) setting.Author = reader.GetString(3);
                if (!reader.IsDBNull(4)) setting.ReadInfo = reader.GetString(4);
                if (!reader.IsDBNull(5)) setting.Contact = reader.GetString(5);
                if (!reader.IsDBNull(6)) setting.Address = reader.GetString(6);

                reader.Close();

                setting.MarkOld();

                return setting;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }