//------------------------------------------------------- private void InitChamps() { CFiltreData filtre = new CFiltreData(CProcessInDb.c_champTypeCible + "=@1", typeof(CEtapeWorkflow).ToString()); m_txtSelectProcess.Init(typeof(CProcessInDb), filtre, "Libelle", true); if (m_blocProcess.DbKeyProcess != null) { CProcessInDb process = new CProcessInDb(CContexteDonneeSysteme.GetInstance()); if (process.ReadIfExists(m_blocProcess.DbKeyProcess)) { m_txtSelectProcess.ElementSelectionne = process; } } m_process = m_blocProcess.Process; m_txtInstructions.Text = m_blocProcess.Instructions; m_chkManualStart.Checked = m_blocProcess.DemarrageManuel; CParametresInitialisationEtape parametres = m_blocProcess.TypeEtape != null ? m_blocProcess.TypeEtape.ParametresInitialisation : new CParametresInitialisationEtape(); m_panelAffectations.Init(parametres); m_chkUtiliserSortieProcessCommeCodeRetour.Checked = m_blocProcess.UtiliserLaValeurDeSortieDeProcessCommeCodeRetour; UpdateVisuProcess(); }
private void UpdateListeVariables() { m_bListeVariablesRemplie = false; m_variableEnCoursEdition = null; m_txtFormuleVariable.Visible = false; if (!(m_cmbProcess.SelectedValue is CProcessInDb)) { m_wndListeVariables.Enabled = false; m_txtFormuleVariable.Visible = false; return; } m_wndListeVariables.Enabled = true; m_txtFormuleVariable.Visible = true; CProcessInDb processInDB = (CProcessInDb)m_cmbProcess.SelectedValue; CProcess process = processInDB.Process; if (process == null) { m_wndListeVariables.Enabled = false; m_txtFormuleVariable.Visible = false; return; } ArrayList lst = new ArrayList(process.ListeVariables); m_wndListeVariables.Remplir(lst, false); m_bListeVariablesRemplie = true; }
internal static void MemoryOptimize() { if (Settings.IsMemoryOptimize) { MemoryOptimizeTimer.Restart(); } new System.Threading.Thread(() => { SendMsg(true, "워크래프트 3 메모리 최적화를 시도합니다."); if (CProcess.TrimProcessMemory(TargetProcess, true)) { if (CProcess.MemoryValue[2] < 0) { SendMsg(true, "최적화할 메모리를 찾을 수 없었습니다."); } else { SendMsg(true, $"결과: {ConvertSize(CProcess.MemoryValue[0])} - {ConvertSize(CProcess.MemoryValue[2])} = {ConvertSize(CProcess.MemoryValue[1])}"); } } else { SendMsg(true, "Error - 최적화 중에 예외가 발생했습니다."); } }).Start(); }
public void Init(CProcess process, Type typeObjet, CActionImportFromTableRow.CMappageColonne mappage) { m_mappage = mappage; CColonneTableParametrable col = new CColonneTableParametrable(CContexteDonneeSysteme.GetInstance()); col.ReadIfExists(mappage.IdColonne); m_lblColonne.Text = col.Libelle; Type tp = col.TypeDonneeChamp.TypeDotNetAssocie; List <CDefinitionProprieteDynamique> lst = new List <CDefinitionProprieteDynamique>(); foreach (CDefinitionProprieteDynamique def in new CFournisseurPropDynStd(false).GetDefinitionsChamps(typeObjet)) { Type defType = def.TypeDonnee.TypeDotNetNatif; if (defType.IsGenericType && defType.GetGenericTypeDefinition() == typeof(Nullable <>)) { defType = defType.GetGenericArguments()[0]; } if (defType == tp && !def.TypeDonnee.IsArrayOfTypeNatif) { lst.Add(def); } } m_cmbChamp.ListDonnees = lst; m_cmbChamp.ProprieteAffichee = "Nom"; m_cmbChamp.SelectedValue = mappage.ProprieteCible; m_txtFormuleCondition.Init(process, typeof(CProcess)); m_txtFormuleCondition.Formule = mappage.FormuleCondition; }
/// ////////////////////////////////////////// private void UpdatePointsEntree() { m_panelPointEntree.Visible = false; m_cmbPointEntree.TextNull = I.T("Default|20012"); m_cmbPointEntree.Fill(new CActionPointEntree[0], "Libelle", true); if (!(m_cmbProcess.SelectedValue is CProcessInDb)) { m_cmbPointEntree.SelectedValue = null; return; } CProcessInDb processInDB = (CProcessInDb)m_cmbProcess.SelectedValue; CProcess process = processInDB.Process; if (process == null) { return; } CActionPointEntree[] entrees = process.PointsEntreeAlternatifs; m_cmbPointEntree.Fill(entrees, "Libelle", true); if (entrees.Length == 0) { m_panelPointEntree.Visible = false; m_cmbPointEntree.SelectedValue = null; } else { m_panelPointEntree.Visible = true; m_cmbPointEntree.SelectedValue = process.GetActionFromId(ActionLancerProcess.IdPointEntree); } }
/// <summary> /// Démarre une action /// </summary> /// <param name="process"></param> /// <param name="nIdSession"></param> /// <returns></returns> public static CResultAErreur StartProcess(CProcess process, CReferenceObjetDonnee refCible, int nIdSession, int?nIdVersion, bool bHideProgress) { CFormExecuteProcess form = new CFormExecuteProcess(); form.Top = 0; form.Left = Screen.PrimaryScreen.WorkingArea.Width / 2 - form.Width / 2; if (bHideProgress) { return(CProcessEnExecutionInDb.StartProcess( process, new CInfoDeclencheurProcess(TypeEvenement.Manuel), refCible, nIdSession, nIdVersion, null)); } else { IAsyncResult res = form.m_startProcess.BeginInvoke(process, refCible, nIdSession, nIdVersion, new AsyncCallback(form.OnEndProcess), null); form.ShowDialog(); //Bloque le code ici ! CResultAErreur result = form.m_startProcess.EndInvoke(res); return(result); } }
public unsafe float GetSentivity() { ulong sens_ptr = (ulong)CProcess.Client.BaseAddress /*+ Offsets.m_pSensitivity*/; ulong sens_value_xored = CProcess.Read <ulong>(CProcess.Client.BaseAddress /*+ Offsets.m_dwSensitivity*/); ulong Value = sens_ptr ^ sens_value_xored; return(*(float *)&Value); }
public Vector3 GetBone(int Index, int BoneID) { return(new Vector3 { X = CProcess.Read <float>((IntPtr)GetBoneMatrix(Index) + 0x30 * BoneID + 0x0C), Y = CProcess.Read <float>((IntPtr)GetBoneMatrix(Index) + 0x30 * BoneID + 0x1C), Z = CProcess.Read <float>((IntPtr)GetBoneMatrix(Index) + 0x30 * BoneID + 0x2C) }); }
internal static async void ReplayWatcher_Function(object sender, FileSystemEventArgs e) { if (Settings.IsOptimizeAfterEndGame && await CProcess.TrimProcessMemory() && Settings.IsMemoryOptimize) { MemoryOptimizeChecker.Restart(); } if (!Settings.IsAutoReplay) { IsTime = IsSaved = false; name = string.Empty; return; } try { await Task.Delay(1000); MainWorker.ReplayWatcher.EnableRaisingEvents = false; string LastReplay = $"{Path.GetDirectoryName(e.FullPath)}\\LastReplay.w3g"; if (File.Exists(LastReplay) && new FileInfo(LastReplay).Length >= 1024) { string FileName; if (IsSaved) { IsSaved = false; string CurrentCategory = $"{DocumentPath}\\Replay\\{Category[0]}\\{Category[1]}"; if (!Directory.Exists(CurrentCategory)) { Directory.CreateDirectory(CurrentCategory); } FileName = $"{CurrentCategory}\\{(IsTime ? string.Empty : "_")}{name}.w3g"; name = string.Empty; IsTime = false; if (File.Exists(FileName)) { File.Delete(FileName); } File.Move(LastReplay, FileName); } else if (Settings.NoSavedReplaySave) { if (!Directory.Exists(DocumentPath + @"\Replay\NoSavedReplay")) { Directory.CreateDirectory(DocumentPath + @"\Replay\NoSavedReplay"); } FileName = $"{DocumentPath}\\Replay\\NoSavedReplay\\{GetFileTime(LastReplay)}.w3g"; if (File.Exists(FileName)) { File.Delete(FileName); } File.Move(LastReplay, FileName); } } } catch { } MainWorker.ReplayWatcher.EnableRaisingEvents = true; }
public CChatMaster(CAutoReplier _autoreplier, IWebDriver _driver) { this.replier = _autoreplier; this.driver = _driver; this.windows = new Dictionary<string, CWindow>(); this.process = new CProcess(); thrWorker = new Thread(() => WatchChats()); thrWorker.Start(); }
/// <summary> /// Populate business objects from the data reader /// </summary> /// <param name="dataReader">data reader</param> /// <returns>list of CProcess</returns> internal List <CProcess> PopulateObjectsFromReader(IDataReader dataReader) { List <CProcess> list = new List <CProcess>(); while (dataReader.Read()) { CProcess businessObject = new CProcess(); PopulateBusinessObjectFromReader(businessObject, dataReader); list.Add(businessObject); } return(list); }
internal static async void MemoryOptimize(string[] args) { if (Settings.IsMemoryOptimize) { MemoryOptimizeChecker.Restart(); } int ResultDelay; if (!(args?.Length > 1) || string.IsNullOrEmpty(args[1])) { ResultDelay = 5; SendMsg(true, "워크래프트 3 메모리 최적화를 시도합니다."); } else { try { ResultDelay = int.Parse(args[1]); if (ResultDelay < 0) { ResultDelay = 0; } if (ResultDelay > 10) { ResultDelay = 10; } } catch { ResultDelay = 5; } if (ResultDelay > 0) { SendMsg(true, $"워크래프트 3 메모리 최적화를 시도합니다. ({ResultDelay}초 후 결과 계산)"); } } if (await CProcess.TrimProcessMemory(ResultDelay)) { long ChangedMemory = CProcess.MemoryValue[0] - CProcess.MemoryValue[2]; if (ChangedMemory < 0) { SendMsg(true, $"결과: {ConvertSize(CProcess.MemoryValue[0])} + {ConvertSize(-ChangedMemory)} = {ConvertSize(CProcess.MemoryValue[2])}"); } else { SendMsg(true, $"결과: {ConvertSize(CProcess.MemoryValue[0])} - {ConvertSize(ChangedMemory)} = {ConvertSize(CProcess.MemoryValue[2])}"); } return; } Error: SendMsg(true, "Error - 최적화 중에 예외가 발생했습니다."); }
public static void Init() { InitHotkey(); InitCommand(); //AntiZombieProcessChecker = new HangWatchdog(0, 0, 5); //AntiZombieProcessChecker.Condition = () => (Warcraft3Info.Process?.MainWindowHandle == IntPtr.Zero) ?? false; //AntiZombieProcessChecker.Actions += () => Warcraft3Info.Close(); MemoryOptimizeChecker = new HangWatchdog(() => new TimeSpan(0, Settings.MemoryOptimizeCoolDown, 0)); MemoryOptimizeChecker.Condition = () => Settings.IsMemoryOptimize; MemoryOptimizeChecker.Actions += async() => await CProcess.TrimProcessMemory(true); }
private void Run(ExecConfig e, string section, int seq, bool isAsync = true) { ProgramWrapper wrapper; if (Globals.Config.User == null || e.ExecLaunchPrivilegeLevel == ExecLaunchPrivilegeLevel.IgnoreUser || e.ExecLaunchPrivilegeLevel == ExecLaunchPrivilegeLevel.Full) { wrapper = new ManagedProgramWrapper(e.ProgramPath, e.Arguments); wrapper.Start(); } else { // Get the privilege for impersonation var currentProcess = new CProcess(); if (!currentProcess.SetPrivilege("SeTcbPrivilege", true)) { throw new InvalidOperationException("Required privilege SeTcbPrivilege failed"); } if (!currentProcess.SetPrivilege("SeDelegateSessionUserImpersonatePrivilege", true)) { throw new InvalidOperationException("Required privilege SeDelegateSessionUserImpersonatePrivilege failed"); } // Get the identity we needed var identity = new WindowsIdentity(Globals.Config.User); if (identity.ImpersonationLevel != TokenImpersonationLevel.Impersonation) { throw new InvalidOperationException("Insufficient permission"); } // Run the helper process as that identity using (identity.Impersonate()) { LogMuxer.Instance.Debug($"After impersonation, User={WindowsIdentity.GetCurrent().Name}, ImpersonationLevel={identity.ImpersonationLevel}");; wrapper = new NativeProgramWrapper(section, seq, identity.Token); wrapper.Start(); } } if (isAsync) { _programPool.Add(wrapper); wrapper.ProgramExited += SubprocessQuit; } else { wrapper.WaitForExit(); } }
//----------------------------------------------------------- public static CResultAErreur ShowHelp(CProcess process) { CResultAErreur result = CResultAErreur.True; foreach (IVariableDynamique variable in process.ListeVariables) { if (variable.TypeDonnee.TypeDotNetNatif.IsValueType) { result.EmpileErreur(variable.Nom + " (" + variable.TypeDonnee.TypeDotNetNatif + ")"); } } result.EmpileErreur(I.T("Expected arguments for the process|30011")); return(result); }
//------------------------------------------------------------- public CResultAErreur StartProcess(CEtapeWorkflow etape) { CResultAErreur result = CResultAErreur.True; CProcess process = m_process; if (process == null) { if (m_dbKeyProcess != null) { CProcessInDb processInDb = new CProcessInDb(etape.ContexteDonnee); if (processInDb.ReadIfExists(m_dbKeyProcess)) { process = processInDb.Process; } } } if (process != null) { if (process.Libelle.Trim().Length == 0 && etape != null) { process.Libelle = I.T("Step @1|20109", etape.Libelle); } result = CProcessEnExecutionInDb.StartProcess(process, new CInfoDeclencheurProcess(TypeEvenement.Specifique), new CReferenceObjetDonnee(etape), etape.ContexteDonnee.IdSession, null, null); if (result) { etape.Refresh();//Relit l'étape car elle a pu être modifiée par le process if (m_bUtiliserSortieDeProcessCommeCodeRetour && (result.Data is string || result.Data is string[])) { if (result.Data is string) { etape.CodesRetour = new string[] { (string)result.Data } } ; if (result.Data is string[]) { etape.CodesRetour = (string[])result.Data; } } result = EndAndSaveIfOk(etape); } } return(result); } }
private void button2_Click(object sender, EventArgs e) { CProcess CurrentProcess = new CProcess(), TargetProcess = new CProcess(Options.TargetProcess), ServProcess; //Use HLeaker to get a handle with needed privileges int counter = 0, maxCount = 1; List <Service.HANDLE_INFO> HandleList = new List <Service.HANDLE_INFO>(); IntPtr hProcess = IntPtr.Zero; CurrentProcess.SetPrivilege("SeDebugPrivilege", true); CurrentProcess.SetPrivilege("SeTcbPrivilege", true); TargetProcess.Wait(Options.DelayToWait); if (TargetProcess.IsValidProcess()) { HandleList = Service.ServiceEnumHandles(TargetProcess.GetPid(), Options.DesiredAccess); if (HandleList.Count > 0) { foreach (Service.HANDLE_INFO enumerator in HandleList) { if (counter == maxCount) { break; } if (enumerator.Pid == Kernel32.GetCurrentProcessId()) { continue; } ServProcess = new CProcess(enumerator.Pid); if (Service.ServiceSetHandleStatus(ServProcess, (IntPtr)enumerator.hProcess, true, true) == true) { hProcess = Service.ServiceStartProcess(null, Directory.GetCurrentDirectory() + "\\Stuff\\" + Options.YourProcess + " " + enumerator.hProcess, null, true, ServProcess.GetHandle()); Service.ServiceSetHandleStatus(ServProcess, (IntPtr)enumerator.hProcess, false, false); counter++; } if (hProcess != null) { Kernel32.CloseHandle(hProcess); } ServProcess.Close(); } } TargetProcess.Close(); } CurrentProcess.SetPrivilege("SeDebugPrivilege", false); CurrentProcess.SetPrivilege("SeTcbPrivilege", false); this.Close(); }
//------------------------------------------------------- private CResultAErreur MajChamps() { CResultAErreur result = CResultAErreur.True; //m_blocFormulaire.Instructions = m_txtInstructions.Text; CProcessInDb process = m_txtSelectProcess.ElementSelectionne as CProcessInDb; if (process != null) { m_blocProcess.DbKeyProcess = process.DbKey; } else { m_blocProcess.DbKeyProcess = null; } CResultAErreurType <CParametresInitialisationEtape> resParam = m_panelAffectations.MajChamps(); if (resParam != null) { if (m_blocProcess.TypeEtape != null) { m_blocProcess.TypeEtape.ParametresInitialisation = resParam.DataType; } } else { result.EmpileErreur(resParam.Erreur); } m_blocProcess.DemarrageManuel = m_chkManualStart.Checked; m_blocProcess.Instructions = m_txtInstructions.Text; if (m_blocProcess.DbKeyProcess == null) { m_process = m_processEditor.Process; m_blocProcess.Process = m_process; } else { m_blocProcess.Process = null; } m_blocProcess.UtiliserLaValeurDeSortieDeProcessCommeCodeRetour = m_chkUtiliserSortieProcessCommeCodeRetour.Checked; return(result); }
/// ////////////////////////////////////////// protected override void InitChamps() { base.InitChamps(); m_wndAideFormule.FournisseurProprietes = ObjetEdite.Process; m_wndAideFormule.ObjetInterroge = typeof(CProcess); m_txtFormuleVariable.Init(m_wndAideFormule.FournisseurProprietes, m_wndAideFormule.ObjetInterroge); CListeObjetsDonnees liste = new CListeObjetsDonnees(CSc2iWin32DataClient.ContexteCourant, typeof(CProcessInDb)); m_cmbProcess.ListDonnees = liste; m_cmbProcess.ProprieteAffichee = "Libelle"; CProcessInDb processInDB = new CProcessInDb(CSc2iWin32DataClient.ContexteCourant); m_tableIdVariableToFormule.Clear(); CProcess processALancer = null; if (processInDB.ReadIfExists(ActionLancerProcess.DbKeyProcess)) { m_cmbProcess.SelectedValue = processInDB; processALancer = processInDB.Process; if (processALancer != null) { foreach (IVariableDynamique variable in processALancer.ListeVariables) { m_tableIdVariableToFormule[variable.IdVariable] = ActionLancerProcess.GetExpressionForVariableProcess(variable.IdVariable); } } } else { m_cmbProcess.SelectedValue = null; } UpdateListeVariables(); m_chkAsynchrone.Checked = ActionLancerProcess.ModeAsynchrone; m_chkSansTrace.Checked = ActionLancerProcess.SansTrace; m_chkContexteSepare.Checked = ActionLancerProcess.LancerDansUnProcessSepare; UpdatePointsEntree(); }
/// <summary> /// update row in the table /// </summary> /// <param name="businessObject">business object</param> /// <returns>true for successfully updated</returns> public bool Update(CProcess businessObject) { NpgsqlCommand sqlCommand = new NpgsqlCommand(); sqlCommand.CommandText = "public.sp_process_Update"; sqlCommand.CommandType = CommandType.StoredProcedure; // Use connection object of base class sqlCommand.Connection = MainConnection; try { sqlCommand.Parameters.AddWithValue("p_cod_process", businessObject.Cod_process); sqlCommand.Parameters["p_cod_process"].NpgsqlDbType = NpgsqlDbType.Varchar; sqlCommand.Parameters.AddWithValue("p_nom_process", businessObject.Nom_process); sqlCommand.Parameters["p_nom_process"].NpgsqlDbType = NpgsqlDbType.Varchar; sqlCommand.Parameters.AddWithValue("p_description", businessObject.Description); sqlCommand.Parameters["p_description"].NpgsqlDbType = NpgsqlDbType.Varchar; sqlCommand.Parameters.AddWithValue("p_cod_module", businessObject.Cod_module); sqlCommand.Parameters["p_cod_module"].NpgsqlDbType = NpgsqlDbType.Varchar; sqlCommand.Parameters.AddWithValue("p_cod_area", businessObject.Cod_area); sqlCommand.Parameters["p_cod_area"].NpgsqlDbType = NpgsqlDbType.Varchar; MainConnection.Open(); if (Convert.ToInt32(sqlCommand.ExecuteScalar()) > 0) { return(true); } return(false); } catch (Exception ex) { throw new Exception("CProcess::Update::Error occured.", ex); } finally { MainConnection.Close(); sqlCommand.Dispose(); } }
/// <summary> /// Select by primary key /// </summary> /// <param name="keys">primary keys</param> /// <returns>CProcess business object</returns> public CProcess SelectByPrimaryKey(CProcessKeys keys) { NpgsqlCommand sqlCommand = new NpgsqlCommand(); sqlCommand.CommandText = "public.sp_process_SelectByPrimaryKey"; sqlCommand.CommandType = CommandType.StoredProcedure; // Use connection object of base class sqlCommand.Connection = MainConnection; try { sqlCommand.Parameters.Add(new NpgsqlParameter("p_cod_process", NpgsqlDbType.Varchar, 4, "", ParameterDirection.Input, false, 0, 0, DataRowVersion.Proposed, keys.Cod_process)); MainConnection.Open(); NpgsqlDataReader dataReader = sqlCommand.ExecuteReader(); if (dataReader.Read()) { CProcess businessObject = new CProcess(); PopulateBusinessObjectFromReader(businessObject, dataReader); return(businessObject); } else { return(null); } } catch (Exception ex) { throw new Exception("CProcess::SelectByPrimaryKey::Error occured.", ex); } finally { MainConnection.Close(); sqlCommand.Dispose(); } }
/// /////////////////////////////////////////// public override object Invoke(object objetAppelle, params object[] parametres) { if (!(objetAppelle is CProcess)) { return(null); } CProcess process = (CProcess)objetAppelle; if (process.ContexteExecution != null) { //TESTDBKEYOK CDbKey keyUtilisateur = process.ContexteExecution.Branche.KeyUtilisateur; CDonneesActeurUtilisateur user = new CDonneesActeurUtilisateur(process.ContexteExecution.ContexteDonnee); if (user.ReadIfExists(keyUtilisateur)) { return(user); } } return(null); }
///////////////////////////////////////////////////////////////////////////////// private void InitListeFormulesParametres(CProcess process, CActionSur2iLinkExecuterProcess action) { if (process == null) { m_panelParametresAction.Visible = false; return; } m_panelParametresAction.Visible = true; Dictionary <string, CFormuleNommee> dicFormulesCreees = new Dictionary <string, CFormuleNommee>(); if (action != null) { foreach (CFormuleNommee formule in action.FormulesPourParametres) { dicFormulesCreees[formule.Libelle] = formule; } } List <CFormuleNommee> lst = new List <CFormuleNommee>(); if (process != null) { foreach (IVariableDynamique variable in process.ListeVariables) { if (variable.IsChoixUtilisateur()) { CFormuleNommee formuleAffectee = null; if (dicFormulesCreees.TryGetValue(variable.Nom, out formuleAffectee)) { lst.Add(formuleAffectee); } else { lst.Add(new CFormuleNommee(variable.Nom, null)); } } } } m_panelParametresAction.Init(lst.ToArray(), m_objetPourSousProprietes, new CFournisseurGeneriqueProprietesDynamiques()); }
//---------------------------------------------------------------- private void UpdateVisuProcess() { CProcessInDb prc = m_txtSelectProcess.ElementSelectionne as CProcessInDb; if (prc == null) { if (m_process == null) { m_process = new CProcess(m_blocProcess.TypeEtape.ContexteDonnee); } m_process.TypeCible = typeof(CEtapeWorkflow); m_processEditor.Process = m_process; if (!m_tab.TabPages.Contains(m_pageProcess)) { m_tab.TabPages.Insert(0, m_pageProcess); } } else if (m_tab.TabPages.Contains(m_pageProcess)) { m_tab.TabPages.Remove(m_pageProcess); } }
public List <int> GetMaxPlayers() { List <int> totalPlayers = new List <int>(0); var maxPlayers = CProcess.Read <int>(CProcess.Read <IntPtr>(CProcess.Engine.BaseAddress /*+ Offset.m_dwClientState*/) /*+ Offset.m_dwMaxPlayers*/); //Existe el player con indice 0 ???? XD for (int i = 0; i < maxPlayers; i++) { if (GetEntity(i) != null && !IsAlive(i) && !IsDormant(i) && GetBoneMatrix(i) != null && GetHealth(i) > 0 && !IsInvisible(i) && GetBone(i, 0 /*Settings.AimbotBone*/).Length() != 0) { totalPlayers.Add(i); } } return(totalPlayers); }
/// <summary> /// Populate business object from data reader /// </summary> /// <param name="businessObject">business object</param> /// <param name="dataReader">data reader</param> internal void PopulateBusinessObjectFromReader(CProcess businessObject, IDataReader dataReader) { businessObject.Cod_process = dataReader.GetString(dataReader.GetOrdinal(CProcess.CProcessFields.Cod_process.ToString())); if (!dataReader.IsDBNull(dataReader.GetOrdinal(CProcess.CProcessFields.Nom_process.ToString()))) { businessObject.Nom_process = dataReader.GetString(dataReader.GetOrdinal(CProcess.CProcessFields.Nom_process.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CProcess.CProcessFields.Description.ToString()))) { businessObject.Description = dataReader.GetString(dataReader.GetOrdinal(CProcess.CProcessFields.Description.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CProcess.CProcessFields.Cod_module.ToString()))) { businessObject.Cod_module = dataReader.GetString(dataReader.GetOrdinal(CProcess.CProcessFields.Cod_module.ToString())); } if (!dataReader.IsDBNull(dataReader.GetOrdinal(CProcess.CProcessFields.Cod_area.ToString()))) { businessObject.Cod_area = dataReader.GetString(dataReader.GetOrdinal(CProcess.CProcessFields.Cod_area.ToString())); } }
/// ////////////////////////////////////////////////////////////////// protected static CResultAErreur AffecteVariablesToProcess(CActionSur2iLinkExecuterProcess action, CProcess process, object cible) { CResultAErreur result = CResultAErreur.True; CContexteEvaluationExpression ctx = new CContexteEvaluationExpression(cible); foreach (CFormuleNommee formule in action.FormulesPourParametres) { if (formule.Formule != null) { result = formule.Formule.Eval(ctx); if (!result) { result.EmpileErreur(I.T("Error while evaluating parameter @1|20128", formule.Libelle)); return(result); } bool bVariableFound = false; foreach (CVariableDynamique variable in process.ListeVariables) { if (variable.Nom == formule.Libelle) { process.SetValeurChamp(variable.IdVariable, result.Data); bVariableFound = true; break; } } if (!bVariableFound) { result.EmpileErreur(I.T("Process variable @1 doesn't exists|20129", formule.Libelle)); return(result); } } } return(result); }
/// ///////////////////////////////////////////////////////////////////////// private CResultAErreur StartProcessMultiplesPrivate(CProcess process, CReferenceObjetDonnee[] refsCible, int nIdSession, int?nIdVersion) { CInfoDeclencheurProcess infoDeclencheur = new CInfoDeclencheurProcess(TypeEvenement.Manuel); return(CProcessEnExecutionInDb.StartProcessMultiples(process, infoDeclencheur, refsCible, nIdSession, nIdVersion, this)); }
/// ///////////////////////////////////////// public CActionEditerElement(CProcess process) : base(process) { Libelle = I.T("Edit an element|383"); }
/// ///////////////////////////////////////// public CActionGenererEtat(CProcess process) : base(process) { Libelle = I.T("Generate a report|30040"); VariableRetourCanBeNull = true; }
/// ///////////////////////////////////////// public CActionFormulaire(CProcess process) : base(process) { Libelle = I.T("Form|410"); }