database query : add with(nolock)

This commit is contained in:
chi
2024-01-30 10:05:52 +09:00
parent ed37fd6c40
commit 3c86087f76
53 changed files with 6656 additions and 6423 deletions

View File

@@ -12274,15 +12274,15 @@ namespace FEQ0000.dsPurchaseTableAdapters {
pumprice, pumamt, supply, supplyidx, project, projectidx, asset, edate, indate, po, dept, wuid, wdate, import, pumidx, isdel, bigo, manuproc, orderno, gcode, place, inqty, pumpriceD, inremark,
winuid, windate, chk1, chk2, costcenter, linecode, pumqtyReq, chkremark, purchase_manager, purchase_admin, currency, prdate, bigo_admin, bigo_manager, conf_status, conf_request,
conf_reponse
FROM Purchase
FROM Purchase WITH (NOLOCK)
WHERE (ISNULL(isdel, 0) = 0) AND (gcode = @gcode)
ORDER BY pdate DESC, idx DESC";
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[1].Connection = this.Connection;
this._commandCollection[1].CommandText = "SELECT COUNT(*) FROM Purchase\r\nWHERE (import = 1) AND (pdate BETWEEN @sd AND @ed" +
") AND (wuid = @userid) AND (gcode = @gcode)";
this._commandCollection[1].CommandText = "SELECT COUNT(*) AS Expr1\r\nFROM Purchase WITH (NOLOCK)\r\nWHERE (import = 1) A" +
"ND (pdate BETWEEN @sd AND @ed) AND (wuid = @userid) AND (gcode = @gcode)";
this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@sd", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ed", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -12303,26 +12303,43 @@ ORDER BY pdate DESC, idx DESC";
pumprice, pumamt, supply, supplyidx, project, projectidx, asset, edate, indate, po, dept, wuid, wdate, import, pumidx, isdel, bigo, manuproc, orderno, gcode, place, inqty, pumpriceD, inremark,
winuid, windate, chk1, chk2, costcenter, linecode, pumqtyReq, chkremark, purchase_manager, purchase_admin, currency, prdate, bigo_admin, bigo_manager, conf_status, conf_request,
conf_reponse
FROM Purchase
FROM Purchase WITH (NOLOCK)
WHERE (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (state = 'Approving') AND (conf_status = '1')
ORDER BY pdate DESC, idx DESC";
this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[4].Connection = this.Connection;
this._commandCollection[4].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel, linecode, manuproc, orderno, pdate, place, po, prdate, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit, purchase_admin, purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate, windate, winuid, wuid FROM Purchase WHERE (pdate BETWEEN @sd AND @ed) AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (ISNULL(orderno, '') = '') AND (state IN ('PO', 'Received')) ORDER BY pdate DESC, idx DESC";
this._commandCollection[4].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel,
linecode, manuproc, orderno, pdate, place, po, prdate, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit,
purchase_admin, purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate,
windate, winuid, wuid
FROM Purchase WITH (NOLOCK)
WHERE (pdate BETWEEN @sd AND @ed) AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (ISNULL(orderno, '') = '') AND (state IN ('PO', 'Received'))
ORDER BY pdate DESC, idx DESC";
this._commandCollection[4].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@sd", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ed", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[5].Connection = this.Connection;
this._commandCollection[5].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel, linecode, manuproc, orderno, pdate, place, po, prdate, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit, purchase_admin, purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate, windate, winuid, wuid FROM Purchase WHERE (idx = @idx)";
this._commandCollection[5].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel,
linecode, manuproc, orderno, pdate, place, po, prdate, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit,
purchase_admin, purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate,
windate, winuid, wuid
FROM Purchase WITH (NOLOCK)
WHERE (idx = @idx)";
this._commandCollection[5].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idx", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "idx", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[6].Connection = this.Connection;
this._commandCollection[6].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel, linecode, manuproc, orderno, pdate, place, po, prdate, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit, purchase_admin, purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate, windate, winuid, wuid FROM Purchase WHERE (pdate BETWEEN @sd AND @ed) AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) ORDER BY pdate DESC, idx DESC";
this._commandCollection[6].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel,
linecode, manuproc, orderno, pdate, place, po, prdate, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit,
purchase_admin, purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate,
windate, winuid, wuid
FROM Purchase WITH (NOLOCK)
WHERE (pdate BETWEEN @sd AND @ed) AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode)
ORDER BY pdate DESC, idx DESC";
this._commandCollection[6].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@sd", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ed", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -15123,15 +15140,16 @@ ORDER BY pdate DESC, idx DESC";
pumprice, pumamt, supply, supplyidx, project, projectidx, asset, edate, indate, po, dept, wuid, wdate, import, pumidx, isdel, bigo, manuproc, orderno, gcode, place, inqty, pumpriceD, inremark,
winuid, windate, chk1, chk2, costcenter, linecode, pumqtyReq, chkremark, purchase_manager, purchase_admin, currency, bigo_admin, bigo_manager, conf_status, conf_request,
conf_reponse
FROM EETGW_PurchaseCR
FROM EETGW_PurchaseCR WITH (NOLOCK)
WHERE (ISNULL(isdel, 0) = 0) AND (gcode = @gcode)
ORDER BY pdate DESC, idx DESC";
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[1].Connection = this.Connection;
this._commandCollection[1].CommandText = "SELECT COUNT(*) AS Expr1\r\nFROM EETGW_PurchaseCR\r\nWHERE (import = 1) AND (pd" +
"ate BETWEEN @sd AND @ed) AND (wuid = @userid) AND (gcode = @gcode)";
this._commandCollection[1].CommandText = "SELECT COUNT(*) AS Expr1\r\nFROM EETGW_PurchaseCR WITH (NOLOCK)\r\nWHERE (impor" +
"t = 1) AND (pdate BETWEEN @sd AND @ed) AND (wuid = @userid) AND (gcode = @gcode)" +
"";
this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@sd", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ed", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -15152,15 +15170,19 @@ ORDER BY pdate DESC, idx DESC";
pumprice, pumamt, supply, supplyidx, project, projectidx, asset, edate, indate, po, dept, wuid, wdate, import, pumidx, isdel, bigo, manuproc, orderno, gcode, place, inqty, pumpriceD, inremark,
winuid, windate, chk1, chk2, costcenter, linecode, pumqtyReq, chkremark, purchase_manager, purchase_admin, currency, bigo_admin, bigo_manager, conf_status, conf_request,
conf_reponse
FROM EETGW_PurchaseCR
WHERE (ISNULL(isdel, 0) = 0) AND (gcode = @gcode)
AND (state = 'Approving') AND (conf_status = '1')
FROM EETGW_PurchaseCR WITH (NOLOCK)
WHERE (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (state = 'Approving') AND (conf_status = '1')
ORDER BY pdate DESC, idx DESC";
this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[4].Connection = this.Connection;
this._commandCollection[4].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel, linecode, manuproc, orderno, pdate, place, po, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit, purchase_admin, purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate, windate, winuid, wuid FROM EETGW_PurchaseCR WHERE (idx = @idx)";
this._commandCollection[4].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel,
linecode, manuproc, orderno, pdate, place, po, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit, purchase_admin,
purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate, windate, winuid,
wuid
FROM EETGW_PurchaseCR WITH (NOLOCK)
WHERE (idx = @idx)";
this._commandCollection[4].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idx", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "idx", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand();
@@ -15169,7 +15191,7 @@ ORDER BY pdate DESC, idx DESC";
pumscale, pumunit, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate, wuid, inremark,
winuid, windate, chk1, chk2, pumqtyReq, chkremark, costcenter, linecode, purchase_manager, purchase_admin, currency, bigo_admin, bigo_manager, conf_status, conf_request,
conf_reponse
FROM EETGW_PurchaseCR
FROM EETGW_PurchaseCR WITH (NOLOCK)
WHERE (pdate BETWEEN @sd AND @ed) AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (state IN ('PO', 'Received'))
ORDER BY pdate DESC, idx DESC";
this._commandCollection[5].CommandType = global::System.Data.CommandType.Text;
@@ -17387,33 +17409,31 @@ ORDER BY pdate DESC, idx DESC";
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT \'NR\' AS source, idx, pdate, state, sid, pumname, pumscale, pumqty" +
", pumprice, pumamt, supply, project, bigo, wdate, dbo.getUserName(request) AS re" +
"quest, indate, inqty, \r\n dbo.getUserName(receive) AS receiv" +
"e, sc, po, orderno, (CASE [state] WHEN \'PO\' THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) " +
"AS sortkey, purchase_manager, purchase_admin, \r\n place\r\nFRO" +
"M Purchase\r\nWHERE (state IN (\'PO\', \'PR\', \'Approving\')) AND " +
"(pdate >= @pdate) AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (ISNULL(pu" +
"rchase_manager, \'\') \r\n LIKE @search_manager) AND (ISNULL(pu" +
"rchase_admin, \'\') LIKE @search_admin)\r\nUNION\r\nSELECT \'CR\' AS Expr1, idx" +
", pdate, state, sid, pumname, pumscale, pumqty, pumprice, pumamt, supply, projec" +
"t, bigo, wdate, dbo.getUserName(request) AS request, indate, inqty, \r\n " +
" dbo.getUserName(receive) AS receive, sc, po, orderno, (CASE [state] " +
"WHEN \'PO\' THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) AS sortkey, purchase_manager, purc" +
"hase_admin, \r\n place\r\nFROM EETGW_PurchaseCR\r\nWHE" +
"RE (state IN (\'PO\', \'PR\', \'Approving\')) AND (pdate >= @pdate) AND (ISN" +
"ULL(isdel, 0) = 0) AND (gcode = @gcode) AND (ISNULL(purchase_manager, \'\') \r\n " +
" LIKE @search_manager) AND (ISNULL(purchase_admin, \'\') LIKE @se" +
"arch_admin)\r\nUNION\r\nSELECT \'EB\' AS Expr1, idx, pdate, state, sid, pumna" +
"me, pumscale, pumqty, pumprice, pumamt, supply, project, bigo, wdate, dbo.getUse" +
"rName(request) AS request, indate, inqty, \r\n dbo.getUserNam" +
"e(receive) AS receive, sc, po, orderno, (CASE [state] WHEN \'PO\' THEN 1 WHEN \'PR\'" +
" THEN 2 ELSE 3 END) AS sortkey, purchase_manager, purchase_admin, \r\n " +
" place\r\nFROM EETGW_PurchaseEB\r\nWHERE (state IN (\'P" +
"O\', \'PR\', \'Approving\')) AND (pdate >= @pdate) AND (ISNULL(isdel, 0) = 0) AND (gc" +
"ode = @gcode) AND (ISNULL(purchase_manager, \'\') \r\n LIKE @se" +
"arch_manager) AND (ISNULL(purchase_admin, \'\') LIKE @search_admin)\r\nORDER BY " +
"sortkey, wdate DESC";
this._commandCollection[0].CommandText = "SELECT \'NR\' AS source, idx, pdate, state, sid, pumname, pumscale, pumqty, pumpri" +
"ce, pumamt, supply, project, bigo, wdate, dbo.getUserName(request) AS request, i" +
"ndate, inqty, \r\n dbo.getUserName(receive) AS receive, sc, po, orde" +
"rno, (CASE [state] WHEN \'PO\' THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) AS sortkey, pur" +
"chase_manager, purchase_admin, place\r\nFROM Purchase WITH (NOLOCK)\r\nWHERE (s" +
"tate IN (\'PO\', \'PR\', \'Approving\')) AND (pdate >= @pdate) AND (ISNULL(isdel, 0) =" +
" 0) AND (gcode = @gcode) AND (ISNULL(purchase_manager, \'\') LIKE @search_manager)" +
" AND \r\n (ISNULL(purchase_admin, \'\') LIKE @search_admin)\r\nUNION\r\nSE" +
"LECT \'CR\' AS Expr1, idx, pdate, state, sid, pumname, pumscale, pumqty, pumprice" +
", pumamt, supply, project, bigo, wdate, dbo.getUserName(request) AS request, ind" +
"ate, inqty, \r\n dbo.getUserName(receive) AS receive, sc, po, ordern" +
"o, (CASE [state] WHEN \'PO\' THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) AS sortkey, purch" +
"ase_manager, purchase_admin, place\r\nFROM EETGW_PurchaseCR WITH (NOLOCK)\r\nWHE" +
"RE (state IN (\'PO\', \'PR\', \'Approving\')) AND (pdate >= @pdate) AND (ISNULL(isdel" +
", 0) = 0) AND (gcode = @gcode) AND (ISNULL(purchase_manager, \'\') LIKE @search_ma" +
"nager) AND \r\n (ISNULL(purchase_admin, \'\') LIKE @search_admin)\r\nUNI" +
"ON\r\nSELECT \'EB\' AS Expr1, idx, pdate, state, sid, pumname, pumscale, pumqty, pu" +
"mprice, pumamt, supply, project, bigo, wdate, dbo.getUserName(request) AS reques" +
"t, indate, inqty, \r\n dbo.getUserName(receive) AS receive, sc, po, " +
"orderno, (CASE [state] WHEN \'PO\' THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) AS sortkey," +
" purchase_manager, purchase_admin, place\r\nFROM EETGW_PurchaseEB WITH (NOLOCK" +
")\r\nWHERE (state IN (\'PO\', \'PR\', \'Approving\')) AND (pdate >= @pdate) AND (ISNULL" +
"(isdel, 0) = 0) AND (gcode = @gcode) AND (ISNULL(purchase_manager, \'\') LIKE @sea" +
"rch_manager) AND \r\n (ISNULL(purchase_admin, \'\') LIKE @search_admin" +
")\r\nORDER BY sortkey, wdate DESC";
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pdate", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -17421,32 +17441,30 @@ ORDER BY pdate DESC, idx DESC";
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@search_admin", global::System.Data.SqlDbType.VarChar, 1024, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[1].Connection = this.Connection;
this._commandCollection[1].CommandText = "SELECT \'NR\' AS source, idx, pdate, state, sid, pumname, pumscale, pumqty" +
", pumprice, pumamt, supply, project, bigo, wdate, dbo.getUserName(request) AS re" +
"quest, indate, inqty, \r\n dbo.getUserName(receive) AS receiv" +
"e, sc, po, orderno, (CASE [state] WHEN \'PO\' THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) " +
"AS sortkey, purchase_manager, purchase_admin, \r\n place\r\nFRO" +
"M Purchase\r\nWHERE (state = \'Received\') AND (indate = @pdate" +
") AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (ISNULL(purchase_manager, " +
"\'\') LIKE @search_manager) AND \r\n (ISNULL(purchase_admin, \'\'" +
") LIKE @search_admin)\r\nUNION\r\nSELECT \'CR\' AS Expr1, idx, pdate, state, " +
"sid, pumname, pumscale, pumqty, pumprice, pumamt, supply, project, bigo, wdate, " +
"dbo.getUserName(request) AS request, indate, inqty, \r\n dbo." +
"getUserName(receive) AS receive, sc, po, orderno, (CASE [state] WHEN \'PO\' THEN 1" +
" WHEN \'PR\' THEN 2 ELSE 3 END) AS sortkey, purchase_manager, purchase_admin, \r\n " +
" place\r\nFROM EETGW_PurchaseCR\r\nWHERE (st" +
"ate = \'Received\') AND (indate = @pdate) AND (ISNULL(isdel, 0) = 0) AND (gcode = " +
"@gcode) AND (ISNULL(purchase_manager, \'\') LIKE @search_manager) AND \r\n " +
" (ISNULL(purchase_admin, \'\') LIKE @search_admin)\r\nUNION\r\nSELECT " +
" \'CR\' AS Expr1, idx, pdate, state, sid, pumname, pumscale, pumqty, pumprice, " +
"pumamt, supply, project, bigo, wdate, dbo.getUserName(request) AS request, indat" +
"e, inqty, \r\n dbo.getUserName(receive) AS receive, sc, po, o" +
"rderno, (CASE [state] WHEN \'PO\' THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) AS sortkey, " +
"purchase_manager, purchase_admin, \r\n place\r\nFROM " +
" EETGW_PurchaseEB\r\nWHERE (state = \'Received\') AND (indate = @pdate) AN" +
"D (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (ISNULL(purchase_manager, \'\') " +
"LIKE @search_manager) AND \r\n (ISNULL(purchase_admin, \'\') LI" +
"KE @search_admin)\r\nORDER BY source DESC, request, wdate DESC";
this._commandCollection[1].CommandText = "SELECT \'NR\' AS source, idx, pdate, state, sid, pumname, pumscale, pumqty, pumpri" +
"ce, pumamt, supply, project, bigo, wdate, dbo.getUserName(request) AS request, i" +
"ndate, inqty, \r\n dbo.getUserName(receive) AS receive, sc, po, orde" +
"rno, (CASE [state] WHEN \'PO\' THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) AS sortkey, pur" +
"chase_manager, purchase_admin, place\r\nFROM Purchase WITH (NOLOCK)\r\nWHERE (s" +
"tate = \'Received\') AND (indate = @pdate) AND (ISNULL(isdel, 0) = 0) AND (gcode =" +
" @gcode) AND (ISNULL(purchase_manager, \'\') LIKE @search_manager) AND (ISNULL(pur" +
"chase_admin, \'\') \r\n LIKE @search_admin)\r\nUNION\r\nSELECT \'CR\' AS Ex" +
"pr1, idx, pdate, state, sid, pumname, pumscale, pumqty, pumprice, pumamt, supply" +
", project, bigo, wdate, dbo.getUserName(request) AS request, indate, inqty, \r\n " +
" dbo.getUserName(receive) AS receive, sc, po, orderno, (CASE [state]" +
" WHEN \'PO\' THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) AS sortkey, purchase_manager, pur" +
"chase_admin, place\r\nFROM EETGW_PurchaseCR WITH (NOLOCK)\r\nWHERE (state = \'Re" +
"ceived\') AND (indate = @pdate) AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) A" +
"ND (ISNULL(purchase_manager, \'\') LIKE @search_manager) AND (ISNULL(purchase_admi" +
"n, \'\') \r\n LIKE @search_admin)\r\nUNION\r\nSELECT \'CR\' AS Expr1, idx, " +
"pdate, state, sid, pumname, pumscale, pumqty, pumprice, pumamt, supply, project," +
" bigo, wdate, dbo.getUserName(request) AS request, indate, inqty, \r\n " +
" dbo.getUserName(receive) AS receive, sc, po, orderno, (CASE [state] WHEN \'PO\'" +
" THEN 1 WHEN \'PR\' THEN 2 ELSE 3 END) AS sortkey, purchase_manager, purchase_admi" +
"n, place\r\nFROM EETGW_PurchaseEB WITH (NOLOCK)\r\nWHERE (state = \'Received\') A" +
"ND (indate = @pdate) AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (ISNULL" +
"(purchase_manager, \'\') LIKE @search_manager) AND (ISNULL(purchase_admin, \'\') \r\n " +
" LIKE @search_admin)\r\nORDER BY source DESC, request, wdate DESC";
this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pdate", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "indate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -18495,19 +18513,20 @@ GROUP BY purchase_admin";
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[6];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = @"SELECT idx, pdate, state, process, receive, dbo.getUserName(receive) AS receiveName, sc, request, dbo.getUserName(request) AS requestName, sid, pumname, pumscale,
pumunit, pumqty, pumprice, pumamt, supply, supplyidx, project, projectidx, asset, edate, indate, po, dept, wuid, wdate, import, pumidx, isdel, bigo, manuproc, orderno, gcode,
place, inqty, pumpriceD, inremark, winuid, windate, chk1, chk2, costcenter, linecode, pumqtyReq, chkremark, purchase_manager, purchase_admin, currency, conf_status,
conf_request, conf_reponse, bigo_admin, bigo_manager, site
FROM EETGW_PurchaseEB
WHERE (ISNULL(isdel, 0) = 0) AND (gcode = @gcode)
ORDER BY pdate DESC, idx DESC";
this._commandCollection[0].CommandText = @"SELECT idx, pdate, state, process, receive, dbo.getUserName(receive) AS receiveName, sc, request, dbo.getUserName(request) AS requestName, sid, pumname, pumscale, pumunit, pumqty,
pumprice, pumamt, supply, supplyidx, project, projectidx, asset, edate, indate, po, dept, wuid, wdate, import, pumidx, isdel, bigo, manuproc, orderno, gcode, place, inqty, pumpriceD, inremark,
winuid, windate, chk1, chk2, costcenter, linecode, pumqtyReq, chkremark, purchase_manager, purchase_admin, currency, conf_status, conf_request, conf_reponse, bigo_admin,
bigo_manager, site
FROM EETGW_PurchaseEB WITH (NOLOCK)
WHERE (ISNULL(isdel, 0) = 0) AND (gcode = @gcode)
ORDER BY pdate DESC, idx DESC";
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[0].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[1].Connection = this.Connection;
this._commandCollection[1].CommandText = "SELECT COUNT(*) AS Expr1\r\nFROM EETGW_PurchaseEB\r\nWHERE (import = 1) AND (pd" +
"ate BETWEEN @sd AND @ed) AND (wuid = @userid) AND (gcode = @gcode)";
this._commandCollection[1].CommandText = "SELECT COUNT(*) AS Expr1\r\nFROM EETGW_PurchaseEB WITH (NOLOCK)\r\nWHERE (impor" +
"t = 1) AND (pdate BETWEEN @sd AND @ed) AND (wuid = @userid) AND (gcode = @gcode)" +
"";
this._commandCollection[1].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@sd", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ed", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "pdate", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -18524,7 +18543,13 @@ ORDER BY pdate DESC, idx DESC";
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Original, false, null, "", "", ""));
this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[3].Connection = this.Connection;
this._commandCollection[3].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel, linecode, manuproc, orderno, pdate, place, po, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit, purchase_admin, purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, site, state, supply, supplyidx, wdate, windate, winuid, wuid FROM EETGW_PurchaseEB WHERE (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (state = 'Approving') AND (conf_status = '1') ORDER BY pdate DESC, idx DESC";
this._commandCollection[3].CommandText = @"SELECT asset, bigo, bigo_admin, bigo_manager, chk1, chk2, chkremark, conf_reponse, conf_request, conf_status, costcenter, currency, dept, edate, gcode, idx, import, indate, inqty, inremark, isdel,
linecode, manuproc, orderno, pdate, place, po, process, project, projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit, purchase_admin,
purchase_manager, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, site, state, supply, supplyidx, wdate, windate, winuid,
wuid
FROM EETGW_PurchaseEB WITH (NOLOCK)
WHERE (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (state = 'Approving') AND (conf_status = '1')
ORDER BY pdate DESC, idx DESC";
this._commandCollection[3].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@gcode", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, "gcode", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
@@ -18533,7 +18558,7 @@ ORDER BY pdate DESC, idx DESC";
projectidx, pumamt, pumidx, pumname, pumprice, pumpriceD, pumqty, pumqtyReq, pumscale, pumunit, purchase_admin, purchase_manager, receive, dbo.getUserName(receive)
AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate, windate, winuid, wuid, bigo_admin, bigo_manager, conf_status, conf_request,
conf_reponse
FROM EETGW_PurchaseEB
FROM EETGW_PurchaseEB WITH (NOLOCK)
WHERE (idx = @idx)";
this._commandCollection[4].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idx", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "idx", global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
@@ -18543,7 +18568,7 @@ WHERE (idx = @idx)";
pumscale, pumunit, receive, dbo.getUserName(receive) AS receiveName, request, dbo.getUserName(request) AS requestName, sc, sid, state, supply, supplyidx, wdate, wuid, inremark,
winuid, windate, chk1, chk2, pumqtyReq, chkremark, costcenter, linecode, purchase_manager, purchase_admin, currency, bigo_admin, bigo_manager, conf_status, conf_request,
conf_reponse
FROM EETGW_PurchaseEB
FROM EETGW_PurchaseEB WITH (NOLOCK)
WHERE (pdate BETWEEN @sd AND @ed) AND (ISNULL(isdel, 0) = 0) AND (gcode = @gcode) AND (state IN ('PO', 'Received'))
ORDER BY pdate DESC, idx DESC";
this._commandCollection[5].CommandType = global::System.Data.CommandType.Text;