Пример #1
0
 //РЕДАКТИРОВАТЬ Автора
 public static bool AuthorEdit(Authors authorEdit, Authors authorEditor, TableContext tableContext)
 {
     try
     {
         if (authorEdit != authorEditor)
         {
             authorEdit = authorEditor;
         }
         tableContext.Entry(authorEdit).State = EntityState.Modified;
         tableContext.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         MessageBox.Show("Потеряно соеденение с сервером.");
         return(false);
     }
 }
Пример #2
0
 public static bool ExpositionEdit(Expositions expEdit, Expositions expEditor, TableContext tableContext)
 {
     try
     {
         if (expEdit != expEditor)
         {
             expEdit = expEditor;
         }
         tableContext.Entry(expEdit).State = EntityState.Modified;
         tableContext.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         MessageBox.Show("Потеряно соеденение с сервером.");
         return(false);
     }
 }
Пример #3
0
 //РЕДАКТИРОВАТЬ КАРТИНУ
 public static bool PicturesEdit(Pictures picturesEdit, Pictures picturesEditor, TableContext tableContext)
 {
     try
     {
         if (picturesEdit != picturesEditor)
         {
             picturesEdit = picturesEditor;
         }
         tableContext.Entry(picturesEdit).State = EntityState.Modified;
         tableContext.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         MessageBox.Show("Потеряно соеденение с сервером.");
         return(false);
     }
 }