示例#1
0
        public List<sp_GroupAddr_DM> ListAddresses(sp_GroupAddr_DM cGroupAddr)
        {
            List<sp_GroupAddr_DM> list = new List<sp_GroupAddr_DM>();
            try
            {
                using (VolTeerEntities context = new VolTeerEntities())
                {
                    list = (from result in context.sp_GroupAddr_Select(cGroupAddr.GroupID, cGroupAddr.AddrID)
                            select new sp_GroupAddr_DM
                            {
                                GroupID = result.GroupID,
                                AddrID = result.AddrID,
                                PrimaryAddrID = result.PrimaryAddrID,
                                ActiveFlg = result.ActiveFlg
                            }).ToList();
                } // Guaranteed to close the Connection
            }
            catch (Exception ex)
            {
                throw (ex);
            }

            return list;
        }
示例#2
0
        public sp_GroupAddr_DM ListPrimaryAddress(sp_GroupAddr_DM cGroupAddr)
        {
            sp_GroupAddr_DM item = new sp_GroupAddr_DM();
            try
            {
                using (VolTeerEntities context = new VolTeerEntities())
                {
                    item = (from result in context.sp_GroupAddr_Select(cGroupAddr.GroupID, cGroupAddr.AddrID)
                            select new sp_GroupAddr_DM
                            {
                                GroupID = result.GroupID,
                                AddrID = result.AddrID,
                                PrimaryAddrID = result.PrimaryAddrID,
                                ActiveFlg = result.ActiveFlg
                            }).FirstOrDefault();
                } // Guaranteed to close the Connection
            }
            catch (Exception ex)
            {
                throw (ex);
            }

            return item;
        }