示例#1
0
    /// <summary>
    /// Fills tooltip with appropriate data.
    /// </summary>
    private void AccountContactTooltip(Image image, ArrayList roleIDs)
    {
        StringBuilder sb = new StringBuilder();

        sb.AppendFormat("<em>{0}</em><br />", GetString("om.contactrole.roles"));
        string[] array = new string[roleIDs.Count];
        for (int i = 0; i < roleIDs.Count; i++)
        {
            array[i] = ValidationHelper.GetString(roleIDs[i], "0");
        }

        // Get contact role display names
        DataSet ds = ContactRoleInfoProvider.GetContactRoles(SqlHelperClass.GetWhereCondition <int>("ContactRoleID", array, false), "ContactRoleDisplayName", -1, "ContactRoleDisplayName");

        if (!DataHelper.DataSourceIsEmpty(ds))
        {
            // Loop through all distinct values of given column
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                sb.AppendFormat("<br />&nbsp;-&nbsp;{0}", HTMLHelper.HTMLEncode(ValidationHelper.GetString(row["ContactRoleDisplayName"], string.Empty)));
            }
        }

        image.ToolTip += sb.ToString();
    }
示例#2
0
 /// <summary>
 /// UniGrid action handler.
 /// </summary>
 void Grid_OnAction(string actionName, object actionArgument)
 {
     if (actionName == "delete")
     {
         ContactRoleInfo cri = ContactRoleInfoProvider.GetContactRoleInfo(ValidationHelper.GetInteger(actionArgument, 0));
         if (cri != null)
         {
             if (ConfigurationHelper.AuthorizedModifyConfiguration(cri.ContactRoleSiteID, true))
             {
                 ContactRoleInfoProvider.DeleteContactRoleInfo(cri);
             }
         }
     }
 }
示例#3
0
        private ContactRoleInfo CreateContactRole(string contactRoleCodeName)
        {
            var contactRoleInfo = ContactRoleInfoProvider.GetContactRoleInfo(contactRoleCodeName);

            if (contactRoleInfo != null)
            {
                ContactRoleInfoProvider.DeleteContactRoleInfo(contactRoleInfo);
            }

            var roleObj = new ContactRoleInfo();

            roleObj.ContactRoleDescription = contactRoleCodeName;
            roleObj.ContactRoleDisplayName = contactRoleCodeName;
            roleObj.ContactRoleName        = contactRoleCodeName;
            ContactRoleInfoProvider.SetContactRoleInfo(roleObj);
            return(roleObj);
        }
    /// <summary>
    /// Fills tooltip with appropriate data.
    /// </summary>
    private string AccountContactTooltip(IList <int> roleIDs)
    {
        StringBuilder sb = new StringBuilder();

        sb.AppendFormat("<div><em>{0}</em></div>", GetString("om.contactrole.roles"));

        // Get contact role display names
        var contactRoles = ContactRoleInfoProvider.GetContactRoles()
                           .WhereIn("ContactRoleID", roleIDs)
                           .OrderBy("ContactRoleDisplayName")
                           .Column("ContactRoleDisplayName");


        // Loop through all distinct values of given column
        foreach (var contactRole in contactRoles)
        {
            sb.AppendFormat("<div>&nbsp;-&nbsp;{0}</div>", HTMLHelper.HTMLEncode(contactRole.ContactRoleDisplayName));
        }

        return(sb.ToString());
    }