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); }
public bool UpdateHousingComplex(HousingComplexDao hcomplex) { try { if (housingCVal.Validate(hcomplex)) { return(ac.UpdateHousingComplex(emap.MapToData(hcomplex))); } else { return(false); } } catch (Exception) { return(false); } }
public bool InsertHousingComplex(HousingComplexDao newhcomplex) { try { if (housingCVal.Validate(newhcomplex)) { ac.InsertHousingComplex(emap.MapToData(newhcomplex)); return(true); } else { return(false); } } catch (Exception) { return(false); } }
public HousingComplex MapToData(HousingComplexDao housing) { var mapper = HousingComplexMapper.CreateMapper(); return(mapper.Map <HousingComplex>(housing)); }
/// <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)); }