public CDTData GetDataForDetailReport(string linkfield, string linkitem) { string s = "select * from sysReport where sysReportParentID = " + _drTable["SysReportID"].ToString(); DataTable dt = _dbStruct.GetDataTable(s); if (dt == null || dt.Rows.Count == 0) { return(null); } CDTData data = CusData.Create(DataType.Report, dt.Rows[0]); data.GetData(); //Chuyển data cha qua data con DataRow dr = data.DsData.Tables[0].NewRow(); foreach (DataColumn dc in DsData.Tables[0].Columns) { if (data.DsData.Tables[0].Columns[dc.ColumnName] == null) { continue; } dr[dc.ColumnName] = DsData.Tables[0].Rows[0][dc.ColumnName]; } if (!(data.DsData.Tables[0].Columns[linkfield] == null)) { dr[linkfield] = linkitem.Trim(); } data.DsData.Tables[0].Rows.Add(dr); //this.GenFilterString(); return(data); }
public CDTData GetFormForReport() { string sysReportID = _drTable["sysReportID"].ToString(); string sysPackageID = Config.GetValue("sysPackageID").ToString(); DataTable dtTable = _dbStruct.GetDataTable("select * from sysTable where TableName = 'sysFormReport' and sysPackageID = " + sysPackageID); CDTData data = CusData.Create(DataType.Single, dtTable.Rows[0]); data.Condition = "sysReportID = " + sysReportID; return(data); }
public CDTData GetDataForVoucher(string maCT, string linkItem) { string sysReportID = _drTable["sysReportID"].ToString(); string sysPackageID = Config.GetValue("sysPackageID").ToString(); string s = "select * from sysTable where MaCT = '" + maCT + "' and sysPackageID = " + sysPackageID; DataTable dt = _dbStruct.GetDataTable(s); if (dt == null || dt.Rows.Count == 0) { return(null); } CDTData data = CusData.Create(DataType.MasterDetail, dt.Rows[0]); data.ConditionMaster = data.DrTableMaster["Pk"].ToString() + " = '" + linkItem + "'"; data.GetData(); return(data); }