public InsertVolunteerContext ( |
||
_cVolunteer | ||
Результат |
public static void InsertVolPhoneData(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; System.Guid volID = Guid.NewGuid(); generalTestVol.VolID = volID; volBLL.InsertVolunteerContext(ref generalTestVol); sp_VolPhone_BLL volPhone_bll = new sp_VolPhone_BLL(); primaryTestVolPhone = new sp_Phone_DM(); primaryTestVolPhone.PhoneNbr = "1357924680"; primaryTestVolPhone.VolID = volID; primaryTestVolPhone.ActiveFlg = true; primaryTestVolPhone.PrimaryFlg = true; volPhone_bll.InsertPhoneContext(primaryTestVolPhone); secondaryTestVolPhone = new sp_Phone_DM(); secondaryTestVolPhone.PhoneNbr = "2468013579"; secondaryTestVolPhone.VolID = volID; secondaryTestVolPhone.ActiveFlg = true; secondaryTestVolPhone.PrimaryFlg = false; volPhone_bll.InsertPhoneContext(secondaryTestVolPhone); }
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); }
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); }
public static void InsertVolAddressData(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; generalTestVol.VolID = Guid.NewGuid(); volBLL.InsertVolunteerContext(ref generalTestVol); sp_Vol_Address_BLL volAddress_bll = new sp_Vol_Address_BLL(); primaryTestVolAddress = new sp_Vol_Address_DM(); primaryTestVolAddress.AddrLine1 = "PrimaryLine1"; primaryTestVolAddress.AddrLine2 = "PrimaryLine2"; primaryTestVolAddress.AddrLine3 = "PrimaryLine3"; primaryTestVolAddress.City = "PrimaryCity"; primaryTestVolAddress.St = "PS"; primaryTestVolAddress.Zip = 12345; primaryTestVolAddress.Zip4 = 6789; primaryTestVolAddress.VolID = generalTestVol.VolID; primaryTestVolAddress.ActiveFlg = true; primaryTestVolAddress.PrimaryAddr = true; primaryTestVolAddr = new sp_Vol_Addr_DM(); primaryTestVolAddr.VolID = generalTestVol.VolID; primaryTestVolAddr.PrimaryAddr = true; volAddress_bll.InsertAddressContext(ref primaryTestVolAddress, ref primaryTestVolAddr); secondaryTestVolAddress = new sp_Vol_Address_DM(); secondaryTestVolAddress.AddrLine1 = "SecondaryLine1"; secondaryTestVolAddress.AddrLine2 = "SecondaryLine2"; secondaryTestVolAddress.AddrLine3 = "SecondaryLine3"; secondaryTestVolAddress.City = "SecondaryCity"; secondaryTestVolAddress.St = "SS"; secondaryTestVolAddress.Zip = 98765; secondaryTestVolAddress.Zip4 = 4321; secondaryTestVolAddress.VolID = generalTestVol.VolID; secondaryTestVolAddress.ActiveFlg = true; secondaryTestVolAddress.PrimaryAddr = false; secondaryTestVolAddr = new sp_Vol_Addr_DM(); secondaryTestVolAddr.VolID = generalTestVol.VolID; secondaryTestVolAddr.PrimaryAddr = false; volAddress_bll.InsertAddressContext(ref secondaryTestVolAddress, ref secondaryTestVolAddr); }
public sp_Volunteer_DM hCreateVolunteer(string strFirstName, string strMiddleName, string strLastName) { sp_Volunteer_DM VOL = new sp_Volunteer_DM(); sp_Volunteer_BLL VOlBll = new sp_Volunteer_BLL(); VOL.VolID = Guid.NewGuid(); VOL.ActiveFlg = true; VOL.VolFirstName = strFirstName; VOL.VolMiddleName = strMiddleName; VOL.VolLastName = strLastName; VOL = VOlBll.InsertVolunteerContext(ref VOL); return VOL; }
public static void InsertVolunteerData(TestContext testContext) { volunteersToRemove = new List<sp_Volunteer_DM>(); System.Diagnostics.Debug.WriteLine(String.Format("{0}", DateTime.Now)); cExcel.RemoveAllData(); cExcel.InsertData(ExcelFilenames); secondaryTestVol = new sp_Volunteer_DM(); secondaryTestVol.ActiveFlg = true; secondaryTestVol.VolFirstName = "first2"; secondaryTestVol.VolMiddleName = "middle2"; secondaryTestVol.VolLastName = "last2"; secondaryTestVol.VolID = Guid.NewGuid(); sp_Volunteer_BLL vol_bll = new sp_Volunteer_BLL(); vol_bll.InsertVolunteerContext(ref secondaryTestVol); }
public void TestVolunteerCreate() { createTestVol = new sp_Volunteer_DM(); string volFirst = "TestFirst"; string volMiddle = "TestMiddle"; string volLast = "TestLast"; bool ActiveFlg = true; sp_Volunteer_BLL vol_bll = new sp_Volunteer_BLL(); sp_Volunteer_DM vol_dm = new sp_Volunteer_DM(); vol_dm.VolFirstName = volFirst; vol_dm.VolMiddleName = volMiddle; vol_dm.VolLastName = volLast; vol_dm.ActiveFlg = ActiveFlg; System.Guid volID = Guid.NewGuid(); vol_dm.VolID = volID; createTestVol = vol_dm; vol_bll.InsertVolunteerContext(ref vol_dm); sp_Volunteer_DM vol_dm_selected = vol_bll.ListVolunteers(volID); Assert.IsTrue(VolEquals(vol_dm, vol_dm_selected)); }
public void TestVolunteerUpdate() { sp_Volunteer_BLL vol_bll = new sp_Volunteer_BLL(); List<sp_Volunteer_DM> allVols = vol_bll.ListVolunteers(); Assert.IsTrue(allVols.Count > 0, "The ListVolunteers() is broken, or no data in DB"); sp_Volunteer_DM firstVol = allVols[0]; firstVol.VolID = Guid.NewGuid(); vol_bll.InsertVolunteerContext(ref firstVol); String newFirst = "NewFirst"; String newMiddle = "NewMiddle"; String newLast = "NewLast"; firstVol.VolFirstName = newFirst; firstVol.VolMiddleName = newMiddle; firstVol.VolLastName = newLast; vol_bll.UpdateVolunteerContext(firstVol); volunteersToRemove.Add(firstVol); sp_Volunteer_DM selectedVol = vol_bll.ListVolunteers(firstVol.VolID); Assert.IsTrue(VolEquals(firstVol, selectedVol)); Assert.AreEqual(newFirst, selectedVol.VolFirstName); Assert.AreEqual(newMiddle, selectedVol.VolMiddleName); Assert.AreEqual(newLast, selectedVol.VolLastName); }
public void TestVolPhoneCreate() { 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 volPhoneNbr = "0123456789"; bool PrimaryFlg = true; bool ActiveFlg = true; sp_VolPhone_BLL volPhone_bll = new sp_VolPhone_BLL(); sp_Phone_DM volPhone_dm = new sp_Phone_DM(); volPhone_dm.PhoneNbr = volPhoneNbr; volPhone_dm.VolID = volID; volPhone_dm.ActiveFlg = ActiveFlg; volPhone_dm.PrimaryFlg = PrimaryFlg; volPhone_bll.InsertPhoneContext(volPhone_dm); int volPhoneID = volPhone_dm.PhoneID; List<sp_Phone_DM> volPhoneDMs_selected = volPhone_bll.ListPhones(volPhone_dm); Assert.IsTrue(PhoneListContains(volPhoneDMs_selected, volPhone_dm)); }
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)); }
public void TestVolAddressCreate() { 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 = Guid.NewGuid(); vol_dm.VolID = volID; createTestVol = vol_dm; vol_bll.InsertVolunteerContext(ref vol_dm); string volAddr1 = "CreateLine1"; string volAddr2 = "CreateLine2"; string volAddr3 = "CreateLine3"; string volCity = "CreateCity"; string volSt = "CS"; int volZip = 13579; int volZip4 = 2468; bool PrimaryFlg = true; bool ActiveFlg = true; sp_Vol_Address_BLL volAddress_bll = new sp_Vol_Address_BLL(); sp_Vol_Address_DM volAddress_dm = new sp_Vol_Address_DM(); sp_Vol_Addr_DM volAddr_dm = new sp_Vol_Addr_DM(); volAddress_dm.ActiveFlg = ActiveFlg; volAddress_dm.AddrLine1 = volAddr1; volAddress_dm.AddrLine2 = volAddr2; volAddress_dm.AddrLine3 = volAddr3; volAddress_dm.City = volCity; volAddress_dm.St = volSt; volAddress_dm.Zip = volZip; volAddress_dm.Zip4 = volZip4; volAddress_dm.VolID = volID; volAddress_dm.PrimaryAddr = PrimaryFlg; volAddr_dm.PrimaryAddr = PrimaryFlg; volAddr_dm.VolID = volID; volAddress_bll.InsertAddressContext(ref volAddress_dm, ref volAddr_dm); sp_Vol_Address_DM volAddressDMs_selected = volAddress_bll.ListAddress(volAddress_dm); Assert.IsTrue(AddressEquals(volAddressDMs_selected, volAddress_dm)); }