Exemple #1
0
 public void Add(TranslationModel p_entity)
 {
     using (var db = new MES_DATABASE())
     {
         db.TRA_TranslationState.Add(MapperTranslation.MapTranslationToTra(p_entity));
         db.SaveChanges();
     }
 }
Exemple #2
0
        public void Edit(TranslationModel p_entity)
        {
            var Temp = MapperTranslation.MapTranslationToTra(p_entity);

            using (var db = new MES_DATABASE())
            {
                if (!db.TRA_TranslationState.Local.Any(c => c.ID_TRA == p_entity.ID_TRA))
                {
                    db.TRA_TranslationState.Attach(Temp);
                    db.Entry(Temp).State = EntityState.Modified;
                }
                db.SaveChanges();
            }
        }