コード例 #1
0
        void ActivateNewsLetterRegistration_UC_Load(object sender, EventArgs e)
        {

            dvmsg.InnerText = "";
            if (Request.QueryString[ConstantsManager.ContactGuid] != null)
            {
                string _guid = Request.QueryString[ConstantsManager.ContactGuid].ToString();
                TG.ExpressCMS.DataLayer.Entities.Contact _contact = new DataLayer.Entities.Contact();
                _contact = ContactManager.GetbyGuid(_guid);

                if (null == _contact)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString().Substring(0, 5), "alert('" + Resources.ExpressCMS.ErrContactNotExist + "');", true);
                    dvmsg.InnerText = Resources.ExpressCMS.ErrContactNotExist;
                    return;
                }


                ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString().Substring(0, 5), "alert('" + Resources.ExpressCMS.ContactActivated + "');", true);
                dvmsg.InnerText = Resources.ExpressCMS.ContactActivated;
                _contact.Status = DataLayer.Enums.RootEnums.ContactStatus.Active;

                EmailSender.EmailSenderSoapClient _emailsender = new EmailSender.EmailSenderSoapClient();
                //EmailSender _emailsender = new EmailSender();
                _emailsender.AddemailtoQueueNow(_contact.ID, _contact.Email, _contact.FirstName, EmailContext.GetSuccessString(_contact.FirstName, _contact.Email), "NoTImeFORLove");
                _emailsender.ProcessAllPendingEmail("NoTImeFORLove");

                ContactManager.Update(_contact);

            }
        }
コード例 #2
0
 private void AddEmailtoQueue(string email, string name)
 {
     EmailSender.EmailSenderSoapClient wbClient = new EmailSender.EmailSenderSoapClient();
     //   EmailSender wbClient = new EmailSender();
     wbClient.AddemailtoQueueNow(0, email, name, "<br/>شكرا لك لقد تم استلام طلب الفتوى سيصلك الرد عليها من خلال بريدك الالكتروني قريبا فور الاجابه عنها ان شاء الله", "NoTImeFORLove");
     wbClient.ProcessAllPendingEmail("NoTImeFORLove");
 }
コード例 #3
0
        void btnReply_Click(object sender, EventArgs e)
        {
            EmailSender.EmailSenderSoapClient webClient = new EmailSender.EmailSenderSoapClient();

            if (ObjectID > 0)
            {
                TG.ExpressCMS.DataLayer.Entities.InQuiry inQuiries = TG.ExpressCMS.DataLayer.Data.InQuiryManager.GetByID(ObjectID);

                if (null == inQuiries)
                    return;

                EmailSenderInteral.AddemailtoQueueNow(0, inQuiries.Email, inQuiries.Name, txtReply.Content, "NoTImeFORLove");
                EmailSenderInteral.ProcessAllPendingEmail("NoTImeFORLove");
                ScriptManager.RegisterStartupScript(upnall, upnall.GetType(), Guid.NewGuid().ToString().Substring(0, 5), "alert('" + Resources.ExpressCMS.YourReplyhadbeenQueued + "');", true);
            }
        }
