Example #1
0
        public static DBgl_FriendRequestCollection GetAllItem()
        {
            string key  = SETTINGS_ALL_KEY;
            object obj2 = dtpCache.Get(key);

            if ((obj2 != null))
            {
                return((DBgl_FriendRequestCollection)obj2);
            }
            DBgl_FriendRequestCollection ItemCollection = new DBgl_FriendRequestCollection();
            Database  db        = SqlHelper.CreateConnection(SqlHelper.MyConnection);
            DbCommand dbCommand = db.GetStoredProcCommand("gl_FriendRequest_GetAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBgl_FriendRequest item = GetItemFromReader(dataReader);
                    ItemCollection.Add(item);
                }
            }

            dtpCache.Max(key, ItemCollection);

            return(ItemCollection);
        }
Example #2
0
        public static DBgl_FriendRequestCollection GetAllItemByWfId(Guid WorkflowId)
        {
            string key  = String.Format(SETTINGS_WorkflowId_KEY, WorkflowId);
            object obj2 = dtpCache.Get(key);

            if ((obj2 != null))
            {
                return((DBgl_FriendRequestCollection)obj2);
            }
            DBgl_FriendRequestCollection ItemCollection = new DBgl_FriendRequestCollection();
            Database  db        = SqlHelper.CreateConnection(SqlHelper.MyConnection);
            DbCommand dbCommand = db.GetStoredProcCommand("gl_FriendRequest_GetAllByWfId");

            db.AddInParameter(dbCommand, "WorkflowID", DbType.Guid, WorkflowId);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBgl_FriendRequest item = GetItemFromReader(dataReader);
                    ItemCollection.Add(item);
                }
            }

            dtpCache.Max(key, ItemCollection);

            return(ItemCollection);
        }
Example #3
0
        public static DBgl_FriendRequestCollection GetAllItemFromUser(string fromUser)
        {
            string key  = string.Format(SETTINGS_ALL_FrmUser_KEY, fromUser);
            object obj2 = dtpCache.Get(key);

            if ((obj2 != null))
            {
                return((DBgl_FriendRequestCollection)obj2);
            }
            DBgl_FriendRequestCollection ItemCollection = new DBgl_FriendRequestCollection();
            Database  db        = SqlHelper.CreateConnection(SqlHelper.MyConnection);
            DbCommand dbCommand = db.GetStoredProcCommand("gl_FriendRequest_GetAllApproveByFromUser");

            db.AddInParameter(dbCommand, "FromUser", DbType.String, fromUser);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBgl_FriendRequest item = GetItemFromReader(dataReader);
                    ItemCollection.Add(item);
                }
            }

            dtpCache.Max(key, ItemCollection);

            return(ItemCollection);
        }
Example #4
0
        public static DBgl_FriendRequestCollection GetItemPagging(int page, int rec, string strSearch, out int TotalRecords)
        {
            TotalRecords = 0;
            DBgl_FriendRequestCollection ItemCollection = new DBgl_FriendRequestCollection();
            Database  db        = SqlHelper.CreateConnection(SqlHelper.MyConnection);
            DbCommand dbCommand = db.GetStoredProcCommand("gl_FriendRequest_Paging");

            db.AddInParameter(dbCommand, "Page", DbType.Int32, page);
            db.AddInParameter(dbCommand, "RecsPerPage", DbType.Int32, rec);
            db.AddInParameter(dbCommand, "SearchValue", DbType.String, strSearch);
            db.AddOutParameter(dbCommand, "TotalRecords", DbType.Int32, 0);
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBgl_FriendRequest item = GetItemFromReader(dataReader);
                    ItemCollection.Add(item);
                }
            }
            TotalRecords = Convert.ToInt32(db.GetParameterValue(dbCommand, "@TotalRecords"));
            return(ItemCollection);
        }