private string DailyLoginLogout(string CounterName, string fromdate, string todate, string userid) { report_Prop reportProp = new report_Prop(); reportProp.CounterName = CounterName; reportProp.fromdate = fromdate; reportProp.todate = todate; reportProp.UserId = userid; report_bal reportbal = new report_bal(); DataTable dt = reportbal.DailyLoginLogout(reportProp); StringBuilder sb = new StringBuilder(); if (reportbal.ErrMessage != "" && reportbal.ErrMessage != null) { return("0#" + reportbal.ErrMessage + "$"); } else { sb.Append("<tr>"); sb.Append("<th colspan=5>" + "Daily Login Logout Report" + "</th>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<th>" + "Sr No" + "</th>"); sb.Append("<th>" + "COUNTERNAME" + "</th>"); sb.Append("<th>" + "USERNAME" + "</th>"); sb.Append("<th>" + "LOGINDATE" + "</th>"); sb.Append("<th>" + "LOGOUTDATE" + "</th>"); sb.Append("</tr>"); if (dt.Rows.Count > 0) { sb.Append("$"); for (int i = 0; i < dt.Rows.Count; i++) { sb.Append("<tr>"); sb.Append("<td>" + dt.Rows[i]["SrNo"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["COUNTERNAME"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["USERNAME"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["LOGINDATE"].ToString() + "</td>"); sb.Append("<td>" + dt.Rows[i]["LOGOUTDATE"].ToString() + "</td>"); sb.Append("</tr>"); } } else { sb.Append("<tr><td>No Record Found</td><td></td><td></td><td></td><td></td></tr>"); } //sb.Append("<tr><td colspan='13'>No Record Found</td></tr>"); } return(sb.ToString()); }
private DataTable DailyLoginLogout(string CounterName, string fromdate, string todate, string userid) { report_Prop reportProp = new report_Prop(); reportProp.CounterName = CounterName; reportProp.fromdate = fromdate; reportProp.todate = todate; reportProp.UserId = userid; report_bal reportbal = new report_bal(); DataTable dt = reportbal.DailyLoginLogout(reportProp); return(dt); }