public TaskCodeNameData[] SelectTaskCodeNameFromOsWkReport(string pCode, DateTime dateFr) { DateTime dateTo = DHandling.EndOfMonth(dateFr); string selParam = "DISTINCT WR.TaskCode AS TaskCode, TI.TaskName AS TaskName, TI.LeaderMCode AS LeaderMCode FROM " + "D_TaskInd TI INNER JOIN D_OsWkReport WR ON TI.TaskCode = WR.TaskCode " + "WHERE (WR.ReportDate BETWEEN '" + dateFr + "' AND '" + dateTo + "') AND WR.PartnerCode = '" + pCode + "' ORDER BY WR.TaskCode"; SqlHandling sh = new SqlHandling(); DataTable dt = sh.SelectFullDescription(selParam); if (dt == null || dt.Rows.Count < 1) { return(null); } TaskCodeNameData[] tcd = new TaskCodeNameData[dt.Rows.Count]; DataRow dr; for (int i = 0; i < dt.Rows.Count; i++) { dr = dt.Rows[i]; tcd[i] = new TaskCodeNameData(); tcd[i].TaskCode = Convert.ToString(dr["TaskCode"]); tcd[i].TaskName = Convert.ToString(dr["TaskName"]); tcd[i].LeaderMCode = Convert.ToString(dr["LeaderMCode"]); } return(tcd); }
public DataTable SelectOsWkReportPartnerCode(DateTime dateFr, string officeCode, string department) { DateTime dateTo = DHandling.EndOfMonth(dateFr); SqlHandling sh = new SqlHandling(); DataTable dt = sh.SelectFull_Core("DISTINCT PartnerCode FROM D_OsWkReport WHERE OfficeCode = '" + officeCode + "' AND Department = '" + department + "' AND ( ReportDate BETWEEN '" + dateFr + "' AND '" + dateTo + "') ORDER BY PartnerCode"); if (dt == null || dt.Rows.Count < 1) { return(null); } return(dt); }