public static Vendor CreateOrUpdate(long vdId, string code, string name, string dealerCode, Contact contact) { Vendor vd = VendorDAO.GetVendor(vdId); if (vd == null) vd = VendorDAO.GetVendor(code, dealerCode); if (contact == null) contact = new Contact(); if (vd == null) { vd = new Vendor(); vd.Contact = new Contact(); vd.DealerCode = dealerCode; DC.Vendors.InsertOnSubmit(vd); } vd.Code = code; vd.Name = name; vd.Contact.AdditionalInfo = contact.AdditionalInfo; vd.Contact.Address = contact.Address; vd.Contact.Email = contact.Email; vd.Contact.FullName = contact.FullName; vd.Contact.Phone = contact.Phone; vd.Contact.Mobile = contact.Mobile; vd.Contact.Fax = contact.Fax; DC.SubmitChanges(); return vd; }
private void detach_Vendors(Vendor entity) { this.SendPropertyChanging(); entity.Contact = null; }
private void attach_Vendors(Vendor entity) { this.SendPropertyChanging(); entity.Contact = this; }
private void detach_Vendors(Vendor entity) { this.SendPropertyChanging("Vendors"); entity.Dealer = null; }
private void attach_Vendors(Vendor entity) { this.SendPropertyChanging("Vendors"); entity.Dealer = this; }