コード例 #1
0
        public bool Validate(HousingComplexDao housing)
        {
            if (val.StringValidate(housing.Address, 500) &&
                val.PrimaryKeyValidate(housing.HotelID) &&
                val.StringValidate(housing.Name, 200) &&
                val.StringValidate(housing.PhoneNumber, 20))
            {
                return(true);
            }


            return(false);
        }
コード例 #2
0
 public bool UpdateHousingComplex(HousingComplexDao hcomplex)
 {
     try
     {
         if (housingCVal.Validate(hcomplex))
         {
             return(ac.UpdateHousingComplex(emap.MapToData(hcomplex)));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #3
0
 public bool InsertHousingComplex(HousingComplexDao newhcomplex)
 {
     try
     {
         if (housingCVal.Validate(newhcomplex))
         {
             ac.InsertHousingComplex(emap.MapToData(newhcomplex));
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #4
0
        public HousingComplex MapToData(HousingComplexDao housing)
        {
            var mapper = HousingComplexMapper.CreateMapper();

            return(mapper.Map <HousingComplex>(housing));
        }
コード例 #5
0
        /// <summary>
        /// This method maps from a HousingComplexDao to a HousingComplexDto
        /// </summary>
        /// <param name="complex"></param>
        /// <returns>HousingComplexDto</returns>
        public HousingComplexDto MapToDto(HousingComplexDao complex)
        {
            var mapper = complexMapper.CreateMapper();

            return(mapper.Map <HousingComplexDto>(complex));
        }