public int CreateUploadToDocumentsFailureAlert(int tenant, string user, int mailboxId, UploadToDocumentsErrorType errorType)
        {
            var data = new UploadToDocumentsFailure
            {
                error_type = (int)errorType
            };

            var jsonData = MailUtil.GetJsonString(data);

            var alert = new Alert
            {
                Tenant    = tenant,
                User      = user,
                MailboxId = mailboxId,
                Type      = MailAlertTypes.UploadFailure,
                Data      = jsonData
            };

            using (var dao = new DaoFactory())
            {
                var result = dao.CreateAlertDao(tenant, user).SaveAlert(alert);

                if (result <= 0)
                {
                    throw new Exception("Save alert failed");
                }

                return(result);
            }
        }
        public int CreateUploadToDocumentsFailureAlert(int tenant, string user, int mailboxId, UploadToDocumentsErrorType errorType)
        {
            var data = new UploadToDocumentsFailure
            {
                error_type = (int)errorType
            };

            return(CreateAlert(tenant, user, mailboxId, AlertTypes.UploadFailure, data));
        }
        public int CreateUploadToDocumentsFailureAlert(int tenant, string user, int mailboxId, UploadToDocumentsErrorType errorType)
        {
            var data = new UploadToDocumentsFailure
                {
                    error_type = (int) errorType
                };

            return CreateAlert(tenant, user, mailboxId, AlertTypes.UploadFailure, data);
        }