public static List <object> AddLog(string id, string Order, bool Dummy) { List <object> result = new List <object>(); QuerySelectPDA q = new QuerySelectPDA(); string BrLog = "Select a.* from BrLog a where a.idBr=" + id + " Order by " + Order; string BrLogDet = "Select * from BrLogDet where idlog=" + id + " Order by IdLogDet"; if (Dummy) { q.Select(BrLog); List <DataRows> lst = q.GetRows(); foreach (DataRows rows in lst) { BrLog log = new BrLog(); log.LogType = rows.FieldByName("LogType"); log.TableName = rows.FieldByName("TableName"); log.TableDescr = rows.FieldByName("TableDescr"); log.RunDate = rows.FieldByName("Rundate"); log.IdLog = rows.FieldByName("idLog"); //log.ValueOld = rows.FieldByName("ValueOld"); //log.ValueNew = rows.FieldByName("ValueNew"); // //log.FieldName = rows.FieldByName("FieldName"); //log.FieldDescr = rows.FieldByName("FieldDescr"); //if (log.ValueOld.TrimEnd(',', '0') != log.ValueNew.TrimEnd(',', '0')) result.Add(log); } } else { q.Select(BrLogDet); List <DataRows> lst = q.GetRows(); foreach (DataRows rows in lst) { BrLogDet log = new BrLogDet(); log.FieldName = rows.FieldByName("FieldName"); log.FieldDescr = rows.FieldByName("FieldDescr"); log.ValueOld = rows.FieldByName("ValueOld"); log.ValueNew = rows.FieldByName("ValueNew"); if (log.ValueOld.TrimEnd(',', '0') != log.ValueNew.TrimEnd(',', '0')) { result.Add(log); } } } return(result); }
public static List<object> AddLog(string id, string Order, bool Dummy) { List<object> result = new List<object>(); QuerySelectPDA q = new QuerySelectPDA(); string BrLog = "Select a.* from BrLog a where a.idBr=" + id + " Order by " + Order; string BrLogDet = "Select * from BrLogDet where idlog=" + id + " Order by IdLogDet"; if (Dummy) { q.Select(BrLog); List<DataRows> lst = q.GetRows(); foreach (DataRows rows in lst) { BrLog log = new BrLog(); log.LogType = rows.FieldByName("LogType"); log.TableName = rows.FieldByName("TableName"); log.TableDescr = rows.FieldByName("TableDescr"); log.RunDate = rows.FieldByName("Rundate"); log.IdLog = rows.FieldByName("idLog"); //log.ValueOld = rows.FieldByName("ValueOld"); //log.ValueNew = rows.FieldByName("ValueNew"); // //log.FieldName = rows.FieldByName("FieldName"); //log.FieldDescr = rows.FieldByName("FieldDescr"); //if (log.ValueOld.TrimEnd(',', '0') != log.ValueNew.TrimEnd(',', '0')) result.Add(log); } } else { q.Select(BrLogDet); List<DataRows> lst = q.GetRows(); foreach (DataRows rows in lst) { BrLogDet log = new BrLogDet(); log.FieldName = rows.FieldByName("FieldName"); log.FieldDescr = rows.FieldByName("FieldDescr"); log.ValueOld = rows.FieldByName("ValueOld"); log.ValueNew = rows.FieldByName("ValueNew"); if (log.ValueOld.TrimEnd(',', '0') != log.ValueNew.TrimEnd(',', '0')) { result.Add(log); } } } return result; }