Exemplo n.º 1
0
        public MessagesEntity GetMessagesObject(int messageID, UsersTypes viewerType, Guid OwnerID)
        {
            MessagesEntity msg = null;

            using (SqlConnection myConnection = GetSqlConnection())
            {
                SqlCommand myCommand = new SqlCommand("Messages_GetOneByID", myConnection);
                myCommand.CommandType = CommandType.StoredProcedure;
                // Set the parameters
                myCommand.Parameters.Add("@ViewerType ", SqlDbType.Int, 4).Value = (int)viewerType;
                myCommand.Parameters.Add("@MessageID", SqlDbType.Int, 4).Value   = messageID;
                //---------------------------------------------------------------------
                myCommand.Parameters.Add("@OwnerID", SqlDbType.UniqueIdentifier).Value = OwnerID;
                //---------------------------------------------------------------------
                // Execute the command
                myConnection.Open();
                using (SqlDataReader dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    if (dr.Read())
                    {
                        //msg = PopulateEntity(dr);
                        msg = (MessagesEntity)GetEntity(dr, typeof(MessagesEntity));
                    }
                    dr.Close();
                }
                myConnection.Close();
                return(msg);
            }
        }
Exemplo n.º 2
0
        //------------------------------------------
        #endregion


        #region --------------GetMessagesObject--------------
        public static MessagesEntity GetMessagesObject(int messageID, UsersTypes viewerType, Guid OwnerID)
        {
            MessagesEntity msg = MessagesSqlDataPrvider.Instance.GetMessagesObject(messageID, viewerType, OwnerID);

            //return the object
            return(msg);
        }
Exemplo n.º 3
0
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 public static bool IsSubSubSiteOwner(UsersTypes userType)
 {
     if (userType == UsersTypes.SiteOwner)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
        private void DoFilterUsersByType(String typeName)
        {
            UsersTypes newFilter;

            if (Enum.TryParse(typeName, out newFilter))
            {
                _currentFilter = newFilter;
                FilterUsersByType(newFilter);
            }
            else
            {
                FilterUsersByType(null);
            }
        }