コード例 #1
0
ファイル: XemAnh.cs プロジェクト: donghaibuih/Image-Viewer
        public void hienThongTin(String duongDan)
        {
            try
            {
                TheLoai theLoai = new TheLoai();
                Album   alBum   = new Album();
                HinhAnh anh     = new HinhAnh();
                HinhAnh anh2    = new HinhAnh();
                panelChinhSua.Visible = true;

                textTen.Text     = duongDan;
                anh2             = anh.layHinhTheoDuongDan(duongDan);
                textTen.Text     = anh2.TenHinh;
                textTheLoai.Text = "";
                textAlbum.Text   = "";
                textGhiChu.Text  = anh2.GhiChu;

                if (anh2.MaTheLoai != null)
                {
                    String tenTheLoai = theLoai.layTheLoaiTheoMaTheLoai(anh2.MaTheLoai).TenTheLoai;
                    textTheLoai.Text = tenTheLoai;
                }
                if (anh2.MaAlbum != null)
                {
                    String tenAlbum = alBum.layAlbumTheoMaAlbum(anh2.MaAlbum).TenAlbum;
                    textAlbum.Text = tenAlbum;
                }
            }
            catch (Exception)
            {
            }
        }
コード例 #2
0
        void pic_Click(object sender, EventArgs e)
        {
            PictureBox pic        = (PictureBox)sender;
            String     tenTheLoai = "";
            String     tenAlbum   = "";
            HinhAnh    anh        = new HinhAnh();
            TheLoai    theLoai    = new TheLoai();
            Album      alBum      = new Album();

            anh = anh.layHinhTheoDuongDan(pic.Name);
            if (anh.MaTheLoai != null)
            {
                try
                {
                    tenTheLoai = theLoai.layTheLoaiTheoMaTheLoai(anh.MaTheLoai).TenTheLoai;
                }
                catch (Exception)
                {
                }
            }

            if (anh.MaAlbum != null)
            {
                try
                {
                    tenAlbum = alBum.layAlbumTheoMaAlbum(anh.MaAlbum).TenAlbum;
                }
                catch (Exception)
                {
                }
            }


            piHinhAnhFull.Image = pic.Image;

            labelTenAnh.Text      = anh.TenHinh;
            panelThongTin.Visible = true;
            labelTheLoai.Text     = tenTheLoai;
            labelAlbum.Text       = tenAlbum;
        }