Exemple #1
0
        public IEnumerable <QuartzServerModel> GetAllServer()
        {
            string         sql  = "select * from Quartz_Server where IsEnable=1";
            SqlConnection  conn = new SqlConnection(DBConnection.ConnectionString);
            SqlDataAdapter da   = new SqlDataAdapter();

            da.SelectCommand = new SqlCommand(sql, conn);
            DataTable dt = new DataTable();

            da.Fill(dt);
            return(OrmTransfer.DataTableToList <QuartzServerModel>(dt));
        }
Exemple #2
0
        public QuartzSchedulerModel GetScheduler(int schId)
        {
            string sql = @"SELECT * FROM Quartz_Scheduler WHERE SchedulerId=@SchedulerId";

            SqlConnection  conn = new SqlConnection(DBConnection.ConnectionString);
            SqlDataAdapter da   = new SqlDataAdapter();

            da.SelectCommand = new SqlCommand(sql, conn);
            da.SelectCommand.Parameters.Add(new SqlParameter("@SchedulerId", schId));
            DataTable dt = new DataTable();

            da.Fill(dt);
            if (dt == null || dt.Rows.Count <= 0)
            {
                return(null);
            }
            return(OrmTransfer.GetModel <QuartzSchedulerModel>(dt.Rows[0]));
        }