private void doZpurgeTask(int shopID, string taskID, string fdrID, string iasutdID, string imsi, string rzptID) { // Обработва Zpurge-задача MySqlConn conn = new MySqlConn(TaxTerminalConnectionString); DataTable dt = null; try { dt = conn.ExecSProcDS("procGetZreports2send", shopID).Tables[0]; } catch { addLogData(eventType.AppError, "exeption", "procGetZreports2send", -1, ""); } if (dt.Rows.Count < 1) return; string logStr = "", xmlStr = ""; if (fill_z_data(1, taskID, fdrID, iasutdID, imsi, rzptID, dt, out logStr, out xmlStr) == false) { addLogData(eventType.AppError, "error", "fill_z_data", -2, ""); return; } addLogData(eventType.Zpurge, iasutdID, logStr, 0, "OK"); }
private void doTestTask(long recNo) { // Обработва тестовата задача (200) MySqlConn conn = new MySqlConn(TaxTerminalConnectionString); try { conn.ExecSProc("procDelOneTask", recNo); addLogData(eventType.Test, "Info", "Програмата работи нормално", -1, ""); } catch { addLogData(eventType.AppError, "exeption", "procDelOneTask", -1, ""); } }
public SProcList(MySqlConn db) { _db = db; }
private void processTasks() { // Обработка на съобщенията от/към НАП MySqlConn conn = new MySqlConn(TaxTerminalConnectionString); DataTable dt = null; long loopCounter = 0L; DateTime startDT, endDT; TimeSpan interval; while (checkBoxClose.Checked == false) { startDT = DateTime.Now; try { dt = conn.ExecSProcDS("procGetActualTasks").Tables[0]; } catch { addLogData(eventType.AppError, "exeption", "procGetActualTasks", -1, ""); continue; } foreach(DataRow r in dt.Rows) { int taskType = Convert.ToInt32(r["TaskType"].ToString()); int shopID = Convert.ToInt32(r["shopID"].ToString()); long recNo = Convert.ToInt64(r["RecNo"].ToString()); string taskID = r["TaskID"].ToString(); string iasutdID = r["FDIN"].ToString(); string fdrID = r["FDRID"].ToString(); string imsi = r["IMSI"].ToString(); string msisdn = r["MSISDN"].ToString(); switch (taskType) { case 1: // Стандартна Z-задача doZstdTask(shopID, taskID, fdrID, iasutdID, imsi, taskID); break; case 3: // Z-Purge задача doZpurgeTask(shopID, taskID, fdrID, iasutdID, imsi, taskID); break; case 4: // X-отчет break; case 5: // Z-задача при дерегистрация doZunregTask(shopID, taskID, fdrID, iasutdID, imsi, taskID); break; case 100: // Повторно изпращане на файл break; case 200: // Проверка, дали програмата работи doTestTask(recNo); break; } } loopCounter++; if (loopCounter == Int64.MaxValue) loopCounter = 0L; labelLoopCounter.Text = loopCounter.ToString(); do { Application.DoEvents(); endDT = DateTime.Now; interval = endDT - startDT; } while (interval.Seconds < 5); } }