public Boolean IsReportNameUsed(ReportInfo report, Boolean isAdd) { WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder(); builder.AppendItem(ReportInfoDBConst.ReportName, report.ReportName); ReportInfo reportInfo = GetReportInfoList(builder).FirstOrDefault(); if (reportInfo == null) { return false; } else { if (isAdd) { return true; } else { return reportInfo.ReportID.Equals(report.ReportID) ? false : true; } } }
public Int32 UpdateReportInfo(ReportInfo reportInfo) { String sql = ORMapping.GetUpdateSql(reportInfo, BuilderEx.TSqlBuilderInstance); int result = _DataHelper.ExecuteSql(sql); return result; }
public List<ReportInfo> GetReportInfoList(WhereSqlClauseBuilder builder) { String sql = String.Format("SELECT * FROM {0} WHERE {1} ORDER BY REPORT_CODE", ReportInfoDBConst.TableName, builder.ToSqlString()); DataTable dt = _DataHelper.GetDataTable(sql); List<ReportInfo> result = new List<ReportInfo>(); for (Int32 i = 0; i < dt.Rows.Count; i++) { ReportInfo info = new ReportInfo(); ORMapping.DataRowToObject(dt.Rows[i], info); result.Add(info); } return result; }