Ejemplo n.º 1
0
        /// <summary>
        /// 按CreateTime逆序查询Tickets表,返回一个Datatable
        /// </summary>
        /// <returns></returns>
        public DataTable GetTickets()
        {
            DataTable table       = new DataTable();
            string    commandText = "SELECT * FROM Tickets ORDER BY CreateTime DESC";

            try
            {
                table = sqliteHelper.ExecuteDataTable(commandText, null);
            }
            catch (Exception ex)
            {
                logger.Info(string.Format("查询数据库表Tickets记录失败:"), ex);
            }
            return(table);
        }
        private DataTable GetDtExportWordTicket(string focusedRowsCreateTime)
        {
            string sqlQueryTickets = string.Format(@"SELECT Name,Task,No,OperationDate,StartTime,EndTime FROM Tickets WHERE CreateTime='{0}'",
                                                   focusedRowsCreateTime);

            try
            {
                DataTable dtReturn = sqliteHelper.ExecuteDataTable(sqlQueryTickets, null);
                return(dtReturn);
            }
            catch (Exception ex)
            {
                logger.Info("图片加载失败", ex);
                return(null);
            }
        }
        private void InitDtGridView()
        {
            SQLiteDBHelper sqliteHelper = new SQLiteDBHelper();

            try
            {
                string sqlSelectTickets = @"SELECT CreateTime,StepNo,Operation,Comment,ImagePathCircuit,ImagePathCapacity FROM OperationSteps";
                dtGridView = sqliteHelper.ExecuteDataTable(sqlSelectTickets, null);
                dtGridView.Clear();
            }
            catch (Exception ex)
            {
            }
        }