Esempio n. 1
0
        /// <summary>
        /// Returns all or a phone number for the given volunteer
        /// </summary>
        /// <returns></returns>
        public List<sp_Phone_DM> ListPhones(sp_Phone_DM cVolPhone)
        {
            List<sp_Phone_DM> list = new List<sp_Phone_DM>();
            try
            {
                using (VolTeerEntities context = new VolTeerEntities())
                {
                    list = (from result in context.sp_Vol_Phone_Select(cVolPhone.VolID, cVolPhone.PhoneID, null)
                            select new sp_Phone_DM
                            {
                                PhoneID = result.PhoneID,
                                PhoneNbr = result.PhoneNbr,
                                VolID = result.VolID,
                                ActiveFlg = result.ActiveFlg,
                                PrimaryFlg = result.PrimaryFlg

                            }).ToList();
                } // Guaranteed to close the Connection
            }
            catch (Exception ex)
            {
                throw (ex);
            }

            return list;
        }