Ejemplo n.º 1
0
 public ModifyMembers(object _previousContent, LibraryMembers data)
 {
     InitializeComponent();
     libraryMember   = data;
     previousContent = _previousContent;
     TextBox.Text    = libraryMember.Name;
 }
        public PageMembers(object _previousContent, LibraryMembers list)
        {
            InitializeComponent();
            previousContent = _previousContent;
            MemberName.Text = list.Name;
            //if(data.Availability)? Text_Availiblity.Text = "Avalable" : Text_Availiblity.Text = "Not Avalable";

            //mediainfo = data;
        }
 //--------------Member Info Button-----------
 private void MemberInfo(object sender, RoutedEventArgs e)
 {
     if (MemberName.SelectedItem != null)
     {
         //MediaInfo mediainfo = (MediaInfo)peopleGrid.SelectedItems[0];
         object         currentContent = this.Content;
         LibraryMembers list           = (LibraryMembers)MemberName.SelectedItems[0];
         PageMembers    page           = new PageMembers(currentContent, list);
         this.Content = page;
     }
 }
Ejemplo n.º 4
0
 private void Click_ModifyMember(object sender, RoutedEventArgs e)
 {
     if ((LibraryMembers)PeopleName.SelectedItem != null)
     {
         object         currentContent = this.Content;
         LibraryMembers librarydata    = (LibraryMembers)PeopleName.SelectedItem;
         ModifyMembers  newPage        = new ModifyMembers(currentContent, librarydata);
         this.Content = newPage;
     }
     else
     {
         showErrorDialoge("Please select the member");
     }
 }
        //----------LendMedia Button Starts-----------
        private void LendMedia(object sender, RoutedEventArgs e)
        {
            if ((Media)BookRecord.SelectedItem != null || (LibraryMembers)MemberName.SelectedItem != null)
            {
                Media          mediaList   = (Media)BookRecord.SelectedItem;
                LibraryMembers membersList = (LibraryMembers)MemberName.SelectedItem;

                if (mediaList.Availability)
                {
                    showErrorDialoge(" Sorry! This Media is unavailable.");
                }
                else
                {
                    mediaList.Availability = !(mediaList.Availability);
                    mediaList.Borrower     = membersList.Name;
                    RefreshDataGrid();
                }
            }
            else
            {
                showErrorDialoge("Please Select Both Member and Media Options");
            }
        }
Ejemplo n.º 6
0
        private void Click_LendMedia(object sender, RoutedEventArgs e)
        {
            if ((Media)GridBook.SelectedItem != null || (LibraryMembers)PeopleName.SelectedItem != null)
            {
                Media          mediaList   = (Media)GridBook.SelectedItem;
                LibraryMembers membersList = (LibraryMembers)PeopleName.SelectedItem;

                if (mediaList.Availability)
                {
                    showErrorDialoge(" Media is unavailable.");
                }
                else
                {
                    mediaList.Availability = !(mediaList.Availability);
                    mediaList.Borrower     = membersList.Name;
                    RefreshDataGrid();
                }
            }
            else
            {
                showErrorDialoge("Please select the both member and media options");
            }
        }