Пример #1
0
        public void DeleteAttachements(AttachmentsEntity attachementsEntity)
        {
            attachements result = (from x in db.attachements
                                   where x.attachement_id == attachementsEntity.AttachementId
                                   select x).SingleOrDefault();

            db.attachements.Remove(result);
            db.SaveChanges();
        }
Пример #2
0
        public void UpdateAttachements(AttachmentsEntity attachementsEntity)
        {
            attachements result = (from x in db.attachements
                                   where x.attachement_id == attachementsEntity.AttachementId
                                   select x).SingleOrDefault();

            result.attachement_id = attachementsEntity.AttachementId;
            result.bezeichnung    = attachementsEntity.Bezeichnung;
            result.filename       = attachementsEntity.Filename;
            result.hauspaket_id   = attachementsEntity.HauspaketId;
            result.mimetype       = attachementsEntity.Mimetype;
            result.size           = attachementsEntity.Size;

            db.SaveChanges();
        }
Пример #3
0
        public void InsertAttachements(AttachmentsEntity attachementsEntity)
        {
            attachements h = new attachements()
            {
                attachement_id = attachementsEntity.AttachementId,
                bezeichnung    = attachementsEntity.Bezeichnung,
                filename       = attachementsEntity.Filename,
                hauspaket_id   = attachementsEntity.HauspaketId,
                mimetype       = attachementsEntity.Mimetype,
                size           = attachementsEntity.Size
            };

            db.attachements.Add(h);
            db.SaveChanges();
        }