示例#1
0
 public LandlordDTO(LandlordDTO copy)
 {
     Id       = copy.Id;
     Forename = copy.Forename;
     Surname  = copy.Surname;
     Email    = copy.Email;
     Phone    = copy.Phone;
 }
示例#2
0
        public void UpdateLandLord(LandlordDTO landLord)
        {
            var original = dataContext.Landlords.Single(ll => ll.LandlordId == landLord.Id);

            original.Forename = landLord.Forename;
            original.Surname  = landLord.Surname;
            original.Email    = landLord.Email;
            original.Phone    = landLord.Phone;

            dataContext.SubmitChanges();
        }
示例#3
0
        public int CreateLandLord(LandlordDTO dto)
        {
            if (dto is null)
            {
                return(0);
            }

            var landlord = new Landlord()
            {
                Forename = dto.Forename,
                Surname  = dto.Surname,
                Email    = dto.Email,
                Phone    = dto.Phone
            };

            dataContext.Landlords.InsertOnSubmit(landlord);

            dataContext.SubmitChanges();

            return(landlord.LandlordId);
        }