Ejemplo n.º 1
0
        public virtual bool Equals(DiveShop obj)
        {
            if (obj == null) return false;

              if (Equals(Notes, obj.Notes) == false)
            return false;

              return true;
        }
Ejemplo n.º 2
0
 public void Delete(DiveShop diveShop)
 {
     try {
     DiveShopRepository.Delete(diveShop);
     DiveShopRepository.DbContext.CommitChanges();
       } catch (Exception e) {
     log.Error("Cound not delete dive shop. Something else probably references this dive shop", e);
     throw e;
       }
       return;
 }
Ejemplo n.º 3
0
        public DiveShop Save(DiveShop diveShop)
        {
            try {
            //DiveShop.LastModifed = System.DateTime.Now;

            DiveShopRepository.SaveOrUpdate(diveShop);
            DiveShopRepository.DbContext.CommitChanges();
              } catch (Exception e) {
            log.Error("Unable to save dive shop ", e);
            throw e;
              }
              return diveShop;
        }
Ejemplo n.º 4
0
        private void saveNewContact(ContactModel model)
        {
            this.user = userServices.FindUser(this.User.Identity.Name);
              Contact contact = new Contact();
              contact = UpdateContactFromModel(contact, model);
              contact.User = this.user;
              contact.Created = DateTime.Now;
              contact.LastModified = DateTime.Now;
              contactServices.Save(contact);

              if (model.isDiver) {
            Diver diver = new Diver();
            diver.Contact = contact;
            diverServices.Save(diver);
              }
              if (model.isInstructor) {
            Instructor instructor = new Instructor();
            instructor.Contact = contact;
            instructorServices.Save(instructor);
              }

              if (model.isAgency) {
            DiveAgency agency = new DiveAgency();
            agency.Contact = contact;
            diveAgencyServices.Save(agency);
              }

              if (model.isManufacturer) {
            Manufacturer manufacturer = new Manufacturer();
            manufacturer.Contact = contact;
            manufacturerServices.Save(manufacturer);
              }

              if (model.isDiveShop)
              {
            DiveShop diveShop = new DiveShop();
            diveShop.Contact = contact;
            diveShopServices.Save(diveShop);
              }
        }