public bool save() { AccountHolderDataClassesDataContext dc = new AccountHolderDataClassesDataContext(); if (this.id > 0) { Transcript transcript = dc.Transcripts.Single(t => t.id == this.id); // Todo dc.SubmitChanges(); } else { this.transacted_at = DateTime.Now; dc.Transcripts.InsertOnSubmit(this); dc.SubmitChanges(); } return(true); }
public bool save() { AccountHolderDataClassesDataContext dc = new AccountHolderDataClassesDataContext(); if (this.id > 0) { AccountHolder accountHolder = dc.AccountHolders.Single(a => a.id == this.id); accountHolder.account_number = this.account_number; accountHolder.account_type = this.account_type; accountHolder.balance = this.balance; accountHolder.client_id = this.client_id; dc.SubmitChanges(); } else { dc.AccountHolders.InsertOnSubmit(this); } return(true); }