Exemplo n.º 1
0
    public static void SaveAltEmail(string id, string description, int?groupID, int?ticketTypeID, int?productID, string sendingEmailAddress)
    {
        if (!UserSession.CurrentUser.IsSystemAdmin)
        {
            return;
        }
        EMailAlternateInboundItem item = id != null?EMailAlternateInbound.GetItem(UserSession.LoginUser, new Guid(id)) : (new EMailAlternateInbound(UserSession.LoginUser)).AddNewEMailAlternateInboundItem();

        item.OrganizationID      = UserSession.LoginUser.OrganizationID;
        item.Description         = description;
        item.GroupToAssign       = groupID < 0 ? null : groupID;
        item.DefaultTicketType   = ticketTypeID < 0 ? null : ticketTypeID;
        item.ProductID           = productID < 0 ? null : productID;
        item.SendingEMailAddress = sendingEmailAddress;
        item.Collection.Save();
    }
Exemplo n.º 2
0
    public static AltEmail GetAltEmail(Guid id)
    {
        EMailAlternateInboundItem item = EMailAlternateInbound.GetItem(UserSession.LoginUser, id);
        AltEmail result = new AltEmail();

        result.Email               = item.SystemEMailID.ToString();
        result.Description         = item.Description ?? "";
        result.GroupID             = item.GroupToAssign == null ? -1 : item.GroupToAssign;
        result.TicketTypeID        = item.DefaultTicketType == null ? -1 : item.DefaultTicketType;
        result.ProductID           = item.ProductID == null ? -1 : item.ProductID;
        result.Product             = item.Row["ProductName"].ToString();
        result.Group               = item.Row["GroupName"].ToString();
        result.TicketType          = item.Row["TicketTypeName"].ToString();
        result.SendingEmailAddress = item.Row["SendingEMailAddress"].ToString();
        return(result);
    }