private void RefreshGrid() { grdGarsonHareketRaporu.SQLText = "SELECT " + "CASE HAR.GARSON_RECID " + " WHEN - 1 THEN 'Kasa' " + " ELSE(SELECT GARSON_ADI FROM TBLBLUEGARSON GARSON WHERE GARSON.REC_ID = HAR.GARSON_RECID) " + " END AS GARSON_ADI " + ", STOK.STOK_ADI " + ", MIKTAR, HAR.CREATE_DATE AS TARIH " + ", MASA.MASA_TANIMI AS MASA_ADI " + "FROM[TBLBLUEGARSONHAR] HAR, TBLSTOK STOK, TBLBLUEADISYON AD, TBLBLUEMASA MASA " + "WHERE /*WS*/HAR.STOK_KODU = STOK.STOK_KODU "; if (GARSON_KODU.IsNotEmpty()) { grdGarsonHareketRaporu.SQLText += "AND HAR.GARSON_RECID = (SELECT REC_ID FROM TBLBLUEGARSON WHERE GARSON_KODU = '" + GARSON_KODU.GetDataStr() + "')"; } grdGarsonHareketRaporu.SQLText += "AND HAR.CREATE_DATE >= '" + BAS_TAR.GetSQLDataStr() + " 00:00:00' AND HAR.CREATE_DATE <= '" + BIT_TAR.GetSQLDataStr() + " 23:59:59' " + "AND HAR.ADISYON_RECID = AD.REC_ID " + "AND AD.MASA_RECID = MASA.REC_ID " + "AND (SELECT COUNT(*) FROM TBLBLUEADISYONHAR ADHAR WHERE ADHAR.ADISYON_RECID = AD.REC_ID) > 0 /*WE*/" + "ORDER BY HAR.CREATE_DATE, HAR.GARSON_RECID, STOK.STOK_ADI "; grdGarsonHareketRaporu.Open(); dsRapor = grdGarsonHareketRaporu.gridDataSet; }
private void GARSON_KODU_KeyDown(object sender, KeyEventArgs e) { if (e.Modifiers == Keys.Control && e.KeyCode == Keys.F1) { if (GARSON_KODU.IsNotEmpty()) { ArsSQLQry qryGarson = new ArsSQLQry(); qryGarson.SQLText = "SELECT TOP 1 MASA_TANIMI FROM [TBLBLUEGARSON] WHERE /*WS*/GARSON_KODU LIKE '" + GARSON_KODU.GetDataStr() + "%'/*WE*/ ORDER BY REC_ID DESC"; qryGarson.Open(); if (qryGarson.Found()) { GARSON_KODU.SetDataStr(qryGarson.GetString("GARSON_KODU")); } } } }
private void RefreshGrid() { grdGarsonHareketRaporu.SQLText = "SELECT " + "CASE HAR.GARSON_RECID " + " WHEN - 1 THEN 'Kasa' " + " ELSE(SELECT GARSON_ADI FROM TBLBLUEGARSON GARSON WHERE GARSON.REC_ID = HAR.GARSON_RECID) " + " END AS GARSON_ADI " + ", STOK.STOK_ADI " + ", SUM(HAR.MIKTAR) AS MIKTAR " + ", SUM(HAR.MIKTAR * STOK.SATIS_FIYAT) AS TUTAR " + "FROM[TBLBLUEGARSONHAR] HAR, TBLSTOK STOK " + "WHERE /*WS*/HAR.STOK_KODU = STOK.STOK_KODU "; if (GARSON_KODU.IsNotEmpty()) { grdGarsonHareketRaporu.SQLText += "AND HAR.GARSON_RECID = (SELECT REC_ID FROM TBLBLUEGARSON WHERE GARSON_KODU = '" + GARSON_KODU.GetDataStr() + "')"; } grdGarsonHareketRaporu.SQLText += "AND HAR.CREATE_DATE >= '" + BAS_TAR.GetSQLDataStr() + " 00:00:00' AND HAR.CREATE_DATE <= '" + BIT_TAR.GetSQLDataStr() + " 23:59:59'/*WE*/" + "GROUP BY HAR.GARSON_RECID, STOK.STOK_ADI " + "ORDER BY HAR.GARSON_RECID, STOK.STOK_ADI "; grdGarsonHareketRaporu.Open(); dsRapor = grdGarsonHareketRaporu.gridDataSet; }