/// <summary>
 /// Kiểm tra và thêm mới Address_category
 /// </summary>
 /// <param name="entity">Entity</param>
 /// <returns>Int32: ID của Address_category Mới Thêm Vào</returns>
 public static Int32 Add(Address_categoryEntity entity)
 {
     checkLogic(entity);
     checkDuplicate(entity, false);
     checkFK(entity);
     return Address_categoryDAL.Add(entity);
 }
 /// <summary>
 /// Kiểm tra và chỉnh sửa Address_category
 /// </summary>
 /// <param name="entity">Address_categoryEntity</param>
 /// <returns>bool:kết quả thực hiện</returns>
 public static bool Edit(Address_categoryEntity entity)
 {
     checkExist(entity._id);
     checkLogic(entity);
     checkDuplicate(entity, true);
     checkFK(entity);
     return Address_categoryDAL.Edit(entity);
 }
 /// <summary>
 /// Kiểm tra trùng lặp bản ghi
 /// </summary>
 /// <param name="entity">Address_categoryEntity: Address_categoryEntity</param>
 private static void checkDuplicate(Address_categoryEntity entity,bool checkPK)
 {
     /*
     Example
     List<Address_categoryEntity> list = Address_categoryDAL.GetAll();
     if (list.Exists(
         delegate(Address_categoryEntity oldEntity)
         {
             bool result =oldEntity.FIELD.Equals(entity.FIELD, StringComparison.OrdinalIgnoreCase);
             if(checkPK)
                 result=result && oldEntity.PK_iAddress_categoryID != entity.PK_iAddress_categoryID;
             return result;
         }
     ))
     {
         list.Clear();
         throw new Exception(EX_FIELD_EXISTED);
     }
     */
 }
 /// <summary>
 /// Kiểm tra logic Entity
 /// </summary>
 /// <param name="entity">Address_categoryEntity: entity</param>
 private static void checkLogic(Address_categoryEntity entity)
 {
     //if (String.IsNullOrEmpty(entity.sLastname))
     //    throw new Exception(EX_SLASTNAME_EMPTY);
 }
 /// <summary>
 /// Kiểm tra tồn tại khóa ngoại
 /// </summary>
 /// <param name="entity">Address_categoryEntity:entity</param>
 private static void checkFK(Address_categoryEntity entity)
 {
 }