Beispiel #1
0
 private bool Insert(CsDomBanc pDomBanc)
 {
     try
     {
         return(Entities.InsertEntity <Galatee.Entity.Model.DOMBANC>(Entities.ConvertObject <Galatee.Entity.Model.DOMBANC, CsDomBanc>(pDomBanc)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
 public bool Delete(CsDomBanc pDomBanc)
 {
     try
     {
         return(Entities.DeleteEntity <Galatee.Entity.Model.DOMBANC>(Entities.ConvertObject <Galatee.Entity.Model.DOMBANC, CsDomBanc>(pDomBanc)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
        public UcDomBanc(object[] pObjects, SessionObject.ExecMode[] pExecMode, DataGrid[] pGrid)
        {
            try
            {
                InitializeComponent();
                Translate();
                var categorieClient = new CsDomBanc();
                if (pObjects[0] != null)
                {
                    ObjetSelectionnee = Utility.ParseObject(categorieClient, pObjects[0] as CsDomBanc);
                }
                ModeExecution = pExecMode[0];
                dataGrid      = pGrid[0];
                RemplirListeDesBanques();
                if (dataGrid != null)
                {
                    donnesDatagrid = dataGrid.ItemsSource as ObservableCollection <CsDomBanc>;
                }
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification ||
                    (SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation)
                {
                    if (ObjetSelectionnee != null)
                    {
                        Txt_Banque.Text       = ObjetSelectionnee.BANQUE ?? string.Empty;
                        Txt_Guichet.Text      = ObjetSelectionnee.GUICHET ?? string.Empty;
                        Txt_Libelle.Text      = ObjetSelectionnee.LIBELLE ?? string.Empty;
                        Txt_Compte.Text       = ObjetSelectionnee.COMPTE ?? string.Empty;
                        Txt_Comptabilite.Text = ObjetSelectionnee.COMPTA ?? string.Empty;
                        btnOk.IsEnabled       = false;

                        //Txt_Banque.IsReadOnly = true;
                        //Txt_Guichet.IsReadOnly = true;
                    }
                }
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation)
                {
                    AllInOne.ActivateControlsFromXaml(LayoutRoot, false);
                }
                VerifierSaisie();
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.DomiciliationBancaire);
            }
        }
Beispiel #4
0
        private List <CsDomBanc> GetInformationsFromScreen()
        {
            var listObjetForInsertOrUpdate = new List <CsDomBanc>();

            try
            {
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
                {
                    var DomBanc = new CsDomBanc
                    {
                        BANQUE       = Txt_Banque.Text,
                        GUICHET      = Txt_Guichet.Text,
                        LIBELLE      = Txt_Libelle.Text,
                        COMPTE       = Txt_Compte.Text,
                        COMPTA       = Txt_Comptabilite.Text,
                        DATECREATION = DateTime.Now,
                        USERCREATION = UserConnecte.matricule
                    };
                    if (!string.IsNullOrEmpty(Txt_Banque.Text) && !string.IsNullOrEmpty(Txt_Guichet.Text) && donnesDatagrid.FirstOrDefault(p => p.GUICHET != null && p.BANQUE != null && p.BANQUE == DomBanc.BANQUE && p.GUICHET == DomBanc.GUICHET) != null)
                    {
                        throw new Exception(Languages.CetElementExisteDeja);
                    }
                    listObjetForInsertOrUpdate.Add(DomBanc);
                }
                if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
                {
                    ObjetSelectionnee.BANQUE           = Txt_Banque.Text;
                    ObjetSelectionnee.GUICHET          = Txt_Guichet.Text;
                    ObjetSelectionnee.LIBELLE          = Txt_Libelle.Text;
                    ObjetSelectionnee.COMPTE           = Txt_Compte.Text;
                    ObjetSelectionnee.COMPTA           = Txt_Comptabilite.Text;
                    ObjetSelectionnee.DATEMODIFICATION = DateTime.Now;
                    ObjetSelectionnee.USERMODIFICATION = UserConnecte.matricule;
                    listObjetForInsertOrUpdate.Add(ObjetSelectionnee);
                }
                return(listObjetForInsertOrUpdate);
            }
            catch (Exception ex)
            {
                Message.ShowError(ex.Message, Languages.DomiciliationBancaire);
                return(null);
            }
        }
Beispiel #5
0
 private void UpdateParentList(CsDomBanc pDomBanc)
 {
     try
     {
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation)
         {
             GetDataNew();
             //donnesDatagrid.Add(pDomBanc);
         }
         if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification)
         {
             GetDataNew();
             //var DomBanc = donnesDatagrid.First(p => p.PK_ID == pDomBanc.PK_ID);
             //donnesDatagrid.Remove(DomBanc);
             //donnesDatagrid.Add(pDomBanc);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }