InsertEmailContext() public method

public InsertEmailContext ( sp_Email_DM &_cEmail ) : void
_cEmail VolTeer.DomainModels.VT.Vol.sp_Email_DM
return void
Esempio n. 1
0
        public static void InsertVolEmailData(TestContext testContext)
        {
            System.Diagnostics.Debug.WriteLine(String.Format("{0}", DateTime.Now));
            cExcel.RemoveAllData();
            cExcel.InsertData(ExcelFilenames);

            sp_Volunteer_BLL volBLL = new sp_Volunteer_BLL();
            generalTestVol = new sp_Volunteer_DM();
            generalTestVol.VolFirstName = "TestFirst";
            generalTestVol.VolMiddleName = "TestMiddle";
            generalTestVol.VolLastName = "TestLast";
            generalTestVol.ActiveFlg = true;
            Guid volID = Guid.NewGuid();
            generalTestVol.VolID = volID;
            volBLL.InsertVolunteerContext(ref generalTestVol);

            sp_VolEmail_BLL volEmail_bll = new sp_VolEmail_BLL();
            primaryTestVolEmail = new sp_Email_DM();
            primaryTestVolEmail.EmailAddr = "*****@*****.**";
            primaryTestVolEmail.VolID = volID;
            primaryTestVolEmail.ActiveFlg = true;
            primaryTestVolEmail.PrimaryFlg = true;
            volEmail_bll.InsertEmailContext(ref primaryTestVolEmail);

            secondaryTestVolEmail = new sp_Email_DM();
            secondaryTestVolEmail.EmailAddr = "*****@*****.**";
            secondaryTestVolEmail.VolID = volID;
            secondaryTestVolEmail.ActiveFlg = true;
            secondaryTestVolEmail.PrimaryFlg = false;
            volEmail_bll.InsertEmailContext(ref secondaryTestVolEmail);
        }
Esempio n. 2
0
        protected void RegisterUser_CreatedUser(object sender, EventArgs e)
        {
            //Log the user in
            FormsAuthentication.SetAuthCookie(RegisterUser.UserName, createPersistentCookie: false);

            // Create Volunteer Record
            RadTextBox userNameTextBox = (RadTextBox)CreateUserWizardStep1.ContentTemplateContainer.FindControl("UserName");
            MembershipUser user = Membership.GetUser(userNameTextBox.Text);
            sp_Volunteer_BLL BLL = new sp_Volunteer_BLL();
            sp_VolEmail_BLL VolEmailBLL = new sp_VolEmail_BLL();

            sp_Volunteer_DM vol = new sp_Volunteer_DM();
            sp_Email_DM volEmail = new sp_Email_DM();

            vol.VolID = (Guid)user.ProviderUserKey;
            vol.VolFirstName = (CreateUserWizardStep1.ContentTemplateContainer.FindControl("rTXTFirstName") as RadTextBox).Text.Trim();
            vol.VolMiddleName = (CreateUserWizardStep1.ContentTemplateContainer.FindControl("rTXTMiddleName") as RadTextBox).Text.Trim();
            vol.VolLastName = (CreateUserWizardStep1.ContentTemplateContainer.FindControl("rTXTLastName") as RadTextBox).Text.Trim();
            vol.ActiveFlg = true;

            vol = BLL.InsertVolunteerContext(ref vol);

            volEmail.VolID = (Guid)user.ProviderUserKey;
            volEmail.EmailAddr = (CreateUserWizardStep1.ContentTemplateContainer.FindControl("Email") as RadTextBox).Text.Trim();
            volEmail.ActiveFlg = true;
            volEmail.PrimaryFlg = true;

            VolEmailBLL.InsertEmailContext(ref volEmail);

            cMail.SendMessage("*****@*****.**", (CreateUserWizardStep1.ContentTemplateContainer.FindControl("Email") as RadTextBox).Text.Trim(), "VolTeer Registration", "Please click link to confirm");

            string continueUrl = ConfigurationManager.AppSettings["HomePage"].ToString();
            Response.Redirect(continueUrl);
        }
Esempio n. 3
0
        public sp_Email_DM hCreateVolEmail(string EmailAddr,Guid VolID,bool primaryEmail,ref int numberEmails)
        {
            sp_Email_DM Email = new sp_Email_DM();
            sp_VolEmail_BLL VolEmailBll = new sp_VolEmail_BLL();

            numberEmails = numberEmails + 1;
            Email.EmailID = numberEmails;
            Email.EmailAddr = EmailAddr;
            Email.VolID = VolID;
            Email.PrimaryFlg = primaryEmail;
            Email.ActiveFlg = true;

            VolEmailBll.InsertEmailContext(ref Email);

            return Email;
        }
Esempio n. 4
0
        public void TestVolEmailCreate()
        {
            sp_Volunteer_BLL vol_bll = new sp_Volunteer_BLL();
            sp_Volunteer_DM vol_dm = new sp_Volunteer_DM();
            vol_dm.VolFirstName = "createFirst";
            vol_dm.VolMiddleName = "createMiddle";
            vol_dm.VolLastName = "createLast";
            vol_dm.ActiveFlg = true;
            System.Guid volID = vol_bll.InsertVolunteerContext(ref vol_dm).VolID;
            vol_dm.VolID = volID;

            string volEmailAddr = "*****@*****.**";
            bool PrimaryFlg = true;
            bool ActiveFlg = true;
            sp_VolEmail_BLL volEmail_bll = new sp_VolEmail_BLL();
            sp_Email_DM volEmail_dm = new sp_Email_DM();
            volEmail_dm.EmailAddr = volEmailAddr;
            volEmail_dm.VolID = volID;
            volEmail_dm.ActiveFlg = ActiveFlg;
            volEmail_dm.PrimaryFlg = PrimaryFlg;
            volEmail_bll.InsertEmailContext(ref volEmail_dm);
            int volEmailID = volEmail_dm.EmailID;

            List<sp_Email_DM> volEmailDMs_selected = volEmail_bll.ListEmails(volEmail_dm);
            Assert.IsTrue(EmailListContains(volEmailDMs_selected,volEmail_dm));
        }
Esempio n. 5
0
        public void TestVolEmailUpdate()
        {
            sp_VolEmail_BLL volEmailBLL = new sp_VolEmail_BLL();
            volEmailBLL.InsertEmailContext(ref primaryTestVolEmail);
            sp_Email_DM updateEmail = volEmailBLL.ListPrimaryEmail(primaryTestVolEmail);
            String newEmailAddr = "*****@*****.**";
            updateEmail.EmailAddr = newEmailAddr;
            volEmailBLL.UpdateEmailAddr(updateEmail);
            sp_Email_DM selectedEmail = volEmailBLL.ListPrimaryEmail(updateEmail);

            //To get all emails listed, create a new domain model with no emailID specified.
            sp_Email_DM selectAllEmails = new sp_Email_DM();
            selectAllEmails.VolID = updateEmail.VolID;
            List<sp_Email_DM> selectedEmailList = volEmailBLL.ListEmails(selectAllEmails);

            Assert.IsTrue(EmailListContains(selectedEmailList, updateEmail));
            Assert.IsTrue(EmailListContains(selectedEmailList, selectedEmail));
            Assert.IsTrue(EmailEquals(selectedEmail,updateEmail));
            Assert.AreEqual(newEmailAddr, selectedEmail.EmailAddr);
        }