public void Save(IAccount Base) { // Design pattern :- Facade pattern Base.Validate(); dao.Add(Base); dao.Save(); }
public void Save(ICustomer Base) { // Design pattern :- Facade pattern Base.Validate(); dal.Add(Base); dal.Save(); }
public void Add(Student student) { Contract.Requires(student != null, "Model is null"); Contract.Requires(student.Cnp != null, "Cnp cannot be null"); Contract.Requires(student.FirstName != null, "FirstName cannot be null"); Contract.Requires(student.LastName != null, "LastName cannot be null"); Contract.Requires(student.FathersInitial != null, "FathersInitial cannot be null"); Contract.Requires(student.StudentId != null, "StudentId cannot be null"); Contract.Requires(student.Cnp.Length == 13, "Provided CNP is invalid"); Contract.Requires(student.FathersInitial.Length == 1, "Father's initial should contain only one character"); StudentService.Add(student); }
public bool Add() { if (Name.Length == 0) { return(false); } if (objDataDB.Add("")) { Name = "Welcome " + Name; } return(true); }
public bool Add() { if (name.Length == 0) { return(false); } if (db.Add("")) { name = "Welcome " + name; // code will never } return(true); }
public void Add() { idatlayer.Add(); }