public int Add(ActivityHistory aHisObj, bool doSubmit = true) { aHisObj.ActivityID = (int)Act; //Set lastmodified fields aHisObj.UserID = Usr.ID; aHisObj.UserText = Usr.Name; aHisObj.ActDateTime = DateTime.Now; dbc.ActivityHistories.InsertOnSubmit(aHisObj); if(doSubmit) dbc.SubmitChanges(); return aHisObj.ID; // Return the 'newly inserted id' }
public bool Delete(ActivityHistory aHisObj) { dbc.Users.DeleteOnSubmit(dbc.Users.Single(c => c.ID == aHisObj.ID)); dbc.SubmitChanges(); return true; }
partial void DeleteActivityHistory(ActivityHistory instance);
partial void UpdateActivityHistory(ActivityHistory instance);
partial void InsertActivityHistory(ActivityHistory instance);
private void detach_ActivityHistories(ActivityHistory entity) { this.SendPropertyChanging(); entity.Users = null; }
private void attach_ActivityHistories(ActivityHistory entity) { this.SendPropertyChanging(); entity.MasterActivity = this; }