示例#1
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("[email protected]", (CreateUserWizardStep1.ContentTemplateContainer.FindControl("Email") as RadTextBox).Text.Trim(), "VolTeer Registration", "Please click link to confirm");

            string continueUrl = ConfigurationManager.AppSettings["HomePage"].ToString();
            Response.Redirect(continueUrl);
        }
示例#2
0
        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);
        }
示例#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 = "[email protected]";
            primaryTestVolEmail.VolID = volID;
            primaryTestVolEmail.ActiveFlg = true;
            primaryTestVolEmail.PrimaryFlg = true;
            volEmail_bll.InsertEmailContext(ref primaryTestVolEmail);

            secondaryTestVolEmail = new sp_Email_DM();
            secondaryTestVolEmail.EmailAddr = "[email protected]";
            secondaryTestVolEmail.VolID = volID;
            secondaryTestVolEmail.ActiveFlg = true;
            secondaryTestVolEmail.PrimaryFlg = false;
            volEmail_bll.InsertEmailContext(ref secondaryTestVolEmail);
        }
示例#4
0
 public sp_Volunteer_DM hSelectVolunteer(Guid VolID)
 {
     sp_Volunteer_DM VOL = new sp_Volunteer_DM();
     sp_Volunteer_BLL VOlBll = new sp_Volunteer_BLL();
     VOL = VOlBll.ListVolunteers(VolID);
     return VOL;
 }
示例#5
0
        /// <summary>
        /// InsertVolunteerContext - Will insert a record into Volunteer table via SProc
        /// </summary>
        /// <param name="_cVolunteer"></param>
        public sp_Volunteer_DM InsertVolunteerContext(ref sp_Volunteer_DM _cVolunteer)
        {
            try
            {
                using (VolTeerEntities context = new VolTeerEntities())
                {
                    var cVolunteer = new tblVolunteer
                    {
                        VolID = _cVolunteer.VolID,
                        VolFirstName = _cVolunteer.VolFirstName,
                        VolMiddleName = _cVolunteer.VolMiddleName,
                        VolLastName = _cVolunteer.VolLastName,
                        ActiveFlg = _cVolunteer.ActiveFlg

                    };
                    context.tblVolunteers.Add(cVolunteer);
                    context.SaveChanges();

                    // pass VolID back to BLL
                    _cVolunteer.VolID = cVolunteer.VolID;

                    return _cVolunteer;
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
示例#6
0
        public sp_Volunteer_DM InsertVolunteerContext(sp_Volunteer_DM _cVolunteer)
        {
            BLL.InsertVolunteerContext(ref _cVolunteer);
            System.Web.Caching.Cache cache = HttpRuntime.Cache;
            cache.Insert(_cVolunteer.VolID.ToString(), _cVolunteer, null, DateTime.Now.AddSeconds(60), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.High, null);

            return _cVolunteer;
        }
示例#7
0
        public void hUpdateVolunteer(sp_Volunteer_DM VOL, string strFirstName, string strMiddleName, string strLastName)
        {
            sp_Volunteer_BLL VOlBll = new sp_Volunteer_BLL();

            VOL.VolFirstName = strFirstName;
            VOL.VolMiddleName = strMiddleName;
            VOL.VolLastName = strLastName;

            VOlBll.UpdateVolunteerContext(VOL);
        }
        /// <summary>
        /// DeleteVolunteerContext - Will do a soft delete (make inactive) by VolID
        /// </summary>
        /// <param name="_cVolunteer"></param>
        public void DeleteVolunteerContext(sp_Volunteer_DM _cVolunteer)
        {
            using (VolTeerEntities context = new VolTeerEntities())
            {
                var VolunteerToRemove = (from n in context.tblVolunteers where n.VolID == _cVolunteer.VolID select n).FirstOrDefault();
                context.tblVolunteers.Remove(VolunteerToRemove);
                context.SaveChanges();

            }
        }
示例#9
0
        /// <summary>
        /// Load the User Info based on the current Volunteer
        /// </summary>
        protected void LoadUserInfo()
        {
            sp_Volunteer_Cache VolCASH = new sp_Volunteer_Cache();
            sp_Volunteer_DM VolDM = new sp_Volunteer_DM();

            VolDM = VolCASH.ListVolunteers(UserID);

            rTBFirstName.Text = cCommonFunctions.HandleDBNull(VolDM.VolFirstName);
            rTBMiddleName.Text = cCommonFunctions.HandleDBNull(VolDM.VolMiddleName);
            rTBLastName.Text = cCommonFunctions.HandleDBNull(VolDM.VolLastName);
        }
示例#10
0
        /// <summary>
        /// DeleteVolunteerContext - Will do a soft delete (make inactive) by VolID
        /// </summary>
        /// <param name="_cVolunteer"></param>
        public void DeleteVolunteerContext(sp_Volunteer_DM _cVolunteer)
        {
            using (VolTeerEntities context = new VolTeerEntities())
            {
                var VolunteerToRemove = (from n in context.tblVolunteers where n.VolID == _cVolunteer.VolID select n).FirstOrDefault();
                VolunteerToRemove.ActiveFlg = false;
                context.sp_Volunteer_Update(VolunteerToRemove.VolID, VolunteerToRemove.ActiveFlg, VolunteerToRemove.VolFirstName,
                    VolunteerToRemove.VolMiddleName, VolunteerToRemove.VolLastName);
                context.SaveChanges();

            }
        }
示例#11
0
        public void DeleteVolunteerContext(sp_Volunteer_DM _cVolunteer)
        {
            System.Web.Caching.Cache cache = HttpRuntime.Cache;

            sp_Volunteer_DM cacheVol;
            cacheVol = (sp_Volunteer_DM)cache[_cVolunteer.VolID.ToString()];

            if (cacheVol != null)
            {
                cache.Remove(_cVolunteer.VolID.ToString());
            }
            BLL.DeleteVolunteerContext(_cVolunteer);
        }
示例#12
0
        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);
        }
示例#13
0
        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;
        }
