public LibrariansManagementWindow(librarian m) { InitializeComponent(); curLibrarian = m; IsEdit = true; Title = "Изменить библиотекаря"; PControl.SetPerson(m.person); newLibrarian = new librarian(); }
/// <summary> /// Deprecated Method for adding a new object to the librarians EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTolibrarians(librarian librarian) { base.AddObject("librarians", librarian); }
/// <summary> /// Create a new librarian object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="personId">Initial value of the PersonId property.</param> public static librarian Createlibrarian(global::System.Int64 id, global::System.Int64 personId) { librarian librarian = new librarian(); librarian.Id = id; librarian.PersonId = personId; return librarian; }
public void DeleteLibrarian(librarian l) { CheckConnection(); try { lock (locker) { DeletePerson(l.person); db.SaveChanges(); } } catch (Exception ex) { throw new DBException(ErrorTypes.UnexpectedException, ex); } }
public void EditLibrarian(librarian l, person p) { CheckConnection(); try { lock (locker) { EditPerson(l.person, p.First_Name, p.Last_Name, p.Middle_Name, p.Birthday, p.H_Phone, p.M_Phone, p.Address, p.Email, p.SomeInformation, p.Photo); db.SaveChanges(); } } catch (Exception ex) { throw new DBException(ErrorTypes.UnexpectedException, ex); } }