Beispiel #1
0
        /// <summary>
        /// Basic Delete Method
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="supplierId"></param>
        /// <param name="companyId"></param>
        public void RemoveContact(Contact entity, Int32 supplierId, Int32 companyId)
        {
            var scManager = new SuppliersContactManager(this);
            var sc        = new SupplierContact
            {
                SupplierId = supplierId,
                ContactId  = entity.ContactId
            };

            scManager.Delete(sc);

            var contactManager = new ContactManager(this);

            contactManager.Delete(entity);
        }
Beispiel #2
0
        /// <summary>
        /// Basic Insert Method
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="companyId"></param>
        /// <param name="supplierId"></param>
        public void AddContact(Contact entity, Int32 companyId, Int32 supplierId)
        {
            var contactManager = new ContactManager(this);

            entity.CompanyId = companyId;
            contactManager.Insert(entity);

            var scManager = new SuppliersContactManager(this);
            var sc        = new SupplierContact();

            sc.SupplierId = supplierId;
            sc.ContactId  = entity.ContactId;
            sc.CompanyId  = companyId;
            scManager.Insert(sc);
        }