private void Txt_Centre_TextChanged(object sender, TextChangedEventArgs e) { if (Txt_Centre.Text.Length == SessionObject.Enumere.TailleCentre) { CsLotri leLotSelect = new CsLotri(); if (this.Txt_NumBatch.Tag != null) { leLotSelect = (CsLotri)this.Txt_NumBatch.Tag; } List <CsLotri> _lstLotAfficher = ClasseMethodeGenerique.RetourneDistinctCentre(_ListeLotri.Where(t => t.NUMLOTRI == leLotSelect.NUMLOTRI && t.PERIODE == leLotSelect.PERIODE).ToList()); if (_lstLotAfficher.FirstOrDefault(t => t.CENTRE == this.Txt_Centre.Text) == null) { Message.ShowInformation("Centre inexistant ", "Lot"); return; } else { Txt_Centre.Tag = _lstLotAfficher.FirstOrDefault(t => t.CENTRE == this.Txt_Centre.Text); } } if (string.IsNullOrEmpty(this.Txt_Centre.Text)) { Txt_Centre.Tag = null; } }
private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { CsLotri _LeLotSelect = (CsLotri)this.dataGrid1.SelectedItem; if (_LeLotSelect != null) { CsLotri _LeRechercher = _ListeLotriObs.FirstOrDefault(p => p.CENTRE == _LeLotSelect.CENTRE && p.PRODUIT == _LeLotSelect.PRODUIT && p.PERIODE == _LeLotSelect.PERIODE && p.TOURNEE == _LeLotSelect.TOURNEE && p.CATEGORIECLIENT == _LeLotSelect.CATEGORIECLIENT); if (_LeRechercher != null) { if (_LeRechercher.IsSelect != true) { _LeRechercher.IsSelect = true; this.txt_jetEnCours.Text = string.IsNullOrEmpty(_LeRechercher.JET) ? "**" : _LeRechercher.JET; } else { _LeRechercher.IsSelect = false; } } } } catch (Exception ex) { throw ex; } }
private void btn_AfficherAnnomalie_Click(object sender, RoutedEventArgs e) { if (dataGridlLot.SelectedItem != null) { CsLotri SelectedObject = (CsLotri)dataGridlLot.SelectedItem; List <CsAnnomalie> ListeAnnomalie = new List <CsAnnomalie>(); FacturationServiceClient service = new FacturationServiceClient(Utility.Protocole(), Utility.EndPoint("Facturation")); service.RetourneControleFacturesCompleted += (s, args) => { if (args != null && args.Cancelled) { return; } ListeAnnomalie = args.Result; if (ListeAnnomalie == null || ListeAnnomalie.Count == 0) { return; } this.dataGrid1.ItemsSource = null; this.dataGrid1.ItemsSource = ListeAnnomalie; }; service.RetourneControleFacturesAsync(SelectedObject); service.CloseAsync(); } }
private void ucgReturn(object sender, EventArgs e) { try { MainView.UcListeGenerique uc = sender as MainView.UcListeGenerique; if (uc.GetisOkClick) { this.Txt_Centre.Text = string.Empty; CsLotri lot = (CsLotri)uc.MyObject; Txt_NumBatch.Text = lot.NUMLOTRI; this.Txt_NumBatch.Tag = lot; produit = listeBatchInit.FirstOrDefault(t => t.NUMLOTRI == Txt_NumBatch.Text).PRODUIT; _lstLotCEntreAfficher = ClasseMethodeGenerique.RetourneDistinctCentre(listeBatch.Where(t => t.NUMLOTRI == lot.NUMLOTRI).ToList()); if (_lstLotCEntreAfficher.Count == 1) { List <int> lstCentre = new List <int>(); lstCentre.Add(_lstLotCEntreAfficher.First().FK_IDCENTRE); this.Txt_Centre.Text = _lstLotCEntreAfficher.First().CENTRE; this.Txt_Centre.Tag = lstCentre; //this.Txt_LibelleCentre.Text = _lstLotCEntreAfficher.First().LIBELLECENTRE; } } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
public static List <CsLotri> RetourneDistinctPeriode(List <CsLotri> lstLori) { try { List <CsLotri> _lstLotriDistinct = new List <CsLotri>(); var ListLotriTemp = (from p in lstLori group new { p } by new { p.PERIODE } into pResult select new { pResult.Key.PERIODE }); foreach (var item in ListLotriTemp) { CsLotri leLot = new CsLotri() { PERIODE = item.PERIODE }; _lstLotriDistinct.Add(leLot); } return(_lstLotriDistinct); } catch (Exception ex) { throw ex; } }
public static List <CsLotri> RetourneDistinctTournee(List <CsLotri> lstLori) { try { List <CsLotri> _lstLotriDistinct = new List <CsLotri>(); var ListLotriTemp = (from p in lstLori group new { p } by new { p.FK_IDCENTRE, p.NUMLOTRI, p.CENTRE, p.TOURNEE, p.FK_IDTOURNEE } into pResult select new { pResult.Key.NUMLOTRI, pResult.Key.CENTRE, pResult.Key.TOURNEE, pResult.Key.FK_IDCENTRE, pResult.Key.FK_IDTOURNEE }); foreach (var item in ListLotriTemp) { CsLotri leLot = new CsLotri() { CENTRE = item.CENTRE, NUMLOTRI = item.NUMLOTRI, TOURNEE = item.TOURNEE, FK_IDCENTRE = item.FK_IDCENTRE, FK_IDTOURNEE = item.FK_IDTOURNEE }; _lstLotriDistinct.Add(leLot); } return(_lstLotriDistinct); } catch (Exception ex) { throw ex; } }
public static List <CsLotri> RetourneDistinctCentre(List <CsLotri> _LstLot) { try { List <CsLotri> _lstCentreLotriDistinct = new List <CsLotri>(); var ListLotriTemp = (from p in _LstLot group new { p } by new { p.NUMLOTRI, p.CENTRE, p.FK_IDCENTRE, p.PERIODE, p.LIBELLECENTRE } into pResult select new { pResult.Key.CENTRE, pResult.Key.FK_IDCENTRE, pResult.Key.PERIODE, pResult.Key.NUMLOTRI, pResult.Key.LIBELLECENTRE }); foreach (var item in ListLotriTemp) { CsLotri leCentreLot = new CsLotri() { CENTRE = item.CENTRE, FK_IDCENTRE = item.FK_IDCENTRE, PERIODE = item.PERIODE, NUMLOTRI = item.NUMLOTRI, LIBELLECENTRE = item.LIBELLECENTRE }; _lstCentreLotriDistinct.Add(leCentreLot); } return(_lstCentreLotriDistinct); } catch (Exception ex) { throw ex; } }
public static List <CsLotri> RetourneDistinctLotri(List <CsLotri> _LstLot) { try { List <CsLotri> _lstLotriDistinct = new List <CsLotri>(); var ListLotriTemp = (from p in _LstLot group new { p } by new { p.NUMLOTRI, p.PERIODE } into pResult select new { pResult.Key.NUMLOTRI, pResult.Key.PERIODE, }); foreach (var item in ListLotriTemp) { CsLotri leLot = new CsLotri() { NUMLOTRI = item.NUMLOTRI, PERIODE = item.PERIODE, }; _lstLotriDistinct.Add(leLot); } return(_lstLotriDistinct); } catch (Exception ex) { throw ex; } }
private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { CsLotri _LeLotSelect = (CsLotri)this.dataGrid1.SelectedItem; if (_LeLotSelect != null) { CsLotri _LeRechercher = _ListeLotriObs.FirstOrDefault(p => p.CENTRE == _LeLotSelect.CENTRE && p.PRODUIT == _LeLotSelect.PRODUIT && p.PERIODE == _LeLotSelect.PERIODE && p.TOURNEE == _LeLotSelect.TOURNEE && p.CATEGORIECLIENT == _LeLotSelect.CATEGORIECLIENT); if (_LeRechercher != null) { if (_LeRechercher.IsSelect != true) { _LeRechercher.IsSelect = true; this.Txt_DateFacture.Text = System.DateTime.Now.ToShortDateString(); this.txt_jetEnCours.Text = string.IsNullOrEmpty(_LeRechercher.JET) ? "01" : (int.Parse(_LeRechercher.JET) + 1).ToString("00"); this.txt_JetSuivant.Text = (int.Parse(this.txt_jetEnCours.Text) + 1).ToString("00"); this.Txt_periode.Text = Galatee.Silverlight.Shared.ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_LeRechercher.PERIODE); } else { _LeRechercher.IsSelect = false; } } } } catch (Exception ex) { throw ex; } }
public static List <CsLotri> RetourneDistinctCentreFromCentre(List <ServiceAccueil.CsCentre> _LstCentre) { try { List <CsLotri> _lstCentreLotriDistinct = new List <CsLotri>(); var ListCentreTemp = (from p in _LstCentre group new { p } by new { p.CODE, p.PK_ID, p.LIBELLE } into pResult select new { pResult.Key.CODE, pResult.Key.PK_ID, pResult.Key.LIBELLE }); foreach (var item in ListCentreTemp) { CsLotri leCentreLot = new CsLotri() { CENTRE = item.CODE, FK_IDCENTRE = item.PK_ID, LIBELLECENTRE = item.LIBELLE }; _lstCentreLotriDistinct.Add(leCentreLot); } return(_lstCentreLotriDistinct); } catch (Exception ex) { throw ex; } }
private void ucgReturn(object sender, EventArgs e) { try { MainView.UcListeGenerique uc = sender as MainView.UcListeGenerique; if (uc.GetisOkClick) { CsLotri lot = (CsLotri)uc.MyObject; Txt_NumBatch.Text = lot.NUMLOTRI; this.Txt_NumBatch.Tag = lot; if (listeBatch.Where(u => u.NUMLOTRI == Txt_NumBatch.Text).Select(t => new { t.FK_IDCENTRE }).Distinct().ToList().Count() == 1) { this.Txt_Centre.Text = listeBatch.First().CENTRE; this.Txt_Centre.Tag = listeBatch.First(); } this.btn_Centre.IsEnabled = true; this.Txt_Centre.IsReadOnly = false; this.Txt_Centre.Text = string.Empty; } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
private void btn_Centre_Click(object sender, RoutedEventArgs e) { try { if (_ListeLotri != null) { this.btn_Centre.IsEnabled = false; CsLotri leLotSelect = new CsLotri(); if (this.Txt_NumBatch.Tag != null) { leLotSelect = (CsLotri)this.Txt_NumBatch.Tag; } List <CsLotri> _lstLotAfficher = ClasseMethodeGenerique.RetourneDistinctCentre(_ListeLotri.Where(t => t.NUMLOTRI == leLotSelect.NUMLOTRI && t.PERIODE == leLotSelect.PERIODE).ToList()); Dictionary <string, string> _LstColonneAffich = new Dictionary <string, string>(); _LstColonneAffich.Add("CENTRE", "CENTRE"); _LstColonneAffich.Add("LIBELLECENTRE", "LIBELLE"); foreach (CsLotri item in _lstLotAfficher) { item.CODE = item.CENTRE; item.LIBELLE = item.LIBELLECENTRE; } UcGenerique ctrl = new UcGenerique(_lstLotAfficher, true, "Liste des centres"); ctrl.Closed += new EventHandler(ucgCentre); ctrl.Show(); this.btn_Centre.IsEnabled = true; } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
void galatee_OkClickedBatch(object sender, EventArgs e) { UcListeGenerique ctrs = sender as UcListeGenerique; if (ctrs.isOkClick) { CsLotri _LeLotSelect = ctrs.MyObject as CsLotri; this.Txt_Lotri.Text = string.IsNullOrEmpty(_LeLotSelect.NUMLOTRI) ? string.Empty : _LeLotSelect.NUMLOTRI; } }
void galatee_OkClickedBtnZone1(object sender, EventArgs e) { MainView.UcListeGenerique ctrs = sender as MainView.UcListeGenerique; CsLotri tourneeDuLot = (CsLotri)ctrs.MyObject; if (tourneeDuLot != null) { this.Txt_zone.Text = tourneeDuLot.TOURNEE; this.Txt_zone.Tag = tourneeDuLot; } }
void galatee_OkClickedBatch(object sender, EventArgs e) { UcListeGenerique ctrs = sender as UcListeGenerique; if (ctrs.isOkClick) { CsLotri _LeLotSelect = ctrs.MyObject as CsLotri; this.Txt_Lotri.Text = string.IsNullOrEmpty(_LeLotSelect.NUMLOTRI) ? string.Empty : _LeLotSelect.NUMLOTRI; this.Txt_periode.Text = string.IsNullOrEmpty(_LeLotSelect.PERIODE) ? string.Empty : Galatee.Silverlight.Shared.ClasseMEthodeGenerique.FormatPeriodeMMAAAA(_LeLotSelect.PERIODE); this.Txt_Lotri.Tag = _LeLotSelect; } }
void galatee_OkClickedBatch(object sender, EventArgs e) { UcListeGenerique ctrs = sender as UcListeGenerique; if (ctrs.isOkClick) { _LeLotSelect = ctrs.MyObject as CsLotri; this.Txt_Lotri.Text = string.IsNullOrEmpty(_LeLotSelect.NUMLOTRI) ? string.Empty : _LeLotSelect.NUMLOTRI; this.Txt_periode.Text = string.IsNullOrEmpty(_LeLotSelect.PERIODE) ? string.Empty : _LeLotSelect.PERIODE; this.txt_jetEnCours.Text = string.IsNullOrEmpty(_LeLotSelect.JET) ? string.Empty : _LeLotSelect.JET; } }
private int EtatDeLaLigneDeLotri(CsLotri _leLotri) { int EtatLotri = 0; if (_leLotri.ETATFAC5 == "S") { return(EtatLotri); } if (_leLotri.ETATFAC1 == "P" || _leLotri.ETATFAC1 == "T") { EtatLotri = 1; } if (_leLotri.ETATFAC1 == "D" || _leLotri.ETATFAC1 == "E") { EtatLotri |= 2; } if (string.IsNullOrEmpty(_leLotri.ETATFAC2)) { EtatLotri |= 4; } // ctrl if (string.IsNullOrEmpty(_leLotri.ETATFAC3)) { EtatLotri |= 8; } // fac. imprimes if (string.IsNullOrEmpty(_leLotri.ETATFAC4)) { EtatLotri |= 16; } // maj abonnes if (string.IsNullOrEmpty(_leLotri.ETATFAC5)) { EtatLotri |= 32; } // majcomptes terminee if (_leLotri.ETATFAC5 == "M") { EtatLotri |= 64; } return(EtatLotri); }
private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { CsLotri _LeLotSelect = (CsLotri)this.dataGrid1.SelectedItem; if (_LeLotSelect != null) { } } catch (Exception ex) { throw ex; } }
void galatee_OkClickedBatch(object sender, EventArgs e) { try { MainView.UcListeGenerique ctrs = sender as MainView.UcListeGenerique; CsLotri param = (CsLotri)ctrs.MyObject;//.VALEUR; this.Txt_NumBatch.Text = param.NUMLOTRI; this.Txt_NumBatch.Tag = param; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
public static bool IsLotIsole(CsLotri leLot) { string FactureIsoleIndex = "00002"; string FactureResiliationIndex = "00001"; string FactureAnnulatinIndex = "00003"; if (new string[] { FactureIsoleIndex, FactureResiliationIndex, FactureAnnulatinIndex }.Contains(leLot.NUMLOTRI.Substring(SessionObject.Enumere.TailleCentre, (SessionObject.Enumere.TailleNumeroBatch - SessionObject.Enumere.TailleCentre)))) { return(true); } else { return(false); } }
private void OKButton_Click(object sender, RoutedEventArgs e) { try { List <CsLotri> _lstLotSelect = new List <CsLotri>(); CsLotri _leCritere = new CsLotri(); if (this.Txt_NumBatch.Tag != null) { ChargerEvenementTransfertListeLotri((CsLotri)this.Txt_NumBatch.Tag); } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
void getCloseAfterSelectionOne() { try { if (Closed != null) { ObjectSelect = Lst_Liste.SelectedItems.OfType <CsLotri>().FirstOrDefault(t => t.IsSelect); MyObject = ObjectSelect; Closed(this, new EventArgs()); } } catch (Exception ex) { throw ex; } }
private void ucgReturn(object sender, EventArgs e) { try { MainView.UcListeGenerique uc = sender as MainView.UcListeGenerique; if (uc.GetisOkClick) { CsLotri lot = (CsLotri)uc.MyObject; Txt_NumBatch.Text = lot.NUMLOTRI; this.Txt_NumBatch.Tag = lot; } } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }
private void chk_Unchecked_1(object sender, RoutedEventArgs e) { if (dataGridlLot.ItemsSource != null) { var lstProduit = ((List <CsLotri>)dataGridlLot.ItemsSource).ToList(); if (lstProduit != null && this.dataGridlLot.SelectedItem != null) { CsLotri leSelect = (CsLotri)this.dataGridlLot.SelectedItem; if (leSelect == null) { Message.ShowInformation("Sélectionner le lot", "Facturation"); return; } leSelect.IsSelect = false; dataGrid1.ItemsSource = null; } } }
private void dgMyDataGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { DataGrid dg = (sender as DataGrid); var allObjects = dg.ItemsSource as ObservableCollection <CsLotri>; if (dg.SelectedItem != null) { CsLotri SelectedObject = ((CsLotri )dg.SelectedItem); if (SelectedObject.IsSelect == false) { SelectedObject.IsSelect = true; } else { SelectedObject.IsSelect = false; } } }
private void ChargerEvenementTransfertListeLotri(CsLotri leLot) { try { FacturationServiceClient service = new FacturationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Facturation")); service.ChargerListeDesTransfertspCompleted += (s, args) => { try { if (args.Error != null && args.Cancelled) { Message.ShowError("Erreur d'invocation du service.", "Erreur"); return; } if (args.Result == null) { Message.ShowError("Aucune donnée retournée du système.", "Erreur"); return; } lstEvtTransf = new List <CsEvenement>(); Btn_Batch.IsEnabled = true; lstEvtTransf = args.Result; if (lstEvtTransf != null && lstEvtTransf.Count != 0) { dataGrid1.ItemsSource = null; } dataGrid1.ItemsSource = lstEvtTransf; this.txt_TotalLot.Text = lstEvtTransf.Count != 0 ? lstEvtTransf.Count().ToString() : "0"; this.txt_TotalSaisie.Text = lstEvtTransf.Count != 0 ? lstEvtTransf.Where(t => t.CAS != "##").Count().ToString() : "0"; } catch (Exception ex) { Message.ShowError(ex, "Erreur"); } }; service.ChargerListeDesTransfertspAsync(leLot); } catch (Exception ex) { throw ex; } }
private void chk_Checked_1(object sender, RoutedEventArgs e) { if (dataGridlLot.ItemsSource != null) { var lstSelect = ((List <CsLotri>)dataGridlLot.ItemsSource).ToList(); if (lstSelect != null && this.dataGridlLot.SelectedItem != null) { CsLotri leSelect = (CsLotri)this.dataGridlLot.SelectedItem; if (leSelect == null) { Message.ShowInformation("Sélectionner le lot", "Facturation"); return; } leSelect.IsSelect = true; dataGrid1.ItemsSource = null; dataGrid1.ItemsSource = ListeLotri.Where(t => t.NUMLOTRI == leSelect.NUMLOTRI).ToList(); } } }
private void dgMyDataGridMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { DataGrid dg = (sender as DataGrid); if (dg.SelectedItem != null) { CsLotri SelectedObject = (CsLotri)dg.SelectedItem; ((List <CsLotri>)dg.ItemsSource).Where(t => t.NUMLOTRI != SelectedObject.NUMLOTRI).ToList().ForEach(y => y.IsSelect = false); List <CsLotri> lesFactureSelect = ((List <CsLotri>)dg.ItemsSource).Where(t => t.NUMLOTRI == SelectedObject.NUMLOTRI).ToList(); if (SelectedObject.IsSelect == false) { lesFactureSelect.ForEach(t => t.IsSelect = true); } else { lesFactureSelect.ForEach(t => t.IsSelect = false); } } }
private void dgMyDataGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { DataGrid dg = (sender as DataGrid); var allObjects = dg.ItemsSource as List <CsLotri>; if (dg.SelectedItem != null) { CsLotri SelectedObject = (CsLotri)dg.SelectedItem; allObjects.Where(t => t.PK_ID != ((CsLotri)dg.SelectedItem).PK_ID).ToList().ForEach(t => t.IsSelect = false); if (SelectedObject.IsSelect == false) { SelectedObject.IsSelect = true; dataGrid1.ItemsSource = null; dataGrid1.ItemsSource = ListeLotri.Where(t => t.NUMLOTRI == SelectedObject.NUMLOTRI).ToList(); } else { dataGrid1.ItemsSource = null; SelectedObject.IsSelect = false; } } }
void galatee_OkClickedBtnZone2(object sender, EventArgs e) { this.btn_Tournee2.IsEnabled = true; MainView.UcListeGenerique ctrs = sender as MainView.UcListeGenerique; if (ctrs.isOkClick) { CsLotri tourneeDuLot = (CsLotri)ctrs.MyObject; if (tourneeDuLot != null) { this.Txt_Tournee2.Text = tourneeDuLot.TOURNEE; } if (string.IsNullOrEmpty(this.Txt_Tournee1.Text) && string.IsNullOrEmpty(this.Txt_Tournee2.Text)) { if (int.Parse(this.Txt_Tournee1.Text) > int.Parse(this.Txt_Tournee2.Text)) { Message.ShowInformation(Galatee.Silverlight.Resources.Index.Langue.msgTourneDebSupTouneeFin, Galatee.Silverlight.Resources.Index.Langue.libelleModule); return; } } } }