partial void DeleteJOB(JOB instance);
partial void UpdateJOB(JOB instance);
partial void InsertJOB(JOB instance);
private void detach_JOB(JOB entity) { this.SendPropertyChanging(); entity.PERSON = null; }
private void attach_JOB(JOB entity) { this.SendPropertyChanging(); entity.PERSON = this; }
/*This method means the method InsertOnSubmit status insert data into a pending state, * then the method SubmitChanges performs the necessary changes within the database, this method requires the necessary arguments for entering data, * all the while using the class that exposes all ContactDataContext methods * needed in the iteration with the data as we shall see in subsequent methods. */ public static void InsertData(string name, string surname, string address, string zipcode, string city, string state, string activity) { using (var ctx = new ContactDataContext(Properties.Settings.Default.path)) { var newperson = new PERSON { NAME = name.ToUpper(), SURNAME = surname.ToUpper(), ADDRESS = address.ToUpper(), ZIPCODE = zipcode.ToUpper(), CITY = city.ToUpper() }; ctx.PERSON.InsertOnSubmit(newperson); ctx.SubmitChanges(); var newjob = new JOB { IDPERSON = newperson.ID, STATE = state, ACTIVITY = activity }; ctx.JOB.InsertOnSubmit(newjob); ctx.SubmitChanges(); } }