Exemple #1
0
 public bool add(loaitour entity)
 {
     if (validate(entity))
     {
         return(loaitour.Add(entity));
     }
     return(false);
 }
Exemple #2
0
 public bool validate(loaitour entity)
 {
     if (entity.tenloaitour.Trim().Length == 0)
     {
         validatedictionary.Add("TENLOAI", "Không được để trống tên loại tour");
     }
     if (find(entity.tenloaitour) == false)
     {
         validatedictionary.Add("DATONTAI", "Đã tồn tại địa điểm trong CSDL");
     }
     if (validatedictionary.Count() <= 0)
     {
         return(true);
     }
     return(false);
 }