internal Client(String N, String P, String Cnp, String Ad, String Em, float Vl, RataCredit Rc) { Nume = N; Prenume = P; this.Cnp = Cnp; Adresa = Ad; Email = Em; RataCredit = Rc; VenitLunar = Vl; }
//Ca si in cazul conturilor, un client poate fi creat doar prin intermediul apelului acestei metode public static Client CreeazaClient(String N, String P, String Cnp, String Ad, String Em, float Vl, RataCredit Rc) { return(new Client(N, P, Cnp, Ad, Em, Vl, Rc)); }
public void AdaugaClient(String N, String P, String Cnp, String Ad, String Em, float Vl, RataCredit Rc) { Client clientNou = ClientFactory.CreeazaClient(N, P, Cnp, Ad, Em, Vl, Rc); var exists = _clienti._clienti.Any(x => x.Cnp == clientNou.Cnp); if (exists) { throw new CnpDuplicat(clientNou.Cnp); } else { _clienti._clienti.Add(clientNou); } }