Esempio n. 1
0
        public void Destroy(VersionsViewModel db)
        {
            var entity = new Versions_Table();

            entity.VersionsID = db.VersionsID;

            entities.Versions_Table.Attach(entity);

            entities.Versions_Table.Remove(entity);

            entities.SaveChanges();
        }
Esempio n. 2
0
        public void Create(VersionsViewModel db)
        {
            var entity = new Versions_Table();

            entity.VersionsName    = db.VersionsName;
            entity.VersionsDate    = (DateTime)db.VersionsDate.Date;
            entity.PartnerName     = db.PartnerName;
            entity.VersionsNumbers = db.VersionsNumbers;
            entity.TypesOfCopies   = db.TypesOfCopies;
            entity.url             = db.url;
            entity.UserID          = db.UserID;
            entity.ProjectID       = db.ProjectID;
            entities.Versions_Table.Add(entity);
            entities.SaveChanges();

            db.VersionsID = entity.VersionsID;
        }
Esempio n. 3
0
        public void Update(VersionsViewModel db)
        {
            var entity = new Versions_Table();

            entity.VersionsID = db.VersionsID;

            entity.VersionsName    = db.VersionsName;
            entity.VersionsDate    = (DateTime)db.VersionsDate.Date;
            entity.PartnerName     = db.PartnerName;
            entity.VersionsNumbers = db.VersionsNumbers;
            entity.TypesOfCopies   = db.TypesOfCopies;
            entity.url             = db.url;
            entity.UserID          = db.UserID;
            entity.ProjectID       = db.ProjectID;
            entities.Versions_Table.Attach(entity);
            entities.Entry(entity).State = EntityState.Modified;
            entities.SaveChanges();
        }