示例#14
0
        public void UpdateSampleAddressContext(sp_Volunteer_DM _cVolunteer)
        {
            System.Web.Caching.Cache cache = HttpRuntime.Cache;

            sp_Volunteer_DM cacheVol;
            cacheVol = (sp_Volunteer_DM)cache[_cVolunteer.VolID.ToString()];

            if (cacheVol != null)
            {
                cache.Remove(_cVolunteer.VolID.ToString());
            }

            cache.Insert(_cVolunteer.VolID.ToString(), _cVolunteer, null, DateTime.Now.AddSeconds(60), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.High, null);
            BLL.UpdateSampleAddressContext(_cVolunteer);
        }
示例#15
0
        /// <summary>
        /// SaveUserInfo - Called from parent screen, build a domain model and save the user info
        /// </summary>
        internal void SaveUserInfo()
        {
            sp_Volunteer_Cache VolCASH = new sp_Volunteer_Cache();
            sp_Volunteer_DM VolDM = new sp_Volunteer_DM();

            //  Get the VolID from the parent form
            VolDM.VolID = new Guid(((HiddenField)Parent.FindControl("hdVolID")).Value);

            //  Get the other info from the controls in this container
            VolDM.VolFirstName = cCommonFunctions.SetNullIfEmpty(rTBFirstName.Text.ToString());
            VolDM.VolMiddleName = cCommonFunctions.SetNullIfEmpty(rTBMiddleName.Text.ToString());
            VolDM.VolLastName = cCommonFunctions.SetNullIfEmpty(rTBLastName.Text.ToString());

            VolCASH.UpdateVolunteerContext(VolDM);
        }
示例#16
0
        protected void LoadPage()
        {
            MembershipUser currentUser = Membership.GetUser();
            Guid? UserID = (Guid)currentUser.ProviderUserKey;

            sp_Volunteer_Cache VolCASH = new sp_Volunteer_Cache();
            sp_Volunteer_DM VolDM = new sp_Volunteer_DM();

            VolDM = VolCASH.ListVolunteers(UserID);

            hdVolID.Value = DataBinder.Eval(VolDM, "VolID").ToString();
            hdEditView.Value = "1";

            //Handle ucVolBasicInfo parameters
            ucVolBasicInfo.UserID = UserID;
        }
示例#17
0
        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);
        }
示例#18
0
        /// <summary>
        /// InsertVolunteerContext - Will insert a record into Volunteer table via SProc
        /// </summary>
        /// <param name="_cVolunteer"></param>
        public void InsertVolunteerContext(sp_Volunteer_DM _cVolunteer)
        {
            using (VolTeerEntities context = new VolTeerEntities())
            {
                var cVolunteer = new tblVolunteer
                {
                    VolID = _cVolunteer.VolID,
                    VolFirstName = _cVolunteer.VolFirstName,
                    VolMiddleName = _cVolunteer.VolMiddleName,
                    VolLastName = _cVolunteer.VolLastName,
                    ActiveFlg = _cVolunteer.ActiveFlg

                };
                context.tblVolunteers.Add(cVolunteer);
                context.SaveChanges();
            }
        }
        protected void LoadPage()
        {
            MembershipUser currentUser;
            currentUser = Membership.GetUser();
            Guid? UserID;
            UserID = (Guid)currentUser.ProviderUserKey;

            System.Web.Caching.Cache cache = HttpRuntime.Cache;

            sp_Volunteer_Cache VolCASH = new sp_Volunteer_Cache();
            sp_Volunteer_DM VolDM = new sp_Volunteer_DM();

            VolDM = VolCASH.ListVolunteers(UserID);

            ctl02.Text = (string)DataBinder.Eval(VolDM, "VolID");

            //Cache.Add(UserID.ToString(), VolDM, null, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration, CacheItemPriority.High, null);
        }
