public void Update(DataAccess.Model.Bank bank) { CMS_DataContext context = new CMS_DataContext(); var acct = context.Accounts.Where(x => x.Id == bank.Id).FirstOrDefault(); acct.Name = bank.Name; context.SubmitChanges(); }
public Guid Create(DataAccess.Model.Bank bank) { CMS_DataContext context = new CMS_DataContext(); var acct = new DataAccess.Account() { Id = Guid.NewGuid(), Name = bank.Name, Category = "BALANCE", Type = "ASSET", Code = "BANK" }; context.Accounts.InsertOnSubmit(acct); context.SubmitChanges(); return(acct.Id); }