Ejemplo n.º 1
0
        public void Create(InStore dpt)
        {
            using (var ctx = new LYLQEntities())
            {
                ctx.InStores.Add(dpt);

                ctx.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        public void OutStore(InStore dpt)
        {
            using (var ctx = new LYLQEntities())
            {
                var dbInsts = from dbInst in ctx.InStores
                              where dbInst.Id == dpt.Id
                              select dbInst;

                var dbModelInSt = dbInsts.First();
                dbModelInSt.RemainNumber = dpt.RemainNumber;
                dbModelInSt.RemainTotalPrice = dpt.RemainTotalPrice;
                dbModelInSt.UpdatedBy = dpt.UpdatedBy;
                dbModelInSt.UpdatedDate = DateTime.Now;

                ctx.SaveChanges();
            }
        }