public static void DeleteFromDB(LoginUser loginUser, Guid systemEMailID)
        {
            EMailAlternateInbound result = new EMailAlternateInbound(loginUser);

            using (SqlCommand command = new SqlCommand())
            {
                command.CommandText = "DELETE FROM EMailAlternateInbound  WHERE (SystemEmailID = @SystemEmailID)";
                command.CommandType = CommandType.Text;
                command.Parameters.AddWithValue("@SystemEmailID", systemEMailID);
                result.ExecuteNonQuery(command, "EMailAlternateInbound");
            }
        }
Ejemplo n.º 2
0
        public static EMailAlternateInboundItem GetEMailAlternateInboundItem(LoginUser loginUser, int systemEMailID)
        {
            EMailAlternateInbound eMailAlternateInbound = new EMailAlternateInbound(loginUser);

            eMailAlternateInbound.LoadBySystemEMailID(systemEMailID);
            if (eMailAlternateInbound.IsEmpty)
            {
                return(null);
            }
            else
            {
                return(eMailAlternateInbound[0]);
            }
        }
        public static EMailAlternateInboundItem GetItem(LoginUser loginUser, Guid systemID)
        {
            EMailAlternateInbound result = new EMailAlternateInbound(loginUser);

            using (SqlCommand command = new SqlCommand())
            {
                command.CommandText =
                    @"SELECT eai.*, ISNULL(p.Name, 'Unassigned') AS ProductName, ISNULL(g.Name, 'Unassigned') AS GroupName, ISNULL(tt.Name, 'Unassigned') AS TicketTypeName
FROM EMailAlternateInbound eai
LEFT JOIN Products p ON p.ProductID = eai.ProductID
LEFT JOIN Groups g ON g.GroupID = eai.GroupToAssign
LEFT JOIN TicketTypes tt ON tt.TicketTypeID = eai.DefaultTicketType 
WHERE (eai.SystemEmailID = @SystemEmailID)";
                command.CommandType = CommandType.Text;
                command.Parameters.AddWithValue("@SystemEmailID", systemID);
                result.Fill(command);
            }

            return(result.IsEmpty ? null : result[0]);
        }
Ejemplo n.º 4
0
 public EMailAlternateInboundItem(DataRow row, EMailAlternateInbound eMailAlternateInbound) : base(row, eMailAlternateInbound)
 {
     _eMailAlternateInbound = eMailAlternateInbound;
 }