예제 #1
0
        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();
        }
예제 #2
0
        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);
        }