コード例 #1
0
ファイル: Facade.cs プロジェクト: vosonhiep/QuanLyQuanCF
 public void Save(IAccount Base)
 {
     // Design pattern :- Facade pattern
     Base.Validate();
     dao.Add(Base);
     dao.Save();
 }
コード例 #2
0
 public void Save(ICustomer Base)
 {
     // Design pattern :- Facade pattern
     Base.Validate();
     dal.Add(Base);
     dal.Save();
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 public bool Add()
 {
     if (Name.Length == 0)
     {
         return(false);
     }
     if (objDataDB.Add(""))
     {
         Name = "Welcome " + Name;
     }
     return(true);
 }
コード例 #5
0
 public bool Add()
 {
     if (name.Length == 0)
     {
         return(false);
     }
     if (db.Add(""))
     {
         name = "Welcome " + name; // code will never
     }
     return(true);
 }
コード例 #6
0
 public void Add()
 {
     idatlayer.Add();
 }