private void _doOnRunEventXls(RmtThreadHandler sender, out IRemoteProcInst instance) { var rptCfg = CXLReportConfig.LoadFromFile( null, this.bioCode, Utl.NormalizeDir(this.BioSession.Cfg.IniPath) + "rpts\\", Utl.NormalizeDir(this.BioSession.Cfg.WorkspacePath) + "rpts\\", this.BioSession.Cfg.dbSession, this.BioSession.CurSessionID, this.BioSession.Cfg.CurUser.Login, this.BioSession.CurSessionRemoteIP, this.bioParams, !this.BioSession.Cfg.Debug ); instance = new CXLReport(null, rptCfg, this.Context); var v_action = String.Format("Запуск отчета \"{1}\". Параметры запуска: {0}", this.bioParams.ToString(), ((CXLReport)instance).RptDefinition.Title); SQLCmd.ExecuteScript( this.BioSession.Cfg.dbSession, "begin givcadmin.utils.reg_usr_activity (" + " :p_usr_id," + " :p_iobj_cd," + " :p_iobj_uid," + " :p_action); end;", new Params( new Param("p_usr_id", this.BioSession.Cfg.CurUser.UID), new Param("p_iobj_cd", "XLR-BUILDER"), new Param("p_iobj_uid", this.bioCode), new Param("p_action", v_action) ), 60 ); }
private void _doOnRunEvent(RmtThreadHandler sender, out IRemoteProcInst instance) { var rqst = this.BioRequest<DSFetchClientRequest>(); var cursorDS = this.FBioDesc.DocumentElement; var execIo = CIObject.CreateIObject(rqst.ExecBioCode, this.BioSession); var execDS = execIo.IniDocument.XmlDoc.DocumentElement; instance = new CDSFetchProc( this.BioSession.Cfg.dbSession, null, rqst, cursorDS, execDS); }
private void _doOnRunEventCsv(RmtThreadHandler sender, out IRemoteProcInst instance) { var ds = this.FBioDesc.DocumentElement; var conn = this.BioSession.Cfg.dbSession.GetConnection(); var addHeaderStr = this.getQParamValue("addheader", false); var addHeader = !String.IsNullOrEmpty(addHeaderStr) && addHeaderStr.Equals("true"); instance = new CCSVReport( this.bioCode, this.Context, ds, this.bioParams, conn, this.BioSession.Cfg.RptLogsPath, addHeader); }
private void _doOnRunEventXls(RmtThreadHandler sender, out IRemoteProcInst instance) { var title = this.BioRequest<RmtClientRequest>().title; title = title != null ? title.Replace("<br>", "\n") : ""; var io = this.BioSession.IObj_get(this.bioCode); if (io == null) throw new Exception(String.Format("Bio {0} не найден!", this.bioCode)); var defaultTmpl = this.BioSession.Cfg.IniPath + "iod\\bio2xl_default.xlsm"; var customTmpl = io.ioTemplate2XL; if ((!File.Exists(defaultTmpl)) && (String.IsNullOrEmpty(customTmpl))) throw this.creBioEx("Шаблон для экспорта не найден в системе.", null); var isDefaultTempl = true; var seldTempl = defaultTmpl; if (!String.IsNullOrEmpty(customTmpl)) { seldTempl = customTmpl; isDefaultTempl = false; } var rptCfg = new CXLReportConfig(); rptCfg.fullCode = io.bioCode; rptCfg.extAttrs.roles = "all"; rptCfg.debug = false; rptCfg.extAttrs.liveScripts = false; rptCfg.templateAdv = seldTempl; rptCfg.title = title; rptCfg.filenameFmt = "{$code}_{$now}"; rptCfg.dbSession = this.BioSession.Cfg.dbSession; rptCfg.extAttrs.sessionID = this.BioSession.CurSessionID; rptCfg.extAttrs.userUID = this.BioSession.Cfg.CurUser.UID; rptCfg.extAttrs.remoteIP = this.BioSession.CurSessionRemoteIP; rptCfg.extAttrs.workPath = this.BioSession.Cfg.WorkspacePath; foreach (var prm in this.bioParams) rptCfg.inPrms.Add((Param) prm.Clone()); foreach (var prm in this.bioParams) rptCfg.rptPrms.Add(prm.Name, prm.Value, "str"); rptCfg.debug = Xml.getAttribute<Boolean>(io.IniDocument.XmlDoc.DocumentElement, "debug", false); rptCfg.dss.Add(CXLReportDSConfig.DecodeFromBio( io.IniDocument.XmlDoc.DocumentElement, io.LocalPath, "cdsRpt", "mRng", rptCfg.title, null)); instance = new CXLReport(io, rptCfg, this.Context); if (isDefaultTempl) (instance as CXLReport).OnPrepareTemplate += this.DoOnPrepareTemplate; }
protected virtual void doJustAfterRun(IRemoteProcInst inst) { }
protected virtual void SetInstance(IRemoteProcInst instance) { this.Context.Session.Add(this.InstanceUID, instance); instance.Run(ThreadPriority.Normal); }
private void _doOnRunEvent(RmtThreadHandler sender, out IRemoteProcInst instance) { var rqst = this.BioRequest<LongOpClientRequest>(); instance = new CLongOpProc(this.BioSession.Cfg.dbSession, null, rqst, this._prepareCmdDelegate); }