Exemplo n.º 1
0
 // --
 /// <summary>
 /// Сохраняет запись в таблицу BrLogDet
 /// </summary>
 /// <param name="id">Идентификатор FK на BrLog</param>
 public static List<LogRecordDetail> Load(string id)
 {
     QuerySelectPDA q=new QuerySelectPDA();
     List<LogRecordDetail> list=new List<LogRecordDetail>();
     q.Select("select * from LogRecordDetail where idlog=" + id);
     List<DataRows> rows = q.GetRows();
     foreach (DataRows row in rows)
     {
         LogRecordDetail lrd=new LogRecordDetail();
         lrd.fieldName = row.FieldByName("fieldName");
         lrd.fieldDescr = row.FieldByName("fieldDescr");
         lrd.valueOld = row.FieldByName("valueOld");
         lrd.valueNew = row.FieldByName("valueNew");
         list.Add(lrd);
     }
     return list;
 }
Exemplo n.º 2
0
        // --
        /// <summary>
        /// Сохраняет запись в таблицу BrLogDet
        /// </summary>
        /// <param name="id">Идентификатор FK на BrLog</param>
        public static List <LogRecordDetail> Load(string id)
        {
            QuerySelectPDA         q    = new QuerySelectPDA();
            List <LogRecordDetail> list = new List <LogRecordDetail>();

            q.Select("select * from LogRecordDetail where idlog=" + id);
            List <DataRows> rows = q.GetRows();

            foreach (DataRows row in rows)
            {
                LogRecordDetail lrd = new LogRecordDetail();
                lrd.fieldName  = row.FieldByName("fieldName");
                lrd.fieldDescr = row.FieldByName("fieldDescr");
                lrd.valueOld   = row.FieldByName("valueOld");
                lrd.valueNew   = row.FieldByName("valueNew");
                list.Add(lrd);
            }
            return(list);
        }
Exemplo n.º 3
0
        public List <LogRecordDetail> detailRecords;// = new List<LogRecordDetail>();
        // ---
        /// <summary>
        /// Получает данные из базу.
        /// </summary>
        public List <LogRecord> Load()
        {
            List <LogRecord> list = new List <LogRecord>();
            QuerySelectPDA   q    = new QuerySelectPDA();

            q.Select("select * from Brlog");
            List <DataRows> rows = q.GetRows();

            foreach (DataRows row in rows)
            {
                LogRecord lr = new LogRecord();
                lr.idBr       = Int32.Parse(row.FieldByName("idbr"));
                lr.sqlText    = row.FieldByName("sqltext");
                lr.runDate    = row.FieldByName("rundate");
                lr.logType    = (LogType)Enum.Parse(typeof(LogType), row.FieldByName("logtype"));
                lr.tableName  = row.FieldByName("tablename");
                lr.tableDescr = row.FieldByName("tableDescr");
                string idlog = row.FieldByName("idlog");
                lr.detailRecords = LogRecordDetail.Load(idlog);
                list.Add(lr);
            }
            return(list);
        }