public static Compte Maj(Compte cA) { Log.Logger.Debug("Debut Compte.Maj(" + cA.Id + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); Compte c = ob.Comptes.Find((ctemp) => ctemp.Id == cA.Id); c.Libelle = cA.Libelle; c.SoldeInitial = cA.SoldeInitial; c.Banque = cA.Banque; c.Guichet = cA.Guichet; c.NoCompte = cA.NoCompte; c.Clef = cA.Clef; c.MinGraphSold = cA.MinGraphSold; c.MaxGraphSold = cA.MaxGraphSold; c.SeuilAlerte = cA.SeuilAlerte; c.SeuilAlerteFinal = cA.SeuilAlerteFinal; c.TypEvol = cA.TypEvol; c.Utilisateur = cA.Utilisateur; c.EstDansTotalCompte = cA.EstDansTotalCompte; CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(cA); }
public static int ChercheChequeSuivant(Compte cA) { Log.Logger.Debug("Debut Echeancier.ChercheChequeSuivant(" + cA.Id + ")"); int retour = 0; try { OB ob = (OB)CallContext.GetData(KEY.OB); List <Operation> lo = ob.Operations.Where(ot => ot.Compte.Id == cA.Id && ot.ModePaiement.Id == 8).OrderByDescending(ot => ot.Date).ToList(); if (lo.Count > 0) { string[] tab = lo[0].Libelle.Split('°'); if (tab.Length > 1) { bool b = int.TryParse(tab[1], out retour); retour++; if (!b) { retour = 0; } } } } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(retour); }
/// <summary> /// Permet de mettre a jour un parametre /// </summary> /// <param name="p">Parametre a mettre a jour</param> public static Param Maj(Param pA) { Log.Logger.Debug("Debut Param.Maj(" + pA.Id + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); Param p = ob.Params.Find((ptemp) => ptemp.Id == pA.Id); p.Ident = pA.Ident; p.Val1 = pA.Val1; p.Val2 = pA.Val2; p.Val3 = pA.Val3; p.Int1 = pA.Int1; p.Int2 = pA.Int2; p.Int3 = pA.Int3; p.Dec1 = pA.Dec1; p.Dec2 = pA.Dec2; p.Dec3 = pA.Dec3; p.Dat1 = pA.Dat1; p.Dat2 = pA.Dat2; p.Dat3 = pA.Dat3; CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(pA); }
public static DataSet DataSet() { DataSet ds = new DataSet(); DataTable t = new DataTable("Fichiers"); ds.Tables.Add(t); t.Columns.Add("Id", typeof(int)); t.Columns.Add("Date Import", typeof(DateTime)); t.Columns.Add("Nom", typeof(string)); t.Columns.Add("Type", typeof(string)); t.Columns.Add("Chemin", typeof(string)); t.Columns.Add("Tiers Op.", typeof(string)); t.Columns.Add("Libelle Op.", typeof(string)); t.Columns.Add("Montant Op.", typeof(double)); OB ob = (OB)CallContext.GetData(KEY.OB); foreach (Fichier item in ob.Fichiers) { DataRow row = t.NewRow(); row["Id"] = item.Id; row["Date Import"] = item.Date; row["Type"] = item.Type; row["Nom"] = item.InitialName; row["Chemin"] = item.Chemin; row["Tiers Op."] = item.Operation.Tiers; row["Libelle Op."] = item.Operation.Libelle; row["Montant Op."] = item.Operation.Montant; t.Rows.Add(row); } return(ds); }
public static void Delete(ModePaiement mpA) { Log.Logger.Debug("Debut ModePaiement.Delete(" + mpA.Id + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); ob.ModePaiements.RemoveAll((mp) => mp.Id == mpA.Id); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } }
public static void Delete(Utilisateur uA) { Log.Logger.Debug("Debut Utilisateur.Delete(" + uA.Id + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); ob.Utilisateurs.RemoveAll((u) => u.Id == uA.Id); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } }
public static void Delete(Fichier f) { Log.Logger.Debug("Debut Fichier.Delete(" + f.Id + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); ob.Fichiers.RemoveAll(ft => ft.Id == f.Id); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } }
public static void Delete(TotalCompte tcA) { Log.Logger.Debug("Debut TotalCompte.Delete(" + tcA.Id + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); ob.ListeTotalCompte.RemoveAll((tc) => tc.Id == tcA.Id); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } }
/// <summary> /// Pouvoir supprimer un ou plusieurs parametre celon l'identifiant /// </summary> /// <param name="ident">Identifiant du ou des parametre a supprimer</param> public static void Delete(string ident) { Log.Logger.Debug("Debut Param.Delete(" + ident + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); ob.Params.RemoveAll((p) => p.Ident == ident); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } }
public static void Delete(Operation oP) { Log.Logger.Debug("Debut Operation.Delete(" + oP.Id + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); ob.Operations.RemoveAll((o) => o.Id == oP.Id); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } }
/// <summary> /// Permet de creer un parametre /// </summary> /// <param name="p">Parametre a creer</param> public static Param Sauve(Param p) { Log.Logger.Debug("Debut Param.Sauve(" + p.Ident + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); p.Id = ob.Params.Count != 0 ? ob.Params.Max(u => u.Id) + 1 : 1; ob.Params.Add(p); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(p); }
public static List <Compte> ChargeTout(Utilisateur u) { Log.Logger.Debug("Debut Compte.ChargeTout()"); List <Compte> lc = new List <Compte>(); try { OB ob = (OB)CallContext.GetData(KEY.OB); lc = ob.Comptes.Where(c => c.Utilisateur.Id == u.Id).OrderBy(c => c.Libelle).ToList(); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(lc); }
/// <summary> /// Chargement d'une liste de parametre /// </summary> /// <param name="ident">Identifiant de la liste de parametre a charger</param> /// <returns>Liste de Parametre</returns> public static List <Param> Charge(string ident) { Log.Logger.Debug("Debut Categorie.Charge(" + ident + ")"); List <Param> lp = new List <Param>(); try { OB ob = (OB)CallContext.GetData(KEY.OB); lp = ob.Params.Where(pt => pt.Ident == ident).ToList(); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(lp); }
/// <summary> /// Chargement d'un parametre /// </summary> /// <param name="id">Id du parametre</param> /// <returns>Parametre charge</returns> public static Param Charge(int id) { Log.Logger.Debug("Debut Categorie.Charge(" + id + ")"); Param p = new Param(); try { OB ob = (OB)CallContext.GetData(KEY.OB); p = ob.Params.Find(pt => pt.Id == id); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(p); }
public static ModePaiement Charge(int id) { Log.Logger.Debug("Debut ModePaiement.Charge(" + id + ")"); ModePaiement mp = new ModePaiement(); try { OB ob = (OB)CallContext.GetData(KEY.OB); mp = ob.ModePaiements.Where(mpt => mpt.Id == id).First(); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(mp); }
public static Compte Charge(int id) { Log.Logger.Debug("Debut Compte.Charge(" + id + ")"); Compte c = new Compte(); try { OB ob = (OB)CallContext.GetData(KEY.OB); c = ob.Comptes.Where(ct => ct.Id == id).First(); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(c); }
/// <summary> /// Chargement de tous les parametres /// </summary> /// <returns>Lsite de Param</returns> public static List <Param> ChargeTout() { Log.Logger.Debug("Debut Param.ChargeTout()"); List <Param> lp = new List <Param>(); try { OB ob = (OB)CallContext.GetData(KEY.OB); lp = ob.Params; } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(lp); }
public static Compte Sauve(Compte cA) { Log.Logger.Debug("Debut Copmpte.Sauve(" + cA.Libelle + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); cA.Id = ob.Comptes.Count != 0 ? ob.Comptes.Max(u => u.Id) + 1 : 1; ob.Comptes.Add(cA); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(cA); }
public static List <Operation> ChargeToutUtilisateur(Utilisateur u) { Log.Logger.Debug("Debut Operation.ChargeToutUtilisateur(" + u.Login + ")"); List <Operation> lo = new List <Operation>(); try { OB ob = (OB)CallContext.GetData(KEY.OB); lo = ob.Operations.Where(ot => ot.Compte.Utilisateur.Id == u.Id).ToList(); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(lo); }
public static Operation Sauve(Operation o) { Log.Logger.Debug("Debut Operation.Sauve(" + o.Libelle + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); o.Id = ob.Operations.Count != 0 ? ob.Operations.Max(u => u.Id) + 1 : 1; ob.Operations.Add(o); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(o); }
public static Operation Charge(int id) { Log.Logger.Debug("Debut Operation.Charge(" + id + ")"); Operation o = new Operation(); try { OB ob = (OB)CallContext.GetData(KEY.OB); o = ob.Operations.Find(ot => ot.Id == id); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(o); }
public static DateTime GetMinDate(Compte cP) { Log.Logger.Debug("Debut Operation.SoldeCompteAt(" + cP.Id + ")"); DateTime retour = DateTime.Now; try { OB ob = (OB)CallContext.GetData(KEY.OB); retour = ob.Operations.Where(ot => ot.Compte.Id == cP.Id).Min(ot => ot.Date); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(retour); }
public static TotalCompte Charge(int id) { Log.Logger.Debug("Debut TotalCompte.Charge(" + id + ")"); TotalCompte tc = new TotalCompte(); try { OB ob = (OB)CallContext.GetData(KEY.OB); tc = ob.ListeTotalCompte.Where(ttc => ttc.Id == id).First(); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(tc); }
public static Utilisateur Charge(string login) { Log.Logger.Debug("Debut Utilisateur.Charge(" + login + ")"); Utilisateur retour = new Utilisateur(); try { OB ob = (OB)CallContext.GetData(KEY.OB); retour = ob.Utilisateurs.Find((u) => u.Login == login); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(retour ?? new Utilisateur()); }
public static List <Utilisateur> ChargeTout() { Log.Logger.Debug("Debut Utilisateur.ChargeTous()"); List <Utilisateur> lu = new List <Utilisateur>(); try { OB ob = (OB)CallContext.GetData(KEY.OB); lu = ob.Utilisateurs; } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(lu); }
public List <Operation> Operations() { Log.Logger.Debug("Debut Operations()"); List <Operation> lo = new List <Operation>(); try { OB ob = (OB)CallContext.GetData(KEY.OB); lo = ob.Operations.Where(ot => ot.Compte.Id == Id).OrderByDescending(x => x.Date).ToList(); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(lo); }
public static Utilisateur Charge(int id) { Log.Logger.Debug("Debut Utilisateur.Charge(" + id + ")"); Utilisateur retour = new Utilisateur(); try { OB ob = (OB)CallContext.GetData(KEY.OB); retour = ob.Utilisateurs.Find((u) => u.Id == id); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(retour); }
public static ModePaiement Sauve(ModePaiement mpA) { Log.Logger.Debug("Debut ModePaiement.Sauve(" + mpA.Libelle + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); mpA.Id = ob.ModePaiements.Count != 0 ? ob.ModePaiements.Max(u => u.Id) + 1 : 1; ob.ModePaiements.Add(mpA); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(mpA); }
public static Utilisateur Sauve(Utilisateur uA) { Log.Logger.Debug("Debut Utilisateur.Sauve(" + uA.Login + ")"); try { OB ob = (OB)CallContext.GetData(KEY.OB); uA.Id = ob.Utilisateurs.Count != 0 ? ob.Utilisateurs.Max(u => u.Id) + 1 : 1; ob.Utilisateurs.Add(uA); CallContext.SetData(KEY.OB, ob); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(uA); }
public static List <ModePaiement> ChargeTout() { Log.Logger.Debug("Debut ModePaiement.ChargeTout()"); List <ModePaiement> lmp = new List <ModePaiement>(); try { OB ob = (OB)CallContext.GetData(KEY.OB); lmp = ob.ModePaiements.OrderBy(mp => mp.Libelle).ToList(); } catch (Exception ex) { Log.Logger.Error(ex.Message); throw; } return(lmp); }