예제 #1
0
        //----------------------------------------------------------
        #endregion



        #region ----------------InsertTestingDataForEmailList---------------
        //----------------------------------------------------------
        //InsertTestingDataForEmailList
        //----------------------------------------------------------
        public void InsertTestingDataForEmailList()
        {
            //----------------------------------------------------------------------
            MailListUsersEntity ArMailListUsers = new MailListUsersEntity();
            string arEmail = "armail{0}@site.com";

            ArMailListUsers.IsActive     = true;
            ArMailListUsers.ModuleTypeID = (int)StandardItemsModuleTypes.MailList;
            ArMailListUsers.LangID       = Languages.Ar;
            //----------------------------------------------------------------------
            MailListUsersEntity EnMailListUsers = new MailListUsersEntity();
            string enEmail = "enmail{0}@site.com";

            EnMailListUsers.IsActive     = true;
            EnMailListUsers.ModuleTypeID = (int)StandardItemsModuleTypes.MailList;
            EnMailListUsers.LangID       = Languages.Ar;
            //----------------------------------------------------------------------
            for (int i = 1; i <= 5; i++)
            {
                if (SiteSettings.Languages_HasArabicLanguages)
                {
                    ArMailListUsers.Email = string.Format(arEmail, i.ToString());
                    MailListUsersFactory.Create(ArMailListUsers);
                }
                if (SiteSettings.Languages_HasEnglishLanguages)
                {
                    EnMailListUsers.Email = string.Format(enEmail, i.ToString());
                    MailListUsersFactory.Create(EnMailListUsers);
                }
            }
        }
예제 #2
0
        //------------------------------------------
        #endregion

        #region ---------------------------RegisterInMailList---------------------------
        //---------------------------------------------------------------------------
        public static void RegisterInMailList(UsersDataEntity usersDataObject)
        {
            UsersDataGlobalOptions userDataModule = UsersDataGlobalOptions.GetType(usersDataObject.ModuleTypeID);
            Languages langID = (Languages)SiteSettings.Languages_DefaultLanguageID;

            MailListUsersFactory.RegisterInMailList(userDataModule.ModuleTypeID, usersDataObject.Email, langID, userDataModule.MailListAutomaticActivation, userDataModule.MailListSendingMailActivation);
        }
예제 #3
0
        //------------------------------------------
        #endregion


        #region ---------------------------RegisterInMailList---------------------------
        //---------------------------------------------------------------------------
        public static void RegisterInMailList(MessagesEntity msg)
        {
            MessagesModuleOptions msgModule = MessagesModuleOptions.GetType(msg.ModuleTypeID);
            Languages             langID    = (Languages)SiteSettings.Languages_DefaultLanguageID;

            MailListUsersFactory.RegisterInMailList(msg.ModuleTypeID, msg.EMail, langID, msgModule.MailListAutomaticActivation, msgModule.MailListSendingMailActivation);
        }
예제 #4
0
        //------------------------------------------
        #endregion
        //-----------------------------------------------------------------------
        public static ExecuteCommandStatus RegisterInMailList(int moduleID, string email, Languages langID, bool isActive, bool requiredActivationCode)
        {
            MailListUsersEntity user = new MailListUsersEntity();

            user.ModuleTypeID = moduleID;
            user.Email        = email;
            user.LangID       = langID;
            user.IsActive     = isActive;
            ExecuteCommandStatus status = MailListUsersFactory.Create(user);

            if (status == ExecuteCommandStatus.Done && requiredActivationCode && !isActive)
            {
                SendActivationCodeMessage(user);
            }
            return(status);
        }
예제 #5
0
        //---------------------------------------------------------------------------
        public static void UpdateMailListEmail(string oldEmail, UsersDataEntity usersDataObject)
        {
            MailListUsersEntity mlUser = MailListUsersFactory.GetObject(usersDataObject.ModuleTypeID, oldEmail);

            if (mlUser != null)
            {
                if (!string.IsNullOrEmpty(usersDataObject.Email))
                {
                    mlUser.Email = usersDataObject.Email;
                    MailListUsersFactory.Update(mlUser);
                }
                else
                {
                    MailListUsersFactory.Delete(mlUser.UserID);
                }
            }
            else
            {
                UsersDataFactory.RegisterInMailList(usersDataObject);
            }
        }
예제 #6
0
        //---------------------------------------------------------------------------
        public static void UpdateMailListEmail(string oldEmail, MessagesEntity msg)
        {
            MailListUsersEntity mlUser = MailListUsersFactory.GetObject(msg.ModuleTypeID, oldEmail);

            if (mlUser != null)
            {
                if (!string.IsNullOrEmpty(msg.EMail))
                {
                    mlUser.Email = msg.EMail;
                    MailListUsersFactory.Update(mlUser);
                }
                else
                {
                    MailListUsersFactory.Delete(mlUser.UserID);
                }
            }
            else
            {
                MessagesFactory.RegisterInMailList(msg);
            }
        }
예제 #7
0
 //---------------------------------------------------------------------------
 public static void UnRegisterInMailList(UsersDataEntity usersDataObject)
 {
     MailListUsersFactory.Delete(usersDataObject.ModuleTypeID, usersDataObject.Email);
 }
예제 #8
0
 //---------------------------------------------------------------------------
 public static void UnRegisterInMailList(MessagesEntity msg)
 {
     MailListUsersFactory.Delete(msg.ModuleTypeID, msg.EMail);
 }