Exemplo n.º 1
0
        public List <NewsLetter> GetAll()
        {
            var result = new List <NewsLetter>();

            try
            {
                var context = new PKDatabaseDataContext(ConfigurationManager.ConnectionStrings["DB_9B214B_ProductKnowledgeConnectionString"].ToString());
                result = context.NewsLetters.ToList();
            }
            catch (Exception) { }
            return(result);
        }
Exemplo n.º 2
0
        public PilotSignupStatus CreateOrUpdate(String emailAddress)
        {
            var result = PilotSignupStatus.Failed;

            try
            {
                var context = new PKDatabaseDataContext(ConfigurationManager.ConnectionStrings["DB_9B214B_ProductKnowledgeConnectionString"].ToString());

                context.NewsLetters.InsertOnSubmit(new NewsLetter()
                {
                    email = emailAddress
                });
                context.SubmitChanges();
                result = PilotSignupStatus.Success;
            }
            catch (Exception) { }
            return(result);
        }