예제 #1
0
        public ActionResult SaveApartament(Apartament apartament)
        {
            if(!ModelState.IsValid)
                return View("Rent", apartament);

            apartament.UserId = User.GetUserInfo().Id;
            apartament.CreateDate = DateTime.Now;

            _apartamentService.SaveApartament(apartament);

            return RedirectToAction("UserPage", "Account");
        }
예제 #2
0
        public bool SaveApartament(Apartament apartament)
        {
            bool result;

            if (apartament.Id != 0)
            {
                result = _apartamentRepository.UpdateAparament(apartament);
            }
            else
            {
                result = _apartamentRepository.CreateAparament(apartament);

                if (result)
                {

                }
            }

            return result;
        }