Ejemplo n.º 1
0
        public IList<Core.Business.SubCenterSetting> GetAllSubCenterSetting()
        {
            IList<Core.Business.SubCenterSetting> subCenterSettinglist = new List<Core.Business.SubCenterSetting>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSubCenterSettingsAll");

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.SubCenterSetting subCenterSetting = new Core.Business.SubCenterSetting();

                    if (!reader.IsDBNull(0)) subCenterSetting.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) subCenterSetting.UintID = reader.GetGuid(1);
                    if (!reader.IsDBNull(2)) subCenterSetting.Name = reader.GetString(2);
                    if (!reader.IsDBNull(3)) subCenterSetting.URI = reader.GetString(3);
                    if (!reader.IsDBNull(4)) subCenterSetting.Themes = reader.GetString(4);
                    if (!reader.IsDBNull(5)) subCenterSetting.User = reader.GetGuid(5);
                    if (!reader.IsDBNull(6)) subCenterSetting.Contact = reader.GetString(6);
                    if (!reader.IsDBNull(7)) subCenterSetting.Des = reader.GetString(7);

                    subCenterSetting.MarkOld();
                    subCenterSettinglist.Add(subCenterSetting);
                }
                reader.Close();
            }
            return subCenterSettinglist;
        }
Ejemplo n.º 2
0
        public Core.Business.SubCenterSetting GetSubCenterSetting(string sqlwhere)
        {
            Core.Business.SubCenterSetting subCenterSetting = new Core.Business.SubCenterSetting();
            SqlServerUtility sql = new SqlServerUtility();
            string sqlstr = "SELECT * FROM [dbo].[SubCenterSetting] WHERE ";
            sqlstr = sqlstr + sqlwhere;
            SqlDataReader reader = sql.ExecuteSqlReader(sqlstr);

            if (reader != null && !reader.IsClosed && reader.Read())
            {

                if (!reader.IsDBNull(0)) subCenterSetting.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) subCenterSetting.UintID = reader.GetGuid(1);
                if (!reader.IsDBNull(2)) subCenterSetting.Name = reader.GetString(2);
                if (!reader.IsDBNull(3)) subCenterSetting.URI = reader.GetString(3);
                if (!reader.IsDBNull(4)) subCenterSetting.Themes = reader.GetString(4);
                if (!reader.IsDBNull(5)) subCenterSetting.User = reader.GetGuid(5);
                if (!reader.IsDBNull(6)) subCenterSetting.Contact = reader.GetString(6);
                if (!reader.IsDBNull(7)) subCenterSetting.Des = reader.GetString(7);
                reader.Close();
            }
            subCenterSetting.MarkOld();
            return subCenterSetting;
        }
Ejemplo n.º 3
0
        public Core.Business.SubCenterSetting Select(Guid id)
        {
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectSubCenterSetting");

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.SubCenterSetting subCenterSetting = new Core.Business.SubCenterSetting();

                if (!reader.IsDBNull(0)) subCenterSetting.Id = reader.GetGuid(0);
                if (!reader.IsDBNull(1)) subCenterSetting.UintID = reader.GetGuid(1);
                if (!reader.IsDBNull(2)) subCenterSetting.Name = reader.GetString(2);
                if (!reader.IsDBNull(3)) subCenterSetting.URI = reader.GetString(3);
                if (!reader.IsDBNull(4)) subCenterSetting.Themes = reader.GetString(4);
                if (!reader.IsDBNull(5)) subCenterSetting.User = reader.GetGuid(5);
                if (!reader.IsDBNull(6)) subCenterSetting.Contact = reader.GetString(6);
                if (!reader.IsDBNull(7)) subCenterSetting.Des = reader.GetString(7);

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

                return null;
            }
        }