private void RemplirDetailleFromSearch(IRemoteBibliotheque.Ouvrage ouvrage)
        {
            pictureBox1.Image = Image.FromFile(ouvrage.Image);

            Titre.Text  = "Titre : " + ouvrage.Titre;
            Auteur.Text = "Auteur : " + ouvrage.Auteur;
            Fiche.Text  = "Fiche descriptive : " + ouvrage.Fiche_descriptive;
            Theme.Text  = "Theme  : " + ouvrage.Theme;
            Type.Text   = "Type d'ouvrage : " + ouvrage.Type;
            string stat;

            if (ouvrage.Statut)
            {
                stat = "Ouvrage Reservé";
            }
            else
            {
                stat = "Ouvrage Disponible";
            }
            statut.Text = "Statut : " + stat;

            if (ouvrage.Statut)
            {
                reserver.Text = "Inscrire a la liste d'attente ";
            }

            else
            {
                reserver.Text = "Reserver";
            }
        }
        private EmpService.Ouvrage TransoformerOuvrage(IRemoteBibliotheque.Ouvrage ouvrage)
        {
            EmpService.Ouvrage result = new EmpService.Ouvrage();
            result.Code_barre        = ouvrage.Code_barre;
            result.Titre             = ouvrage.Titre;
            result.Auteur            = ouvrage.Auteur;
            result.Fiche_descriptive = ouvrage.Fiche_descriptive;
            result.Theme             = ouvrage.Theme;
            result.Image             = ouvrage.Image;
            result.Type   = ouvrage.Type;
            result.Statut = ouvrage.Statut;

            return(result);
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Code.Text) || string.IsNullOrEmpty(Titre.Text) || string.IsNullOrEmpty(Auteur.Text) ||

                string.IsNullOrEmpty(Fiche.Text) || string.IsNullOrEmpty(Theme.Text) || string.IsNullOrEmpty(Type.Text))
            {
                MessageBox.Show("il faut remplir tout les champs");
            }

            else
            {
                IRemoteBibliotheque.Ouvrage ouvrage = new IRemoteBibliotheque.Ouvrage();

                ouvrage.Code_barre        = int.Parse(Code.Text.ToString().Trim());
                ouvrage.Titre             = Titre.Text.ToString().Trim();
                ouvrage.Auteur            = Auteur.Text.ToString().Trim();
                ouvrage.Fiche_descriptive = Fiche.Text.ToString().Trim();
                ouvrage.Theme             = Theme.Text.ToString().Trim();
                ouvrage.Type = Type.Text.ToString().Trim();

                bool update = Session.obj.Modifier_Ouvrage(ouvrage, CodeBarre);

                if (update)
                {
                    MessageBox.Show("ouvrage modifié avec succès");
                    Code.Text   = Convert.ToString(ouvrage.Code_barre);
                    Titre.Text  = ouvrage.Titre;
                    Auteur.Text = ouvrage.Auteur;
                    Fiche.Text  = ouvrage.Fiche_descriptive;
                    Theme.Text  = ouvrage.Theme;
                    Type.Text   = ouvrage.Type;
                    CodeBarre   = ouvrage.Code_barre;
                }

                else
                {
                    MessageBox.Show("erreur lors de la modification de cet ouvrage ");
                }
            }
        }
        public Detaille_Ouvrage(IRemoteBibliotheque.Ouvrage ouvrage)
        {
            InitializeComponent();

            RemplirDetailleFromSearch(ouvrage);
        }