Ejemplo n.º 1
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);
             }
         }
     }
 }
Ejemplo n.º 2
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);
        }