Beispiel #1
0
        internal bool LoadNextJob(Business.ConvertQueue item, string ServerName)
        {
            bool blnJobAvailable = false;

            SqlConnection Conn = new SqlConnection(strConn);
            try
            {
                SqlCommand cmd = new SqlCommand();

                cmd.Connection = Conn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "hisp_ConvertQueue_LoadNextJob";
                cmd.Parameters.Add(SqlHelper.AddParameter("@ServerName", SqlDbType.NVarChar, 250, ServerName));

                Conn.Open();
                SqlDataReader sqlReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
                if (sqlReader.Read())
                {
                    FillObject(item, sqlReader);
                    blnJobAvailable = true;
                }
                else
                {
                    blnJobAvailable = false;
                }
                sqlReader.Close();
            }
            finally
            {
                if (Conn != null && Conn.State != ConnectionState.Closed)
                    Conn.Close();
            }

            return blnJobAvailable;
        }
Beispiel #2
0
        internal _4screen.CSB.DataAccess.Business.ConvertQueue LoadLastTimestamp(string ServerName)
        {
            Business.ConvertQueue item = null;

            SqlConnection Conn = new SqlConnection(strConn);
            try
            {
                SqlCommand cmd = new SqlCommand();

                cmd.Connection = Conn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "hisp_ConvertQueue_LoadLastTimestamp";
                cmd.Parameters.Add(SqlHelper.AddParameter("@ServerName", SqlDbType.NVarChar, 250, ServerName));

                Conn.Open();
                SqlDataReader sqlReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
                if (sqlReader.Read())
                {
                    item = new Business.ConvertQueue();
                    FillObject(item, sqlReader);
                }
                sqlReader.Close();
            }
            finally
            {
                if (Conn != null && Conn.State != ConnectionState.Closed)
                    Conn.Close();
            }

            return item;
        }
Beispiel #3
0
        internal List<_4screen.CSB.DataAccess.Business.ConvertQueue> LoadWaitingJobs()
        {
            List<Business.ConvertQueue> list = new List<Business.ConvertQueue>();

            SqlConnection Conn = new SqlConnection(strConn);
            try
            {
                SqlCommand cmd = new SqlCommand();

                cmd.Connection = Conn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "hisp_ConvertQueue_LoadWaitingJobs";

                Conn.Open();
                SqlDataReader sqlReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
                while (sqlReader.Read())
                {
                    Business.ConvertQueue item = new Business.ConvertQueue();
                    FillObject(item, sqlReader);
                    list.Add(item);
                }
                sqlReader.Close();
            }
            finally
            {
                if (Conn != null && Conn.State != ConnectionState.Closed)
                    Conn.Close();
            }

            return list;
        }
Beispiel #4
0
        internal void Insert(Business.ConvertQueue item)
        {
            SqlConnection Conn = new SqlConnection(strConn);
            try
            {
                SqlCommand cmd = new SqlCommand();

                cmd.Connection = Conn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "hisp_ConvertQueue_Insert";
                cmd.Parameters.Add(SqlHelper.AddParameter("@OBJ_ID", SqlDbType.UniqueIdentifier, item.ObjectID.Value));
                cmd.Parameters.Add(SqlHelper.AddParameter("@OBJ_Type", SqlDbType.Int, (int)item.ObjectType));
                cmd.Parameters.Add(SqlHelper.AddParameter("@COQ_Status", SqlDbType.Int, (int)item.Status));
                cmd.Parameters.Add(SqlHelper.AddParameter("@COQ_UserEmail", SqlDbType.NVarChar, 250, item.UserEmail));
                cmd.Parameters.Add(SqlHelper.AddParameter("@COQ_VideoPreviewPictureTimepointSec", SqlDbType.Float, item.VideoPreviewPictureTimepointSec));
                cmd.Parameters.Add(SqlHelper.AddParameter("@COQ_EstimatedWorkTimeSec", SqlDbType.Int, item.EstimatedWorkTimeSec));

                Conn.Open();
                cmd.ExecuteNonQuery();
            }
            finally
            {
                Conn.Close();
            }
        }
Beispiel #5
0
        internal void Delete(Business.ConvertQueue item)
        {
            SqlConnection Conn = new SqlConnection(strConn);
            try
            {
                SqlCommand cmd = new SqlCommand();

                cmd.Connection = Conn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "hisp_ConvertQueue_Delete";
                cmd.Parameters.Add(SqlHelper.AddParameter("@ID", SqlDbType.UniqueIdentifier, item.ID.Value));

                Conn.Open();
                cmd.ExecuteNonQuery();
            }
            finally
            {
                Conn.Close();
            }
        }