private void InitWithDogProfile(DogProfile dogProfile) { ProfileID = dogProfile.ProfileID; Name = dogProfile.Name; Breed = dogProfile.Breed; BirthYear = dogProfile.BirthYear; Color = dogProfile.Color; Gender = dogProfile.Gender; PickedUpDate = dogProfile.PickedUpDate; IsFixed = dogProfile.IsFixed; GraduationDate = dogProfile.GraduationDate; CreatedTimeUTC = dogProfile.CreatedTimeUTC; CreatedByUserID = dogProfile.CreatedByUserID; IsApproved = dogProfile.IsApproved; LocationId = dogProfile.LocationId; HealthCondition = dogProfile.HealthCondition; DogEvents = dogProfile.DogEvents; DogMedicalRecords = dogProfile.DogMedicalRecords; DogNotes = dogProfile.DogNotes; DogSkills = dogProfile.DogSkills; Location = dogProfile.Location; Images = dogProfile.Images; DogMedications = dogProfile.DogMedications; LocationDescription = dogProfile.LocationDescription; }
// // GET: /Notes?dog={dogProfileId} public ActionResult Index(DogProfile dog) { var model = _dogNoteRepo.Where(n => n.DogProfileID == dog.ProfileID); SetDogViewBag(dog); return View(model); }
public virtual ActionResult Create(DogProfile dog) { var model = new DogCertification { DogProfileID = dog.ProfileID }; SetDogViewBag(dog); return View(model); }
// // GET: /Notes?dog={dogProfileId} public virtual ActionResult Index(DogProfile dog) { var model = _dogNoteRepo.Where(n => n.DogProfileID == dog.ProfileID).Include(x => x.DogNoteAttachments); SetDogViewBag(dog); return View(model); }
public virtual ActionResult Create(DogProfile dog) { if (dog == null) return HttpNotFound(); SetDogViewBag(dog); return View(); }
// // GET: /MedicalRecords?dog={dogProfileId} public virtual ActionResult Index(DogProfile dog) { if (dog == null) return RedirectToAction("Index", "Dog"); SetDogViewBag(dog); var model = _dogMedicalRecordsRepo.Where(record => record.DogProfileID == dog.ProfileID).Include(i => i.MedicalRecordType).ToList(); return View(model); }
public virtual ActionResult Create(DogProfile model) { if (!ModelState.IsValid) return View(model); //model.CreatedByUserID = CurrentUserId; _dogRepo.Insert(model); return RedirectToAction("Index"); }
public virtual ActionResult Create(DogProfile dog) { if (dog == null) return RedirectToAction("Index", "Dog"); ViewBag.MedicalRecordTypesSelectList = new SelectList(_medicalRecordTypesRepo.GetAll(), "MedicalRecordTypeID", "Name"); SetDogViewBag(dog); return View(new DogMedicalRecord { DogProfileID = dog.ProfileID }); }
public ActionResult Create(DogProfile dog) { // verify dog exists if (dog == null) return RedirectToAction("Index", "Dog"); SetDogViewBag(dog); ViewBag.EventTypeSelectList = new SelectList(_eventTypesRepo.GetAll(), "ID", "Name", null); var model = new DogEvent { DogProfileID = dog.ProfileID, EventDate = DateTime.Now.Date }; return View(model); }
public ActionResult CreateOrUpdateDog(DogProfile dogProfile) { var user = _userRepo.Where(u => u.Email == HttpContext.User.Identity.Name).FirstOrDefault(); if (!user.IsUserAdminOrTrainer()) return RedirectToAction("Error403", "Error");; if (dogProfile.ProfileID == 0) { dogProfile.CreatedByUserID = user.UserID; _dogRepo.Insert(dogProfile); } else { _dogRepo.Update(dogProfile); } return RedirectToAction("Index"); }
// // GET: /Events?dog={dogProfileId} public ActionResult Index(DogProfile dog) { // verify dog exists if (dog == null) return RedirectToAction("Index", "Dog"); var model = _dogEventsRepo.Where(d => d.DogProfileID == dog.ProfileID).OrderByDescending(i => i.EventDate).ToList(); SetDogViewBag(dog); return View(model); }
public virtual ActionResult Index(DogProfile dog) { if (dog == null) return HttpNotFound(); SetDogViewBag(dog); var feedingEntries = _dogFeedingRepo.Where(i => i.DogProfileID == dog.ProfileID).ToList(); return View(feedingEntries); }
public virtual ActionResult Edit(DogProfile model) { if (!ModelState.IsValid) return View(model); _dogRepo.Update(model); return RedirectToAction("DogProfile", new { id = model.ProfileID }); }
public virtual ActionResult Create(DogProfile dog) { var model = new DogNote { DogProfileID = dog.ProfileID }; SetDogViewBag(dog); ViewBag.NoteTypeSelectList = new SelectList(_noteTypeRepo.GetAll(), "ID", "Name", model.NoteTypeId); return View(model); }
public DogProfile(DogProfile dogProfile) { InitWithDogProfile(dogProfile); }
public virtual ActionResult Index(DogProfile dog) { var model = _dogCertificationRepo .Where(i => i.DogProfileID == dog.ProfileID) .OrderBy(i => i.Name); SetDogViewBag(dog); return View(model); }
public DogProfile(DogProfile dogProfile) { InitWithDogProfile(dogProfile); }
private void InitWithDogProfile(DogProfile dogProfile) { ProfileID = dogProfile.ProfileID; Name = dogProfile.Name; Breed = dogProfile.Breed; BirthYear = dogProfile.BirthYear; Color = dogProfile.Color; Gender = dogProfile.Gender; PickedUpDate = dogProfile.PickedUpDate; IsFixed = dogProfile.IsFixed; GraduationDate = dogProfile.GraduationDate; CreatedTimeUTC = dogProfile.CreatedTimeUTC; CreatedByUserID = dogProfile.CreatedByUserID; IsApproved = dogProfile.IsApproved; LocationId = dogProfile.LocationId; HealthCondition = dogProfile.HealthCondition; DogEvents = dogProfile.DogEvents; DogMedicalRecords = dogProfile.DogMedicalRecords; DogNotes = dogProfile.DogNotes; DogSkills = dogProfile.DogSkills; Location = dogProfile.Location; Images = dogProfile.Images; DogMedications = dogProfile.DogMedications; LocationDescription = dogProfile.LocationDescription; }
protected void SetDogViewBag(DogProfile dog) { ViewBag.DogId = dog.ProfileID; ViewBag.DogName = dog.Name; }
public ActionResult CreateOrUpdateDog(DogProfile dogProfile) { throw new NotImplementedException(); }
public DogProfileViewModel(DogProfile dogProfile) : base(dogProfile) { }
public ActionResult Index(DogProfile dog) { if (dog == null) return HttpNotFound(); var meds = _dogMedicationRepo.Where(i => i.DogProfileID == dog.ProfileID).OrderByDescending(i => i.EndDate).ToList(); SetDogViewBag(dog); return View(meds); }