private void Txt_CodeTarif_TextChanged(object sender, TextChangedEventArgs e) { if (!string.IsNullOrEmpty(this.Txt_CodeTarif.Text) && LstTarif != null && LstTarif.Count != 0 && this.Txt_CodeTarif.Text.Length == SessionObject.Enumere.TailleTarif) { CsTarif _LeTarif = ClasseMEthodeGenerique.RetourneObjectFromList(LstTarif, this.Txt_CodeTarif.Text, "CODE"); if (_LeTarif != null) { this.Txt_LibelleTarif.Text = _LeTarif.LIBELLE; this.Txt_CodeTarif.Tag = _LeTarif.PK_ID; EnregistrerDemande(LaDemande); this.btn_PussSouscrite.IsEnabled = true; LstPuissanceTarif = SessionObject.LstTarifPuissance.Where(t => t.PK_ID == _LeTarif.PK_ID).ToList(); //LstPuissanceTarif.ForEach(t => t.CODEPUISSANCE = (decimal.Parse(t.CODEPUISSANCE)).ToString()); } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodeTarif.Focus(); }; w.Show(); } } }
public bool Update(CsTarif pTarifs) { try { return Entities.UpdateEntity<Galatee.Entity.Model.TYPETARIF>(Entities.ConvertObject<Galatee.Entity.Model.TYPETARIF, CsTarif>(pTarifs)); } catch (Exception ex) { throw ex; } }
public List<CsTarif> SelectTarifByTarifCentreProduit(CsTarif pTarif) { try { return Entities.GetEntityListFromQuery<CsTarif>(ParamProcedure.PARAM_TARIFRETOURNEById(pTarif.PK_ID)); } catch (Exception ex) { throw ex; } }
public bool Insert(CsTarif pTarifs) { try { TYPETARIF letar = Entities.ConvertObject<Galatee.Entity.Model.TYPETARIF, CsTarif>(pTarifs); return Entities.InsertEntity<Galatee.Entity.Model.TYPETARIF>(letar); } catch (Exception ex) { throw ex; } }
private void RemplireLibelle() { try { if (SessionObject.LstFrequence.Count != 0 && this.Txt_CodeFrequence.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsFrequence _LaFrequence = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstFrequence, this.Txt_CodeFrequence.Text, "CODE"); if (_LaFrequence != null) { this.Txt_LibelleFrequence.Text = _LaFrequence.LIBELLE; } } if (SessionObject.LstMois.Count != 0 && this.Txt_CodeMoisIndex.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstMois, this.Txt_CodeMoisIndex.Text, "CODE"); if (_LeMois != null) { this.Txt_LibelleMoisIndex.Text = _LeMois.LIBELLE; } } if (SessionObject.LstMois.Count != 0 && this.Txt_CodeMoisFacturation.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstMois, this.Txt_CodeMoisFacturation.Text, "CODE"); if (_LeMois != null) { this.Txt_LibMoisFact.Text = _LeMois.LIBELLE; } } if (SessionObject.LstForfait.Count != 0 && this.Txt_CodeForfait.Text.Length == SessionObject.Enumere.TailleForfait) { CsForfait _LeForfait = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstForfait, this.Txt_CodeForfait.Text, "CODE"); if (_LeForfait != null) { this.Txt_LibelleForfait.Text = _LeForfait.LIBELLE; } } if (!string.IsNullOrEmpty(this.Txt_CodeTarif.Text) && SessionObject.LstTarif != null && SessionObject.LstTarif.Count != 0 && this.Txt_CodeTarif.Text.Length == SessionObject.Enumere.TailleTarif) { CsTarif _LeTarif = ClasseMEthodeGenerique.RetourneObjectFromList(SessionObject.LstTarif, this.Txt_CodeTarif.Text, "CODE"); if (_LeTarif != null) { this.Txt_LibelleTarif.Text = _LeTarif.LIBELLE; } } } catch (Exception ex) { throw ex; } }
private void galatee_OkClickedBtnTarif(object sender, EventArgs e) { try { this.btn_tarifs.IsEnabled = true; UcListeGenerique ctrs = sender as UcListeGenerique; if (ctrs.isOkClick) { CsTarif _LeTarif = (CsTarif)ctrs.MyObject; this.Txt_CodeTarif.Text = _LeTarif.CODE; } } catch (Exception ex) { Message.ShowError(ex.Message + "galatee_OkClickedBtnTarif", Langue.lbl_Menu); } }
private void galatee_OkClickedBtnpuissanceSouscrite(object sender, EventArgs e) { try { UcListeGenerique ctrs = sender as UcListeGenerique; if (ctrs.isOkClick) { CsTarif _LaPuissanceSelect = (CsTarif)ctrs.MyObject; //this.Txt_CodePussanceSoucrite.Text =(decimal.Parse( _LaPuissanceSelect.CODEPUISSANCE )).ToString(); //this.Txt_CodePussanceSoucrite.Tag = _LaPuissanceSelect.FK_IDPUISSANCE ; } this.btn_PussSouscrite.IsEnabled = true; } catch (Exception ex) { Message.ShowError(ex.Message, Langue.lbl_Menu); } }
private List <CsTarif> GetInformationsFromScreen() { var listObjetForInsertOrUpdate = new List <CsTarif>(); try { if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation) { var tarif = new CsTarif { CODE = Txt_Code.Text, FK_IDPRODUIT = ((CsProduit)CboProduit.SelectedItem).PK_ID, PRODUIT = ((CsProduit)CboProduit.SelectedItem).CODE, LIBELLE = Txt_Libelle.Text, DATECREATION = DateTime.Now, USERCREATION = UserConnecte.matricule }; if (!string.IsNullOrEmpty(Txt_Code.Text) && donnesDatagrid.FirstOrDefault(p => p.CODE == tarif.CODE && p.PRODUIT == tarif.PRODUIT && p.CODE == tarif.CODE) != null) { throw new Exception(Languages.CetElementExisteDeja); } listObjetForInsertOrUpdate.Add(tarif); } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification) { ObjetSelectionnee.CODE = Txt_Code.Text; ObjetSelectionnee.LIBELLE = Txt_Libelle.Text; //ObjetSelectionnee.FK_IDCENTRE = ((CsCentre)CboCentre.SelectedItem).PK_ID; ObjetSelectionnee.FK_IDPRODUIT = ((CsProduit)CboProduit.SelectedItem).PK_ID; ObjetSelectionnee.DATECREATION = DateTime.Now; ObjetSelectionnee.USERCREATION = UserConnecte.matricule; listObjetForInsertOrUpdate.Add(ObjetSelectionnee); } return(listObjetForInsertOrUpdate); } catch (Exception ex) { Message.ShowError(ex.Message, Languages.Tarif); return(null); } }
public UcTarif(CsTarif pObject, SessionObject.ExecMode pExecMode, DataGrid pGrid) { try { InitializeComponent(); Translate(); var Tarif = new CsTarif(); if (pObject != null) { ObjetSelectionnee = Utility.ParseObject(Tarif, pObject as CsTarif); } ModeExecution = pExecMode; dataGrid = pGrid; RemplirListeDesCentreExistant(); RemplirProduit(); if (dataGrid != null) { donnesDatagrid = dataGrid.ItemsSource as ObservableCollection <CsTarif>; } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification || (SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation) { if (ObjetSelectionnee != null) { Txt_Code.Text = ObjetSelectionnee.CODE; Txt_Libelle.Text = ObjetSelectionnee.LIBELLE; btnOk.IsEnabled = false; //Txt_Code.IsReadOnly = true; } } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Consultation) { AllInOne.ActivateControlsFromXaml(LayoutRoot, false); } VerifierSaisie(); } catch (Exception ex) { Message.ShowError(ex.Message, Languages.Tarif); } }
private void UpdateParentList(CsTarif pTarif) { try { if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Creation) { donnesDatagrid.Add(pTarif); donnesDatagrid.OrderBy(p => p.PK_ID); } if ((SessionObject.ExecMode)ModeExecution == SessionObject.ExecMode.Modification) { var Tarif = donnesDatagrid.First(p => p.PK_ID == pTarif.PK_ID); donnesDatagrid.Remove(Tarif); donnesDatagrid.Add(pTarif); donnesDatagrid.OrderBy(p => p.PK_ID); } } catch (Exception ex) { throw ex; } }
private void Txt_CodePussanceSoucrite_TextChanged(object sender, TextChangedEventArgs e) { if (LstPuissanceTarif != null && LstPuissanceTarif.Count != 0) //&& this.Txt_CodePussanceSoucrite .Text.Length == SessionObject.Enumere.) { CsTarif _LaPuissance = ClasseMEthodeGenerique.RetourneObjectFromList(LstPuissanceTarif, this.Txt_CodePussanceSoucrite.Text, "CODEPUISSANCE"); if (_LaPuissance != null) { this.Txt_CodePussanceSoucrite.Tag = _LaPuissance.PK_ID; EnregistrerDemande(LaDemande); } else { var w = new MessageBoxControl.MessageBoxChildWindow(Langue.lbl_Menu, Langue.MsgEltInexistent, MessageBoxControl.MessageBoxButtons.Ok, MessageBoxControl.MessageBoxIcon.Information); w.OnMessageBoxClosed += (_, result) => { this.Txt_CodePussanceSoucrite.Focus(); }; w.Show(); } } }
private void AfficherInfoAbonnement(CsAbon _LeAbonnementdemande) { try { if (_LeAbonnementdemande.PUISSANCE != null) { this.Txt_CodePussanceSoucrite.Text = Convert.ToDecimal(_LeAbonnementdemande.PUISSANCE.ToString()).ToString("N2"); } if (_LeAbonnementdemande.PUISSANCEUTILISEE != null) { this.Txt_CodePuissanceUtilise.Text = Convert.ToDecimal(_LeAbonnementdemande.PUISSANCEUTILISEE.Value).ToString("N2"); } this.Txt_CodeRistoune.Text = string.IsNullOrEmpty(_LeAbonnementdemande.RISTOURNE.ToString()) ? string.Empty :Convert.ToDecimal(_LeAbonnementdemande.RISTOURNE.Value).ToString("N2"); this.Txt_CodeForfait.Text = string.IsNullOrEmpty(_LeAbonnementdemande.FORFAIT) ? string.Empty : _LeAbonnementdemande.FORFAIT; this.Txt_CodeTarif.Text = string.IsNullOrEmpty(_LeAbonnementdemande.TYPETARIF) ? string.Empty : _LeAbonnementdemande.TYPETARIF; this.Txt_CodeFrequence.Text = string.IsNullOrEmpty(_LeAbonnementdemande.PERFAC) ? string.Empty : _LeAbonnementdemande.PERFAC; this.Txt_CodeMoisIndex.Text = string.IsNullOrEmpty(_LeAbonnementdemande.MOISREL) ? string.Empty : _LeAbonnementdemande.MOISREL; this.Txt_CodeMoisFacturation.Text = string.IsNullOrEmpty(_LeAbonnementdemande.MOISFAC) ? string.Empty : _LeAbonnementdemande.MOISFAC; this.Txt_DateAbonnement.Text = (_LeAbonnementdemande.DABONNEMENT == null) ? DateTime.Now.ToShortDateString() : Convert.ToDateTime(_LeAbonnementdemande.DABONNEMENT.Value).ToShortDateString(); this.Txt_DateResiliation.Text = (_LeAbonnementdemande.DRES == null) ? string.Empty : Convert.ToDateTime(_LeAbonnementdemande.DRES.Value).ToShortDateString(); if (LstForfait.Count != 0 && this.Txt_CodeForfait.Text.Length == SessionObject.Enumere.TailleForfait) { CsForfait _LeForfait = ClasseMEthodeGenerique.RetourneObjectFromList(LstForfait, this.Txt_CodeForfait.Text, "CODE"); if (_LeForfait != null) { this.Txt_LibelleForfait.Text = _LeForfait.LIBELLE; this.Txt_CodeForfait.Tag = _LeForfait.PK_ID; EnregistrerDemande(LaDemande); } } if (!string.IsNullOrEmpty(this.Txt_CodeTarif.Text) && LstTarif != null && LstTarif.Count != 0 && this.Txt_CodeTarif.Text.Length == SessionObject.Enumere.TailleTarif) { CsTarif _LeTarif = ClasseMEthodeGenerique.RetourneObjectFromList(LstTarif, this.Txt_CodeTarif.Text, "CODE"); if (_LeTarif != null) { this.Txt_LibelleTarif.Text = _LeTarif.LIBELLE; this.Txt_CodeTarif.Tag = _LeTarif.PK_ID; EnregistrerDemande(LaDemande); } } if (LstFrequence.Count != 0 && this.Txt_CodeFrequence.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsFrequence _LaFrequence = ClasseMEthodeGenerique.RetourneObjectFromList(LstFrequence, this.Txt_CodeFrequence.Text, "CODE"); if (_LaFrequence != null) { if (_LaFrequence.LIBELLE != null) { this.Txt_LibelleFrequence.Text = _LaFrequence.LIBELLE; this.Txt_CodeFrequence.Tag = _LaFrequence.PK_ID; EnregistrerDemande(LaDemande); } } } if (LstMois.Count != 0 && this.Txt_CodeMoisFacturation.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(LstMois, this.Txt_CodeMoisFacturation.Text, "CODE"); if (_LeMois != null) { if (_LeMois.LIBELLE != null) { this.Txt_LibMoisFact.Text = _LeMois.LIBELLE; this.Txt_CodeMoisFacturation.Tag = _LeMois.PK_ID; EnregistrerDemande(LaDemande); } } } if (LstMois.Count != 0 && this.Txt_CodeMoisIndex.Text.Length == SessionObject.Enumere.TailleMoisDeFacturation) { CsMois _LeMois = ClasseMEthodeGenerique.RetourneObjectFromList(LstMois, this.Txt_CodeMoisIndex.Text, "CODE"); if (_LeMois != null) { this.Txt_LibelleMoisIndex.Text = _LeMois.LIBELLE; this.Txt_CodeMoisIndex.Tag = _LeMois.PK_ID; EnregistrerDemande(LaDemande); } } if (LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.DimunitionPuissance || LaDemande.LaDemande.TYPEDEMANDE == SessionObject.Enumere.AugmentationPuissance) { Txt_CodeTarif.IsReadOnly = true; Txt_CodePuissanceUtilise.IsReadOnly = true; Txt_CodeRistoune.IsReadOnly = true; Txt_CodeForfait.IsReadOnly = true; Txt_CodeFrequence.IsReadOnly = true; Txt_CodeMoisFacturation.IsReadOnly = true; Txt_CodeMoisIndex.IsReadOnly = true; } } catch (Exception ex) { throw ex; } }