public static OtakimDTO ConvertOtakimToDTO(Otakim otek) { return(new OtakimDTO { codeOtek = otek.codeOtek, codeBook = otek.codeBook, Serial = otek.Serial, price = otek.price, status = otek.status, bookName = otek.Book.name }); }
public static bool updateOtekStatus(int code, string status) { using (libraryEntities db = new libraryEntities()) { Otakim b = db.Otakims.First(x => x.codeOtek == code); b.status = status; try { db.SaveChanges(); return(true); } catch (Exception e) { return(false); } } }