Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="MonitorBackupServer"></param>
        /// <param name="conn"></param>
        /// <returns></returns>
        public int UpdateMonitorBackupServer(MonitorBackupServer MonitorBackupServer, OdbcConnection conn)
        {
            int    result = -1;
            string sql    = @"UPDATE monitorBackupServer
                               SET backupServerGroupID = ?
                                  ,updater = ?
                                  ,updateDate = ? 
                             WHERE monitorServerID=@monitorServerID";

            OdbcParameter[] para = new OdbcParameter[] {
                new OdbcParameter("@backupServerGroupID", MonitorBackupServer.backupServerGroupId),
                new OdbcParameter("@updater", MonitorBackupServer.updater),
                new OdbcParameter("@updateDate", MonitorBackupServer.updateDate),
                new OdbcParameter("@monitorServerID", MonitorBackupServer.monitorServerId)
            };
            try
            {
                result = db.Udaquery(sql, conn, para);
            }
            catch (Exception e)
            {
                throw e;
            }
            return(result);
        }
Ejemplo n.º 2
0
 public int InsertMonitorBackupServer(MonitorBackupServer MonitorBackupServer, OdbcConnection conn)
 {
     try
     {
         return(db.insert(MonitorBackupServer, "monitorBackupServer", conn));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Ejemplo n.º 3
0
        public int InsertMonitorBackupServer(MonitorBackupServer MonitorBackupServer)
        {
            OdbcConnection conn;
            int            count = 0;

            using (conn = OdbcHelper.CreateConntion())
            {
                conn.Open();
                count = MonitorBackupServerDal.InsertMonitorBackupServer(MonitorBackupServer, conn);
                conn.Close();
            }
            return(count);
        }