Ejemplo n.º 1
0
        public int Delete(int id)
        {
            string sqlText = "DELETE FROM `custom_db_config` WHERE `Id` = @Id;";

            MySqlParameter[] parameters =
            {
                new MySqlParameter("@Id", MySqlDbType.Int32)
                {
                    Value = id
                }
            };
            return(MySqlDbHelper.ExecuteNonQuery(sqlText, parameters));
        }
Ejemplo n.º 2
0
        public int Delete(int jobId, string jobName)
        {
            string sqlText = "DELETE FROM custom_job_details WHERE JobId = @JobId AND JobName = @JobName;";

            MySqlParameter[] parameters =
            {
                new MySqlParameter("@JobId",   MySqlDbType.Int32)
                {
                    Value = jobId
                },
                new MySqlParameter("@JobName", MySqlDbType.VarChar, 100)
                {
                    Value = jobName
                }
            };
            return(MySqlDbHelper.ExecuteNonQuery(sqlText, parameters));
        }
Ejemplo n.º 3
0
        public int Update(CustomJobDetail jobDetail)
        {
            jobDetail.UpdatedDate = DateTime.Now;

            string sqlText = @"UPDATE custom_job_details
                                SET `JobName` = @JobName,
                                `JobGroup` = @JobGroup,
                                `JobChineseName` = @JobChineseName,
                                `JobServiceURL` = @JobServiceURL,
                                `CreatedDate` = @CreatedDate,
                                `UpdatedDate` = @UpdatedDate,
                                `StartDate` = @StartDate,
                                `EndDate` = @EndDate,
                                `PageSize` = @PageSize,
                                `Interval` = @Interval,
                                `IntervalType`=@IntervalType,
                                `State` = @State,
                                `Description` = @Description,
                                `ExecutedFreq`=@ExecutedFreq
                                WHERE `JobId` = @JobId;";

            MySqlParameter[] parameters =
            {
                new MySqlParameter("@JobId",          MySqlDbType.Int32)
                {
                    Value = jobDetail.JobId
                },
                new MySqlParameter("@JobName",        MySqlDbType.VarChar, 100)
                {
                    Value = jobDetail.JobName
                },
                new MySqlParameter("@JobGroup",       MySqlDbType.VarChar, 50)
                {
                    Value = jobDetail.JobGroup
                },
                new MySqlParameter("@JobChineseName", MySqlDbType.VarChar, 100)
                {
                    Value = jobDetail.JobChineseName
                },
                new MySqlParameter("@JobServiceURL",  MySqlDbType.VarChar, 200)
                {
                    Value = jobDetail.JobServiceURL
                },
                new MySqlParameter("@CreatedDate",    MySqlDbType.DateTime)
                {
                    Value = jobDetail.CreatedDate
                },
                new MySqlParameter("@UpdatedDate",    MySqlDbType.DateTime)
                {
                    Value = jobDetail.UpdatedDate
                },
                new MySqlParameter("@StartDate",      MySqlDbType.DateTime)
                {
                    Value = jobDetail.StartDate
                },
                new MySqlParameter("@EndDate",        MySqlDbType.DateTime)
                {
                    Value = jobDetail.EndDate
                },
                new MySqlParameter("@PageSize",       MySqlDbType.Int32)
                {
                    Value = jobDetail.PageSize
                },
                new MySqlParameter("@Interval",       MySqlDbType.Int32)
                {
                    Value = jobDetail.Interval
                },
                new MySqlParameter("@IntervalType",   MySqlDbType.Byte)
                {
                    Value = jobDetail.IntervalType
                },
                new MySqlParameter("@State",          MySqlDbType.Byte)
                {
                    Value = jobDetail.State
                },
                new MySqlParameter("@Description",    MySqlDbType.VarChar, 255)
                {
                    Value = jobDetail.Description
                },
                new MySqlParameter("@ExecutedFreq",   MySqlDbType.Byte)
                {
                    Value = jobDetail.ExecutedFreq
                }
            };
            return(MySqlDbHelper.ExecuteNonQuery(sqlText, parameters));
        }
Ejemplo n.º 4
0
        public int Update(SqlServerConfigInfo dbConfigInfo)
        {
            dbConfigInfo.UpdatedDate = DateTime.Now;
            string sqlText = @"UPDATE `custom_db_config`
                                SET
                                `ServerAddress` = @ServerAddress,
                                `DBName` = @DBName,
                                `UserName` = @UserName,
                                `Password` = @Password,
                                `UpdatedDate` = @UpdatedDate,
                                `CreatedDate` = @CreatedDate,
                                `EquipmentNum`=@EquipmentNum,
                                `PageSize`=@PageSize,
                                `MaxCapacity`=@MaxCapacity,
                                `StoredType`=@StoredType,
                                `DBType`=@DBType,
                                `ServerState`=@ServerState,
                                `AuthenticatedType`=@AuthenticatedType
                                WHERE `Id` = @Id;";

            MySqlParameter[] parameters =
            {
                new MySqlParameter("@Id",                MySqlDbType.Int32)
                {
                    Value = dbConfigInfo.Id
                },
                new MySqlParameter("@DBName",            MySqlDbType.VarChar, 45)
                {
                    Value = dbConfigInfo.DBName
                },
                new MySqlParameter("@ServerAddress",     MySqlDbType.VarChar, 30)
                {
                    Value = dbConfigInfo.ServerAddress
                },
                new MySqlParameter("@UserName",          MySqlDbType.VarChar, 45)
                {
                    Value = dbConfigInfo.UserName
                },
                new MySqlParameter("@Password",          MySqlDbType.VarChar, 45)
                {
                    Value = dbConfigInfo.Password
                },
                new MySqlParameter("@UpdatedDate",       MySqlDbType.DateTime)
                {
                    Value = dbConfigInfo.UpdatedDate
                },
                new MySqlParameter("@CreatedDate",       MySqlDbType.DateTime)
                {
                    Value = dbConfigInfo.CreatedDate
                },
                new MySqlParameter("@EquipmentNum",      MySqlDbType.VarChar, 25)
                {
                    Value = dbConfigInfo.EquipmentNum
                },
                new MySqlParameter("@PageSize",          MySqlDbType.Int32)
                {
                    Value = dbConfigInfo.PageSize
                },
                new MySqlParameter("@MaxCapacity",       MySqlDbType.Int32)
                {
                    Value = dbConfigInfo.MaxCapacity
                },
                new MySqlParameter("@StoredType",        MySqlDbType.Byte)
                {
                    Value = dbConfigInfo.StoredType
                },
                new MySqlParameter("@DBType",            MySqlDbType.Byte)
                {
                    Value = dbConfigInfo.DBType
                },
                new MySqlParameter("@ServerState",       MySqlDbType.Byte)
                {
                    Value = dbConfigInfo.ServerState
                },
                new MySqlParameter("@AuthenticatedType", MySqlDbType.Byte)
                {
                    Value = dbConfigInfo.AuthenticatedType
                }
            };
            return(MySqlDbHelper.ExecuteNonQuery(sqlText, parameters));
        }