Пример #1
0
        public void InsertTransactionLog(TransactionLog tranLog)
        {
            SpCall call = new SpCall("COR.TRANSACTION_LOG_INSERT");

            call.SetVarchar("@TRAN_CODE", tranLog.TransactionCode);
            call.SetBinary("@TRANSACTION_LOG", tranLog.Log);
            call.SetVarchar("@TRANSACTION_JSON", tranLog.LogJson);
            call.SetVarchar("@TRANSACTION_STATUS", tranLog.Status);
            call.SetBigInt("@TRANSACTION_OBJECT_ID", tranLog.LogObjectId);
            call.SetVarchar("@ACTION_TYPE", tranLog.ActionType);
            call.SetVarchar("@REQUEST_TYPE", tranLog.RequestType);
            call.SetDateTime("@CREATE_DATE", DateTime.Now);
            call.SetVarchar("@CREATE_USER", tranLog.CreatedUser);
            call.SetDecimal("@DURATION", tranLog.Duration);
            long id = db.ExecuteScalar <long>(call);

            tranLog.Id = id;
        }
        protected override void New()
        {
            MaestroReportDefinition rdef = (MaestroReportDefinition)request.TransactionEntityList[0];

            SpCall call = new SpCall("RPT.REPORT_DEFINITION_INSERT");

            call.SetVarchar("@REPORT_CODE", rdef.ReportCode);
            call.SetVarchar("@REPORT_DESCRIPTION", rdef.Description);
            call.SetBinary("@TEMPLATE", rdef.Template);
            call.SetVarchar("@META_DEFINITION", rdef.MetaDefinition);
            call.SetVarchar("@REPORT_FILE_NAME", rdef.FileName);
            call.SetVarchar("@REPORT_PROCEDURE_NAME", rdef.ProcedureName);
            call.SetVarchar("@REPORT_TYPE", rdef.ReportType);
            call.SetVarchar("@CODE_BASE", rdef.CodeBase);

            call.SetDateTime("@CREATE_DATE", DateTime.Now);
            call.SetVarchar("@CREATE_USER", Context.UserName);

            call.SetVarchar("@TRAN_CODE", rdef.TransactionCode);

            rdef.Id = db.ExecuteScalar <long>(call);

            response.TransactionResult = rdef;
        }
        protected override void Update()
        {
            MaestroReportDefinition rdef = (MaestroReportDefinition)request.TransactionEntityList[0];

            SpCall call = new SpCall("RPT.REPORT_DEFINITION_UPDATE");

            call.SetBigInt("@ID", rdef.Id);
            call.SetVarchar("@REPORT_CODE", rdef.ReportCode);
            call.SetVarchar("@REPORT_DESCRIPTION", rdef.Description);
            call.SetBinary("@TEMPLATE", rdef.Template);
            call.SetVarchar("@META_DEFINITION", rdef.MetaDefinition);
            call.SetVarchar("@REPORT_FILE_NAME", rdef.FileName);
            call.SetVarchar("@REPORT_PROCEDURE_NAME", rdef.ProcedureName);
            call.SetVarchar("@REPORT_TYPE", rdef.ReportType);
            call.SetVarchar("@CODE_BASE", rdef.CodeBase);

            call.SetDateTime("@UPDATE_DATE", DateTime.Now);
            call.SetVarchar("@UPDATE_USER", Context.UserName);
            call.SetVarchar("@TRAN_CODE", rdef.TransactionCode);

            db.ExecuteNonQuery(call);
            Context.TransactionObject = rdef;
            ReportDefinitionCache.Instance.Reload(true);
        }