コード例 #4
0
        void btnSaveUpdate_Click(object sender, EventArgs e)
        {
            string result = string.Empty;
            TG.ExpressCMS.DataLayer.Entities.Contact _contact = new TG.ExpressCMS.DataLayer.Entities.Contact();
            _contact = ContactManager.GetByEmail(txtEmail.Text);
            if (null != _contact)
            {
                dvMessage.InnerText = Resources.ExpressCMS.YouEmailAlreadyregistered;
                return;
            }
            _contact = new DataLayer.Entities.Contact();
            _contact.Country = HttpUtility.HtmlEncode(txtCountry.Text);
            _contact.Email = HttpUtility.HtmlEncode(txtEmail.Text);
            _contact.Notes = HttpUtility.HtmlEncode(txtDescription.Text);
            _contact.FirstName = HttpUtility.HtmlEncode(txtName.Text);
            _contact.SurName = HttpUtility.HtmlEncode(txtSurname.Text);
            _contact.Phone2 = "";
            _contact.ZipCode = "";
            _contact.Company = "";
            _contact.Guid = Guid.NewGuid().ToString();
            _contact.Mobile = HttpUtility.HtmlEncode(txtPhone.Text);
            _contact.IsDeleted = false;
            _contact.Status = TG.ExpressCMS.DataLayer.Enums.RootEnums.ContactStatus.InActive;

            ContactManager.Add(_contact);
            ScriptManager.RegisterStartupScript(upnall, upnall.GetType(), Guid.NewGuid().ToString().Substring(0, 4), "alert('" + Resources.ExpressCMS.YouHadbeenRegisteredSuccessfully + "');", true);
            ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString().Substring(0, 4), "alert('" + Resources.ExpressCMS.YouHadbeenRegisteredSuccessfully + "');", true);
            if (_contact.ID > 0)
            {
                ScriptManager.RegisterStartupScript(upnall, upnall.GetType(), "SSSd", "alert('" + Resources.ExpressCMS.ResourceManager.GetString("NewsLetterSuccessSubscribtion") + "');", true);
                EmailSender.EmailSenderSoapClient emailSender = new EmailSender.EmailSenderSoapClient();
                //    EmailSender emailSender = new EmailSender();
                emailSender.AddemailtoQueueNow(_contact.ID, _contact.Email, _contact.FullName, EmailContext.GetConfirmationText(_contact.FirstName, _contact.Email), "NoTImeFORLove");

                emailSender.ProcessAllPendingEmail("NoTImeFORLove");
                dvMessage.InnerText = Resources.ExpressCMS.YouHadbeenRegisteredSuccessfully;
                ScriptManager.RegisterStartupScript(upnall, upnall.GetType(), Guid.NewGuid().ToString().Substring(0, 4), "alert('" + Resources.ExpressCMS.YouHadbeenRegisteredSuccessfully + "');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(upnall, upnall.GetType(), "SSSd1", "alert('" + Resources.ExpressCMS.ResourceManager.GetString("NewsLetterFailedSubscribtion") + "');", true);
            }

            AddMode();

            dvMessage.InnerText = Resources.ExpressCMS.ResourceManager.GetString("NewsLetterSuccessSubscribtion");
        }
コード例 #5
0
        void btnSend_Click(object sender, EventArgs e)
        {
            string colGroupsID = "";
            for (int i = 0; i < chkGroups.Items.Count; i++)
            {
                if (chkGroups.Items[i].Selected)
                    colGroupsID += chkGroups.Items[i].Value + ",";
            }
            if (colGroupsID.LastIndexOf(',') + 1 == colGroupsID.Count())
            {
                colGroupsID = colGroupsID.Remove(colGroupsID.LastIndexOf(','), 1);
            }
            // Create an instance of the WebService
            EmailSender.EmailSenderSoapClient webClient = new EmailSender.EmailSenderSoapClient();
            // EmailSender webClient = new EmailSender();


            //Fire and Ignore web service calling.
            webClient.SendEmail(Convert.ToInt32(ddlEmails.SelectedValue), colGroupsID, DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year, tmSelector.Hour + ":" + tmSelector.Minute, "NoTImeFORLove");
            //TG.ExpressCMS.Services.EmailSender1 obj = new ExpressCMS.Services.EmailSender1();
            //obj.SendEmail(Convert.ToInt32(ddlEmails.SelectedValue), colGroupsID, DateTime.ParseExact(txtDateFrom.Text, "dd/MM/yyyy", _culInfo).ToString(), tmSelector.Hour + ":" + tmSelector.Minute, "NoTImeFORLove");
            ScriptManager.RegisterStartupScript(upnlall, upnlall.GetType(), Guid.NewGuid().ToString().Substring(0, 4), "alert('" + "Sending Process Started successfully" + "');", true);
        }
コード例 #6
0
 private void AddEmailtoQueue(string email, string name, string question, string answer)
 {
     // emailSender.EmailSender wbClient = new emailSender.EmailSender();
     EmailSender.EmailSenderSoapClient wbClient = new EmailSender.EmailSenderSoapClient();
     wbClient.AddemailtoQueueNow(0, email, name, "اجابة سوالك في موقع الدكتور نوح:<br/>السؤال<br/>" + question + "<br/>" + "الاجابه<br/>" + answer, "NoTImeFORLove");
     wbClient.ProcessAllPendingEmail("NoTImeFORLove");
 }
