public static bool ExistTemplate(int id)
        {
            var baseRepository = new Dynamo.BaseRepository();
            var exist          = baseRepository.GetItem <Dynamo.Template>(id) != null;

            return(exist);
        }
        public static void Save(Domain.Notification notification)
        {
            var obj = new Dynamo.Notification
            {
                IdNotification = notification.IdNotification,
                IdTemplate     = notification.TemplateSend.IdTemplate,
                Path           = notification.TemplateSend.path,
                Fields         = JsonConvert.SerializeObject(notification.TemplateSend.Field),
                Mail           = JsonConvert.SerializeObject(notification.MailSend),
                Reminder       = notification.ReminderSend.IsRemainder,
                Begin          = notification.ReminderSend.Begin,
                End            = notification.ReminderSend.End,
                Timer          = notification.ReminderSend.Timer,
                NextTime       = notification.ReminderSend.NetTime,
                State          = notification.State,
                Origin         = notification.Origin,
                Language       = notification.Language,
                Try            = notification.Try,
                CreationDate   = DateTime.Now
            };

            var baserepositorio = new Dynamo.BaseRepository();

            baserepositorio.InsertOrupdate(obj);
        }
Esempio n. 3
0
        public static Domain.Template GetTemplate(int id)
        {
            Dynamo.BaseRepository baseRepository = new Dynamo.BaseRepository();
            var template = baseRepository.GetItem <Dynamo.Template>(id);

            return(new Domain.Template()
            {
                IdTemplate = template.IdTemplate, Bucket = template.path, FileName = template.FileName
            });
        }
        public static void Delete(Domain.Notification notification)
        {
            var obj = new Dynamo.Notification
            {
                IdNotification = notification.IdNotification,
                IdTemplate     = notification.TemplateSend.IdTemplate,
                Fields         = JsonConvert.SerializeObject(notification.TemplateSend.Field),
                Mail           = JsonConvert.SerializeObject(notification.MailSend),
                Reminder       = notification.ReminderSend.IsRemainder,
                Begin          = notification.ReminderSend.Begin,
                End            = notification.ReminderSend.End,
                Timer          = notification.ReminderSend.Timer,
                NextTime       = notification.ReminderSend.NetTime,
                State          = notification.State,
                CreationDate   = DateTime.Now,
                ModifyDate     = DateTime.Now
            };
            var baseRepositorio = new Dynamo.BaseRepository();

            baseRepositorio.Delete(obj);
        }
        public static Domain.Notification GetNotification(string id)
        {
            var notificationSend = new Dynamo.BaseRepository().GetItem <Dynamo.Notification>(id);

            return(Parse(notificationSend));
        }