コード例 #1
0
        private AuditCompRes compliance_close(AuditPostReq dataReq, AuditCompRes res, string conStr = null)
        {
            try
            {
                var updateCutMST = AuditManagerAdo.GetInstant().saveAUDITCUTDATEMST(dataReq, null, conStr);

                res._result._code    = "200";
                res._result._message = "";
                res._result._status  = "OK";
            }
            catch (Exception ex)
            {
                res._result._code    = "500 ";
                res._result._message = ex.Message;
                res._result._status  = "Internal Server Error";
            }
            return(res);
        }
コード例 #2
0
        private AuditDepRes getaudittoclear(AuditPostReq dataReq, AuditDepRes res, string conStr = null)
        {
            try
            {
                var lst = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTMSTTODEPAdo.GetInstant().getDataToClear(dataReq, null, null, conStr);
                res.AUDITPOSTMSTTODEPLST = lst;

                var lstPostTRN = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTTRNAdo.GetInstant().getPOSTTRNDep(dataReq, null, null, conStr);
                res.POSTTRNDuplicateLST = lstPostTRN;

                var summaryAudit = AuditManagerAdo.GetInstant().GetSummaryAudit(dataReq, null, conStr);
                res.AuditSummary = summaryAudit;

                var lstResult = AuditManagerAdo.GetInstant().GetSummaryResult(dataReq, null, conStr);
                res.SummaryResultLst = lstResult;
            }
            catch (SqlException ex)
            {
                res._result._code    = "500 ";
                res._result._message = ex.Message;
                res._result._status  = "Execute exception Error";
            }
            catch (InvalidOperationException ex)
            {
                res._result._code    = "500 ";
                res._result._message = ex.Message;
                res._result._status  = "Connection Exception Error";
            }
            catch (Exception ex)
            {
                res._result._code    = "500 ";
                res._result._message = ex.Message;
                res._result._status  = "Internal Server Error";
            }


            return(res);
        }
コード例 #3
0
        protected override void ExecuteChild(AuditResultReq dataReq, ResponseAPI dataRes)
        {
            var res = new AuditManagerRes();

            try
            {
                DBMode = dataReq.DBMode;
                res._result.ServerAddr = ConnectionString();
                res._result.DBMode     = DBMode;
                List <AuditManager> auditLst = new List <AuditManager>();

                var mode = String.IsNullOrEmpty(dataReq.MODE) ? dataReq.MODE : dataReq.MODE.ToLower();

                switch (mode)
                {
                case "mgr1":
                    auditLst = AuditManagerAdo.GetInstant().GetData2MGR1(dataReq, null, conString);
                    break;

                case "mgr2":
                    auditLst = AuditManagerAdo.GetInstant().GetData2MGR2(dataReq, null, conString);
                    break;

                default:
                    auditLst = AuditManagerAdo.GetInstant().GetData2Send(dataReq, null, conString);
                    break;
                }

                res.AuditManagerLst = auditLst;

                if (auditLst == null)
                {
                    res._result._code    = "404";
                    res._result._message = "ไม่พบข้อมูล";
                    res._result._status  = "Bad Request";
                }
                else
                {
                    res._result._code    = "200";
                    res._result._message = "";
                    res._result._status  = "OK";
                }
            }
            catch (SqlException ex)
            {
                res._result._code    = "500 ";
                res._result._message = ex.Message;
                res._result._status  = "Execute exception Error";
            }
            catch (InvalidOperationException ex)
            {
                res._result._code    = "500 ";
                res._result._message = ex.Message;
                res._result._status  = "Connection Exception Error";
            }
            catch (Exception ex)
            {
                res._result._code    = "500 ";
                res._result._message = ex.Message;
                res._result._status  = "Internal Server Error";
            }


            dataRes.data = res;
        }