//РЕДАКТИРОВАТЬ Автора 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); } }
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); } }
//РЕДАКТИРОВАТЬ КАРТИНУ 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); } }