Example #1
0
        // if the user exists and is valid, return the user, else return null
        internal static RewardDefinition getRewardDefinition(Guid defid)
        {
            DBClassesDataContext dbc = new DBClassesDataContext();
            RewardDefinition     ach = (from u in dbc.RewardDefinitions
                                        where u.RewardID == defid
                                        select u).SingleOrDefault();

            return(ach);
        }
Example #2
0
 internal static void delete(Guid achID)
 {
     using (DBClassesDataContext dbc = new DBClassesDataContext())
     {
         RewardDefinition ach = (from u in dbc.RewardDefinitions
                                 where u.RewardID == achID
                                 select u).SingleOrDefault();
         if (ach != null)
         {
             dbc.RewardDefinitions.DeleteOnSubmit(ach);
             dbc.SubmitChanges();
         }
     }
 }
Example #3
0
        // if the user exists and is valid, return the user, else return null
        public static ArrayList getRewardsForPilot(String pilotid)
        {
            ArrayList classes = new ArrayList();

            using (DBClassesDataContext dbc = new DBClassesDataContext())
            {
                IEnumerable <PilotReward> ach = (from u in dbc.PilotRewards
                                                 where u.PilotEmail == pilotid
                                                 select u);
                foreach (PilotReward pc in ach)
                {
                    RewardDefinition pcd = RewardDefinition.getRewardDefinition(pc.RewardID);
                    if (pcd != null)
                    {
                        classes.Add(pcd);
                    }
                }
            }
            return(classes);
        }