Beispiel #1
0
        public void Destroy(Cash product)
        {
            var entity = new Cash();

            entity.ID = product.ID;

            entities.Cash.Attach(entity);

            entities.Cash.Remove(entity);

            entities.SaveChanges();
        }
Beispiel #2
0
        public void Update(Cash product)
        {
            var entity = new Cash();
            entity.Datetime = product.Datetime;
            entity.Costs = product.Costs;
            entity.Income = product.Income;
            entity.Cashless = product.Cashless;
            entity.Result = product.Result;

            entities.Cash.Attach(entity);
            entities.Entry(entity).State = EntityState.Modified;
            entities.SaveChanges();
        }
Beispiel #3
0
        public void Create(Cash product)
        {
            var entity = new Cash();

            entity.Datetime= product.Datetime;
            entity.Costs = product.Costs;
            entity.Income = product.Income;
            entity.Cashless = product.Cashless;
            entity.Result = product.Result;

            entities.Cash.Add(entity);
            entities.SaveChanges();

            product.ID = entity.ID;
        }