Пример #1
0
        public void retourneDetailOperation()
        {
            try
            {
                this.DTEcritureComptableFacture.ItemsSource = null;
                this.DTOperationClientele.ItemsSource       = null;
                this.txt_Credit.Text = string.Empty;
                this.txt_Debit.Text  = string.Empty;
                this.txt_total.Text  = string.Empty;
                prgBar.Visibility    = System.Windows.Visibility.Visible;

                #region Recupération des criteres de selection
                List <Galatee.Silverlight.ServiceInterfaceComptable.CsOperationComptable> lstCopeOper = new List <Galatee.Silverlight.ServiceInterfaceComptable.CsOperationComptable>();

                DateTime?DateDebut = null;
                if (!string.IsNullOrEmpty(this.dtpDateDebut.Text))
                {
                    DateDebut = Convert.ToDateTime(this.dtpDateDebut.Text);
                }

                DateTime?DateFin = null;
                if (!string.IsNullOrEmpty(this.dtpDateFin.Text))
                {
                    DateFin = Convert.ToDateTime(this.dtpDateFin.Text);
                }


                if (!string.IsNullOrEmpty(this.dtpDateCaisse.Text))
                {
                    DateDebut = Convert.ToDateTime(this.dtpDateCaisse.Text);
                }

                if (DateDebut == null && DateFin == null)
                {
                    Message.ShowInformation("Veuillez sélectionner une date", "Info");
                    return;
                }
                CsOperationComptable OperationCompableSelect = ListeOperationComptable.FirstOrDefault(t => t.CODE == "09");
                retourneMiseAjourGC(DateDebut, DateFin, OperationCompableSelect);
                #endregion
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void dgMyDataGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            DataGrid dg         = (sender as DataGrid);
            var      allObjects = dg.ItemsSource as List <CsLclient>;

            if (dg.SelectedItem != null)
            {
                CsOperationComptable SelectedObject = (CsOperationComptable)dg.SelectedItem;
                if (SelectedObject.IsSelect == false)
                {
                    SelectedObject.IsSelect = true;
                }
                else
                {
                    SelectedObject.IsSelect = false;
                }
            }
        }
 private void dtgOperation_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (dtgOperation.SelectedItem != null)
     {
         CsOperationComptable operationSelect = _ListeOperation.FirstOrDefault(t => t.CODE == ((CsOperationComptable)dtgOperation.SelectedItem).CODE);
         if (operationSelect != null)
         {
             if (operationSelect.IsSelect)
             {
                 operationSelect.IsSelect = false;
             }
             else
             {
                 operationSelect.IsSelect = true;
             }
         }
     }
 }
 public Dictionary <List <CsComptabilisation>, List <CsEcritureComptable> > RetourneMiseAJourGrandCompte(CsOperationComptable OperationCpt, DateTime?DateCaisseDebut, DateTime?DateCaisseFin, string matricule, string Site)
 {
     try
     {
         DbInterfaceComptable db = new DbInterfaceComptable();
         return(db.RetourneMiseAJourGrandCompte(OperationCpt, DateCaisseDebut, DateCaisseFin, matricule, Site));
     }
     catch (Exception ex)
     {
         ErrorManager.LogException(this, ex);
         return(null);
     }
 }
Пример #5
0
        public void retourneMiseAjourGC(DateTime?DateDebut, DateTime?DateFin, CsOperationComptable OperationCompableSelect)
        {
            try
            {
                string compte = string.Empty;
                InterfaceComptableServiceClient service = new InterfaceComptableServiceClient(Utility.ProtocoleIndex(), Utility.EndPoint("InterfaceComptable"));
                service.RetourneMiseAJourGrandCompteAsync(OperationCompableSelect, DateDebut, DateFin, UserConnecte.matricule, string.Empty);
                service.RetourneMiseAJourGrandCompteCompleted += (s, args) =>
                {
                    try
                    {
                        prgBar.Visibility = System.Windows.Visibility.Collapsed;
                        if (args.Cancelled || args.Error != null)
                        {
                            string error = args.Error.InnerException.ToString();
                            return;
                        }
                        if (args.Result != null && args.Result.Count == 0)
                        {
                            Message.ShowInformation("Aucune données trouvées", "Comptabilisation");
                            return;
                        }
                        else
                        {
                            Dictionary <List <CsComptabilisation>, List <CsEcritureComptable> > lstEncaissement = new Dictionary <List <CsComptabilisation>, List <CsEcritureComptable> >();
                            this.DTOperationClientele.ItemsSource = null;
                            if (args.Result != null && args.Result.Count != 0)
                            {
                                lstEncaissement = args.Result;
                                foreach (var item in lstEncaissement)
                                {
                                    #region Alimentation des grides opérations clientelles
                                    this.DTOperationClientele.ItemsSource = null;
                                    this.DTOperationClientele.ItemsSource = item.Key;
                                    txt_total.Text = item.Key.Sum(t => t.MONTANT).ToString(SessionObject.FormatMontant);
                                    #endregion

                                    #region Affectation des montants des operations grouper par coper et par date d'encaissement
                                    this.DTEcritureComptableFacture.ItemsSource = null;
                                    this.DTEcritureComptableFacture.ItemsSource = item.Value.OrderBy(c => c.DATECREATION).ThenBy(o => o.CAISSE).ThenByDescending(u => u.DC).ToList();
                                    #endregion
                                    this.txt_Credit.Text = item.Value.Where(t => t.DC == SessionObject.Enumere.Credit).Sum(u => u.MONTANT).Value.ToString(SessionObject.FormatMontant);
                                    this.txt_Debit.Text  = item.Value.Where(t => t.DC == SessionObject.Enumere.Debit).Sum(u => u.MONTANT).Value.ToString(SessionObject.FormatMontant);
                                }
                            }
                            else
                            {
                                Message.ShowInformation("Aucun élément trouvé pour les critères choisi", "Info");
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        prgBar.Visibility = System.Windows.Visibility.Collapsed;
                        Message.ShowError(ex, Galatee.Silverlight.Resources.Caisse.Langue.errorTitle);
                    }
                };
            }
            catch (Exception)
            {
                throw;
            }
        }