public string GetValeurData(object valeur, CParametreVisuDonneePrecalculee parametre) { if (m_dummyForData != null && FormuleData != null) { if (m_typeObjetDonneeData != null) { try { Int32 nVal = Int32.Parse(valeur.ToString()); CObjetDonnee obj = parametre.GetFromCache(m_typeObjetDonneeData, nVal); m_dummyForData.SetValeurChamp(m_dummyForData.Variable, obj); } catch { return(valeur.ToString()); } } else { m_dummyForData.SetValeurChamp(m_dummyForData.Variable, valeur); } CContexteEvaluationExpression ctx = new CContexteEvaluationExpression(m_dummyForData); CResultAErreur result = FormuleData.Eval(ctx); if (result) { return(result.Data.ToString()); } } if (valeur != null) { return(valeur.ToString()); } return(""); }
public bool setFormuleInfo(FormuleData fd) { switch (useDb) { case dbUsedType.db_SqlLite: return(sqliteProvider.setFormuleInfo(fd)); case dbUsedType.db_SqlServer: return(sqlServerProvider.setFormuleInfo(fd)); } return(false); }
private void Formule_Load(object sender, EventArgs e) { _db = new MainDBClass(); _db.OpenDB(); _fd = _db.getFormuleInfo(); UpdateList(); if (_fd != null) { textBoxFormule.Text = _fd.Formule; textBoxFormuleTitle.Text = _fd.Title; checkBoxEnable.Checked = _fd.Enable == 1; } }
private void button1_Click(object sender, EventArgs e) { try { _fd = new FormuleData(); _fd.Enable = checkBoxEnable.Checked ? 1 : 0; _fd.Title = textBoxFormuleTitle.Text; _fd.Formule = textBoxFormule.Text; _db.setFormuleInfo(_fd); MessageBox.Show(ResStrings.Formule_button1_Click_Formulae_saved, Properties.ResStrings.strInfo, MessageBoxButtons.OK, MessageBoxIcon.Warning); if (Lvd != null) { Lvd.LoadFormule(); } } catch (Exception exp) { ErrorMessage.ExceptionMessageBox.Show(exp); } }