public bool Exists(MailSendListInfo info)
        {
            string SQL_EXISTS =
                @" DECLARE @Result INT;
                            IF EXISTS( 
                            SELECT TOP 1 *
                            FROM  [MES].[TT_SYS_MAIL_SEND_LIST](nolock)
                            WHERE SYS_ID= '{0}' AND DATEDIFF(DAY, CREATE_DATE,GETDATE()) = 0
                            )
                            SET @Result = 1; 
                            ELSE 
                            SET @Result = 0; SELECT @Result;";

            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(string.Format(SQL_EXISTS, info.SysId));

            return(int.Parse("0" + db.ExecuteScalar(dbCommand)) > 0);
        }
        /// <summary>
        /// Add
        /// </summary>
        /// <param name="info"> info</param>
        public int Add(MailSendListInfo info)
        {
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(TT_SYS_MAIL_SEND_LIST_INSERT);


            db.AddInParameter(dbCommand, "@PLANT", DbType.String, info.Plant);

            db.AddInParameter(dbCommand, "@WORKSHOP", DbType.String, info.Workshop);

            db.AddInParameter(dbCommand, "@ASSEMBLY_LINE", DbType.String, info.AssemblyLine);

            db.AddInParameter(dbCommand, "@PRODUCT", DbType.String, info.Product);

            db.AddInParameter(dbCommand, "@SYS_ID", DbType.Int32, info.SysId);

            db.AddInParameter(dbCommand, "@ALARM_NAME", DbType.String, info.AlarmName);

            db.AddInParameter(dbCommand, "@ALARM_SUBJECT", DbType.String, info.AlarmSubject);

            db.AddInParameter(dbCommand, "@MAIL_BODY", DbType.String, info.MailBody);

            db.AddInParameter(dbCommand, "@CC_MAIL_GROUP", DbType.String, info.CcMailGroup);

            db.AddInParameter(dbCommand, "@MAILS", DbType.String, info.Mails);

            db.AddInParameter(dbCommand, "@SEND_STATUS", DbType.Int32, info.SendStatus);

            db.AddInParameter(dbCommand, "@SEND_DATE", DbType.DateTime, info.SendDate);

            db.AddInParameter(dbCommand, "@CREATE_USER", DbType.String, info.CreateUser);

            db.AddInParameter(dbCommand, "@CREATE_DATE", DbType.DateTime, info.CreateDate);

            db.AddInParameter(dbCommand, "@UPDATE_USER", DbType.String, info.UpdateUser);

            db.AddInParameter(dbCommand, "@UPDATE_DATE", DbType.DateTime, info.UpdateDate);

            return(int.Parse("0" + db.ExecuteScalar(dbCommand)));
        }