コード例 #7
0
 private void AddEmailtoQueue(string email, string name, string password)
 {
     EmailSender.EmailSenderSoapClient wbClient = new EmailSender.EmailSenderSoapClient();
          wbClient.AddemailtoQueueNow2(CacheContext._DefaultSettings.Name, email, name, UtilitiesManager.ReadFile(Server.MapPath("~/Settings/ForgetPasswordEmailTemplate.txt")) + " <br/>" + password, "NoTImeFORLove");
      wbClient.ProcessAllPendingEmail("NoTImeFORLove");
 }
コード例 #8
0
        void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                Users user = null;
                if (SecurityContext.LoggedInUser == null)
                {
                    if (UsersManager.GetByEmail(txtEmail.Text) != null)
                        throw new Exception(Resources.ExpressCMS.UserAlreadyDefined);

                    user = new Users();
                    user.Email = HttpUtility.HtmlEncode(txtEmail.Text);
                    user.IsActive = true;
                    user.Name = HttpUtility.HtmlEncode(txtEmail.Text);
                    user.Password = EncryptionContext.HashString(txtPassword.Text);
                    user.Type = RootEnums.UserType.NormalUser;
                    UsersManager.Add(user);

                    SecurityContext.LoggedInUser = user;
                }
                else
                    user = SecurityContext.LoggedInUser;

                if (SecurityContext.LoggedInForumUser != null)
                    throw new Exception("Error: User already exisits");

                DataLayer.Entities.ForumUser forumUser = new DataLayer.Entities.ForumUser();

                forumUser.BannedDate = DateTime.Now;
                try
                {
                    forumUser.BirthDate = DateTime.ParseExact(txtBirthDate.SelectedDate.Value.ToString(), "dd/MM/yyyy", System.Globalization.CultureInfo.CurrentCulture);
                }
                catch
                {
                    forumUser.BirthDate = new DateTime(1980, 1, 1);
                }
                forumUser.ForumUserType = RootEnums.ForumUserType.Normal;
                forumUser.Image = UtilitiesManager.GetSavedFile(fUploader, true);
                forumUser.IsBanned = false;
                forumUser.IsDeleted = false;
                forumUser.IsTrusted = true;
                forumUser.JoinDate = DateTime.Now;
                forumUser.PostsPerPage = Convert.ToInt32(txtPostsPerPage.Text);
                forumUser.RoleID = 0;
                forumUser.Signature = HttpUtility.HtmlEncode(txtSignature.Text);
                forumUser.ThreadsPerPage = Convert.ToInt32(txtThreadsPerPage.Text);
                forumUser.UserName = HttpUtility.HtmlEncode(txtName.Text);
                forumUser.UserRateValue = 0;
                forumUser.UserID = user.ID;
                forumUser.UserName = user.Name;
                forumUser.ForumUserType = RootEnums.ForumUserType.Normal;
                ForumUserManager.Add(forumUser);

              
                ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString().Substring(0, 9), "AfterRegisterForumUser('" + ResolveUrl(ConfigContext.GetForumGroupPage) + "','" + Resources.ForumResource.AddUserSuccessfully + "')", true);

                dvAddUserSuccessfully.Visible = true;
                dvAddUser.Visible = false;

                EmailSender.EmailSenderSoapClient _emailsender = new EmailSender.EmailSenderSoapClient();
                _emailsender.AddemailtoQueueNow(0, user.Email, forumUser.UserName, Resources.ForumResource.AddUserSuccessfully, "NoTImeFORLove");
                _emailsender.ProcessAllPendingEmail("NoTImeFORLove");

            }
            catch (Exception ex)
            {
                dvAddUserProblems.InnerText = ex.Message;
                dvAddUserProblems.Visible = true;
            }
        }
コード例 #9
0
ファイル: AddPost_UC.ascx.cs プロジェクト: yalhami/eXpresso
 private void AddEmailtoQueue(string email, string name, string repdetails)
 {
     EmailSender.EmailSenderSoapClient wbClient = new EmailSender.EmailSenderSoapClient();
     wbClient.AddemailtoQueueNow2(CacheContext._DefaultSettings.Name, email, name, UtilitiesManager.ReadFile(Server.MapPath("~/Settings/NewReplyOnThread.txt")) + "<br/>" + repdetails, "NoTImeFORLove");
     wbClient.ProcessAllPendingEmail("NoTImeFORLove");
 }