Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String GetDelayReceivingMsp(string day = "")
- {
- try
- {
- string sqlday = " and 1=1";
- if (!string.IsNullOrEmpty(sqlday))
- {
- if (day == "one")
- {
- sqlday = "and DATEDIFF(DAY, eta, convert(date,getdate())) = 3";
- }
- else if (day == "mid")
- {
- sqlday = "and DATEDIFF(DAY, eta, convert(date,getdate())) BETWEEN 4 AND 5";
- }
- else if (day == "more")
- {
- sqlday = "and DATEDIFF(DAY, eta, convert(date,getdate())) > 6";
- }
- }
- string sql = @"
- SELECT count(*) AS delay_receiving_msp FROM (
- SELECT container_no FROM SsDelayReceiving WITH (NOLOCK)
- WHERE source like 'MSP%' " + sqlday +
- " GROUP BY container_no) AS tbl";
- DataTable result = mSharedHelper.SqlToDataTable(sql);
- return result != null ? result.Rows[0]["delay_receiving_msp"].ToString() : "0";
- }
- catch (Exception ex)
- {
- throw new AMNDaoException(base.ErrorMethodInfo(System.Reflection.MethodBase.GetCurrentMethod()) + " " + ex.Message, ex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement