Esempio n. 1
0
        public static DigestEmailView Insert(DigestEmailView view)
        {
            using (DB db = new DB(DBHelper.GetConnectionString()))
            {
                DigestEmail email = new DigestEmail();

                if (email != null)
                {
                    email.Email = view.Email;
                    email.Client = view.Client;
                    email.IsWeekly = view.IsWeekly;
                    email.IsDaily = view.IsDaily;

                    db.AddToDigestEmails(email);

                    db.SaveChanges();

                    if(email.Id > 0)
                        AddLines(email.Id, view.Lines);

                    return ToDigestEmailView(email);
                }

            }

            return view;
        }