Inheritance: sp_VolEmail_CON
Example #1
0
 public sp_Email_DM hSelectPrimaryVolEmail(sp_Email_DM givenEmail)
 {
     sp_Email_DM Email = new sp_Email_DM();
     sp_VolEmail_BLL VolEmailBll = new sp_VolEmail_BLL();
     Email = VolEmailBll.ListPrimaryEmail(givenEmail);
     return Email;
 }
Example #2
0
 public List<sp_Email_DM> hSelectVolEmail(sp_Email_DM givenEmail)
 {
     List<sp_Email_DM> EmailList = null;
     sp_VolEmail_BLL VolEmailBll = new sp_VolEmail_BLL();
     EmailList = VolEmailBll.ListEmails(givenEmail);
     return EmailList;
 }
Example #3
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);
        }
Example #4
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);
        }
Example #5
0
        /* public sp_Email_DM hSelectVolAddress(int emailID)
        {
            sp_Email_DM Email = new sp_Email_DM();
            sp_VolEmail_BLL VolEmailBll = new sp_VolEmail_BLL();
            Email = VolEmailBll.ListEmails(emailID);
            return Email;
        }*/
        public void hUpdateVolEmail(sp_Email_DM Email, string emailAddress)
        {
            sp_VolEmail_BLL VolEmailBll = new sp_VolEmail_BLL();

            Email.EmailAddr = emailAddress;

            VolEmailBll.UpdateEmailAddr(Email);
        }
Example #6
0
        public void hUpdateVolEmail(sp_Email_DM Email, string emailAddress, bool primaryFlg)
        {
            sp_VolEmail_BLL VolEmailBll = new sp_VolEmail_BLL();

            Email.EmailAddr = emailAddress;
            Email.PrimaryFlg = primaryFlg;

            VolEmailBll.UpdateEmailAddr(Email);
        }
Example #7
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;
        }
Example #8
0
        public static void RemoveVolEmailData()
        {
            sp_VolEmail_BLL volEmailBLL = new sp_VolEmail_BLL();
            volEmailBLL.DeleteEmailsContext(secondaryTestVolEmail);
            volEmailBLL.DeleteEmailsContext(primaryTestVolEmail);
            //Make sure we don't pass it null because we didn't run one of the tests
            if (createTestVolEmail != null)
                volEmailBLL.DeleteEmailsContext(createTestVolEmail);

            sp_Volunteer_BLL volBLL = new sp_Volunteer_BLL();
            volBLL.DeleteVolunteerContext(generalTestVol);
            //Make sure we don't pass it null because we didn't run one of the tests
            if (createTestVolEmail != null)
                volBLL.DeleteVolunteerContext(createTestVol);

            cExcel.RemoveData(ExcelFilenames);
        }
Example #9
0
        public void hDeleteVolEmail(sp_Email_DM Email)
        {
            sp_VolEmail_BLL VolEmailBll = new sp_VolEmail_BLL();

            VolEmailBll.DeleteEmailsContext(Email);
        }
Example #10
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));
        }
Example #11
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);
        }
Example #12
0
        public void TestVolEmailRead()
        {
            string helperDir = cExcel.GetHelperFilesDir();
            DataTable dt = cExcel.ReadExcelFile("Sheet1", Path.Combine(helperDir, "VolEmail.xlsx"));
            List<sp_Email_DM> excelDMs = getVolEmailDMs(dt);
            sp_VolEmail_BLL volEmail_bll = new sp_VolEmail_BLL();

            foreach (sp_Email_DM testVolEmail in excelDMs)
            {
                List<sp_Email_DM> selectedVolEmails = volEmail_bll.ListEmails(testVolEmail);
                Assert.IsTrue(EmailListContains(selectedVolEmails,testVolEmail));
            }
        }
Example #13
0
        public void TestVolEmailPrimaryRead()
        {
            sp_VolEmail_BLL volEmailBLL = new sp_VolEmail_BLL();
            sp_Email_DM volEmailDM_selected = volEmailBLL.ListPrimaryEmail(primaryTestVolEmail);
            Assert.IsTrue(EmailEquals(primaryTestVolEmail,volEmailDM_selected));

            volEmailDM_selected = volEmailBLL.ListPrimaryEmail(secondaryTestVolEmail);
            Assert.IsTrue(EmailEquals(primaryTestVolEmail, volEmailDM_selected));
        }
Example #14
0
        public void TestVolEmailDelete()
        {
            sp_VolEmail_BLL volEmail_bll = new sp_VolEmail_BLL();
            //Can't delete primary emails
            //volEmail_bll.DeleteEmailsContext(primaryTestVolEmail);
            //sp_Email_DM selectedVolEmail = volEmail_bll.ListPrimaryEmail(primaryTestVolEmail);
            volEmail_bll.DeleteEmailsContext(secondaryTestVolEmail);
            sp_Email_DM selectedVolEmail = volEmail_bll.ListEmails(secondaryTestVolEmail).First();

            Assert.IsNotNull(selectedVolEmail.ActiveFlg);
            Assert.IsFalse(selectedVolEmail.ActiveFlg == true);
            Assert.IsTrue(selectedVolEmail.ActiveFlg == false);
        }