Example #1
0
        public void AddCallOrEmail(CallOrEmail c)
        {
            c.Date = DateTime.Now;
            var repo = new StudentsRepository(_connectionString);

            repo.AddCallOrEmail(c);
        }
Example #2
0
        public string SendEmail(int id)
        {
            var     repo   = new StudentsRepository(_connectionString);
            Student s      = repo.GetStudentById(id);
            var     result = repo.SendEmail(s.Email);

            if (result == "Mail has been successfully sent!")
            {
                CallOrEmail c = new CallOrEmail
                {
                    StudentId = id,
                    Type      = CallOrEmailType.Email,
                    Date      = DateTime.Now,
                    Notes     = "sent automatic email"
                };
                repo.AddCallOrEmail(c);
            }
            return(result);
        }