Пример #1
0
        private void lbl_matruyen_TextChanged(object sender, EventArgs e)
        {
            var dt = ExecSQL.ExecProcedureDataFirstOrDefaultAsync <TenTruyen>("pro_get_tentruyen", new { option = 2, matruyen = lbl_matruyen.Text });

            if (dt == null)
            {
                return;
            }
            lbl_tuatruyen.Text   = dt.tuatruyen;
            lbl_tentruyen.Text   = dt.tentruyen;
            lbl_hinhthuc.Text    = dt.loaibia;
            lbl_ngayxuatban.Text = dt.ngayxuatban.ToString();

            lbl_loaitruyen.Text = dt.loaitruyen;
            lbl_tacgia.Text     = dt.tacgia;
            lbl_tap.Text        = dt.tap.ToString();
            lbl_nhaxuatban.Text = dt.nhaxuatban;
            lbl_xuatxu.Text     = dt.quocgia;
            string strNewDirPath = Application.StartupPath + "\\img\\origin\\" + lbl_matua.Text + "\\" + lbl_matruyen.Text + ".jpg";

            if (File.Exists(strNewDirPath))
            {
                pictureEdit1.Image = ReadImageToStream(strNewDirPath);
            }
            else
            {
                pictureEdit1.Image = Image.FromFile(Application.StartupPath + "\\img\\origin\\default.jpg");
            }
        }