//----------------------------------------------- public CResultAErreur MajChamps() { CResultAErreur result = CResultAErreur.True; if (m_donneeOperation != null) { CTypeOperation tpOld = m_donneeOperation.GetTypeOperation(m_besoin.ContexteDonnee); CTypeOperation tpNew = m_txtSelectTypeOperation.ElementSelectionne as CTypeOperation; CControleBesoin ctrlBesoin = ControleBesoin; if (ctrlBesoin != null) { if ((tpOld == null || ctrlBesoin.LibelleBesoin.ToUpper() == tpOld.LibelleComplet.ToUpper() || ctrlBesoin.LibelleBesoin.Trim().Length == 0)) { if (tpNew != null) { ctrlBesoin.LibelleBesoin = tpNew.LibelleComplet; } else { ctrlBesoin.LibelleBesoin = ""; } } } m_donneeOperation.SetTypeOperation(tpNew); } return(result); }
public void Init(IDonneeBesoin calcul, CBesoin besoin, CItemBesoin itemBesoin, IEnumerable <CItemBesoin> items) { m_bIsInitializing = true; m_donneeOperation = calcul as CDonneeBesoinTypeOperation; m_besoin = besoin; if (m_donneeOperation != null) { Visible = true; CFiltreData filtre = null; if (besoin.BesoinParent != null && besoin.BesoinParent.TypeOperation != null) { filtre = new CFiltreData(CTypeOperation.c_champIdOperationParente + "=@1", besoin.BesoinParent.TypeOperation.Id); } m_txtSelectTypeOperation.InitAvecFiltreDeBase(typeof(CTypeOperation), "LibelleComplet", filtre, false); m_txtSelectTypeOperation.ElementSelectionne = m_donneeOperation.GetTypeOperation(besoin.ContexteDonnee); } m_bIsInitializing = false; }
//------------------------------------------------------------ private void m_btnCoutVerrouillé_Click(object sender, EventArgs e) { if (m_donneeOperation != null && !LockEdition) { m_donneeOperation.IsCoutTarif = !m_donneeOperation.IsCoutTarif; if (m_donneeOperation.IsCoutTarif) { m_txtCoutUnitaire.LockEdition = true; m_donneeOperation.SetTypeOperation(m_donneeOperation.GetTypeOperation(m_besoin.ContexteDonnee)); m_txtCoutUnitaire.DoubleValue = m_donneeOperation.CoutUnitaire; if (OnCoutChanged != null) { OnCoutChanged(this, null); } } else { m_txtCoutUnitaire.LockEdition = false; } UpdateImageVerrou(); } }