public IList<Core.Business.INSTRREALM> GetAllINSTRREALM()
        {
            IList<Core.Business.INSTRREALM> iNSTRREALMlist = new List<Core.Business.INSTRREALM>();
            SqlServerUtility sql = new SqlServerUtility();

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

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.INSTRREALM iNSTRREALM = new Core.Business.INSTRREALM();

                    if (!reader.IsDBNull(0)) iNSTRREALM.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) iNSTRREALM.DomainId = reader.GetGuid(1);
                    if (!reader.IsDBNull(2)) iNSTRREALM.InstruId = reader.GetGuid(2);

                    iNSTRREALM.MarkOld();
                    iNSTRREALMlist.Add(iNSTRREALM);
                }
                reader.Close();
            }
            return iNSTRREALMlist;
        }
        public IList<CY.CSTS.Core.Business.INSTRREALM> GetInstrrealmDynamic(string whereCondition, string orderByExpression)
        {
            if (string.IsNullOrEmpty(whereCondition))
            {
                return this.GetAllINSTRREALM();
            }

            IList<Core.Business.INSTRREALM> iNSTRREALMlist = new List<Core.Business.INSTRREALM>();
            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@WhereCondition", SqlDbType.NVarChar, whereCondition);
            sql.AddParameter("@OrderByExpression", SqlDbType.NVarChar, orderByExpression);
            SqlDataReader reader = sql.ExecuteSPReader("usp_SelectINSTRREALMsDynamic");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.INSTRREALM iNSTRREALM = new Core.Business.INSTRREALM();

                    if (!reader.IsDBNull(0)) iNSTRREALM.Id = reader.GetGuid(0);
                    if (!reader.IsDBNull(1)) iNSTRREALM.DomainId = reader.GetGuid(1);
                    if (!reader.IsDBNull(2)) iNSTRREALM.InstruId = reader.GetGuid(2);

                    iNSTRREALM.MarkOld();
                    iNSTRREALMlist.Add(iNSTRREALM);
                }
                reader.Close();
            }
            return iNSTRREALMlist;
        }