示例#20
0
        /// <summary>
        /// ListVolunteers - There's a good chance the same record may be requested often.  Cache the vol object...
        /// 
        /// </summary>
        /// <param name="Volunteer"></param>
        /// <returns></returns>
        public sp_Volunteer_DM ListVolunteers(Guid? Volunteer)
        {
            sp_Volunteer_DM cVol = new sp_Volunteer_DM();

            //Cache cache = HttpRuntime.Cache;
            System.Web.Caching.Cache cache = HttpRuntime.Cache;

            sp_Volunteer_DM cacheVol;
            cacheVol = (sp_Volunteer_DM)cache[Volunteer.ToString()];

            if (cacheVol == null)
            {
                cVol = BLL.ListVolunteers(Volunteer);
                cache.Insert(cVol.VolID.ToString(), cVol, null, DateTime.Now.AddSeconds(60), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.High, null);
            }
            else
            {
                cVol = cacheVol;
            }

            return cVol;
        }
示例#21
0
        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));
        }
示例#22
0
        /// <summary>
        /// UpdateSampleAddressContext - Will update a given Volunteer record by VolID
        /// </summary>
        /// <param name="_cVolunteer"></param>
        public void UpdateVolunteerContext(sp_Volunteer_DM _cVolunteer)
        {
            using (VolTeerEntities context = new VolTeerEntities())
            {
                var cVolunteer = context.tblVolunteers.Find(_cVolunteer.VolID);

                if (cVolunteer != null)
                {
                    cVolunteer.VolFirstName = _cVolunteer.VolFirstName;
                    cVolunteer.VolMiddleName = _cVolunteer.VolMiddleName;
                    cVolunteer.VolLastName = _cVolunteer.VolLastName;
                    cVolunteer.ActiveFlg = _cVolunteer.ActiveFlg;
                    context.SaveChanges();
                }
            }
        }
示例#23
0
        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));
        }
示例#24
0
 public void UpdateVolunteerContext(sp_Volunteer_DM _cVolunteer)
 {
     DAL.UpdateVolunteerContext(_cVolunteer);
 }
示例#25
0
 public void DeleteVolunteerContext(sp_Volunteer_DM _cVolunteer)
 {
     DAL.DeleteVolunteerContext(_cVolunteer);
 }
示例#26
0
 public void InsertVolunteerContext(sp_Volunteer_DM _cVolunteer)
 {
     DAL.InsertVolunteerContext(_cVolunteer);
 }
示例#27
0
 private static bool VolEquals(sp_Volunteer_DM vol1, sp_Volunteer_DM vol2)
 {
     return ((vol1.VolID == vol2.VolID) &&
         (vol1.VolFirstName == vol2.VolFirstName) &&
         (vol1.VolMiddleName == vol2.VolMiddleName) &&
         (vol1.VolLastName == vol2.VolLastName) &&
         (vol1.ActiveFlg == vol2.ActiveFlg));
 }
示例#28
0
 public sp_Volunteer_DM InsertVolunteerContext(ref sp_Volunteer_DM _cVolunteer)
 {
     return DAL.InsertVolunteerContext(ref _cVolunteer);
 }
示例#29
0
 private static List<sp_Volunteer_DM> getVolDMs(DataTable dataTable)
 {
     List<sp_Volunteer_DM> volDMs = new List<sp_Volunteer_DM>();
     for (int i = 0; i < dataTable.Rows.Count; i++)
     {
         sp_Volunteer_DM returnVolunteer = new sp_Volunteer_DM();
         returnVolunteer.VolID = new Guid((string)dataTable.Rows[i]["VolID"]);
         returnVolunteer.VolFirstName = (String)dataTable.Rows[i]["VolFirstName"];
         returnVolunteer.VolMiddleName = (String)dataTable.Rows[i]["VolMiddleName"];
         returnVolunteer.VolLastName = (String)dataTable.Rows[i]["VolLastName"];
         returnVolunteer.ActiveFlg = Convert.ToBoolean(dataTable.Rows[i]["ActiveFlg"]);
         volDMs.Add(returnVolunteer);
     }
     return volDMs;
 }
示例#30
0
        public void hDeleteVolunteer(sp_Volunteer_DM VOL)
        {
            sp_Volunteer_BLL VOlBll = new sp_Volunteer_BLL();

            VOlBll.DeleteVolunteerContext(VOL);
        }