예제 #1
0
        /* ************ Partners *********** */
        //public int SumPartnersFromOwner(int ownerId)
        //{
        //    return GetPartner().Count(x => x.OwnerId == ownerId);
        //}

        public void AddPartner(PartnerDbModel partner)
        {
            using (registry = new RegistryModel())
            {
                registry.partners.Add(partner);
                registry.SaveChanges();
            }
        }
예제 #2
0
 public void UpdatePartner(PartnerDbModel chosenPartner)
 {
     using (registry = new RegistryModel())
     {
         var updatePartner = registry.partners.FirstOrDefault(x => x.ID == chosenPartner.ID);
         updatePartner.Name     = chosenPartner.Name;
         updatePartner.CountyId = chosenPartner.CountyId;
         updatePartner.OwnerId  = chosenPartner.OwnerId;
         updatePartner.TypeId   = chosenPartner.TypeId;
         updatePartner.ZipCode  = chosenPartner.ZipCode;
         updatePartner.City     = chosenPartner.City;
         updatePartner.Address  = chosenPartner.Address;
         registry.SaveChanges();
     }
 }