예제 #1
0
        public dive_contact_us Mapper(ContactInfo mapinfo)
        {
            dive_contact_us output = new dive_contact_us();

            output.name    = mapinfo.Name;
            output.email   = mapinfo.Email;
            output.subject = mapinfo.Subject;
            output.message = mapinfo.Message;

            return(output);
        }
예제 #2
0
        public void AddContactInfo(ContactInfo myinfo)
        {
            using (ScubaDiveEntities ctx = new ScubaDiveEntities())
            {
                dive_contact_us output = new dive_contact_us();

                output = Mapper(myinfo);

                try
                {
                    ctx.dive_contact_us.Add(output);
                    ctx.SaveChanges();
                }
                catch (Exception err)
                {
                    string error = err.InnerException.Message;
                    throw;
                }
            }
        }