예제 #1
0
        private void pbItemPicture_DoubleClick(object sender, EventArgs e)
        {
            FrmPicture frm = new FrmPicture();

            frm.Model.Picture = lblItemPicture.Text;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                mModel.GetPropertyValue <string>(BOItem.PICTURE) = frm.Model.Picture;
                lblItemPicture.Text = mModel.GetPropertyValue <string>(BOItem.PICTURE);
                if (frm.Model.Picture.Equals(""))
                {
                    pbItemPicture.Image = null;
                }
                else
                {
                    string picture_path = mModel.GetPropertyValue <string>(BOItem.PICTURE_PATH);
                    if (System.IO.File.Exists(picture_path))
                    {
                        pbItemPicture.Load(picture_path);
                    }
                }
            }
        }
예제 #2
0
        private void pbItemPicture_DoubleClick(object sender, EventArgs e)
        {
            FrmPicture frm = new FrmPicture();

            frm.InitialPicture   = mModel.DefaultPicturePath;
            frm.PictureDirectory = mModel.DefaultPictureDirectory;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                lblPicture.Text = frm.ResultantPictureName;
                mModel.SetPropertyValue(BOItem.PICTURE, lblPicture.Text);
                if (string.IsNullOrEmpty(mModel.DefaultPicturePath))
                {
                    pbPicture.Image = null;
                }
                else
                {
                    string picture_path = mModel.DefaultPicturePath;
                    if (System.IO.File.Exists(picture_path))
                    {
                        pbPicture.Load(picture_path);
                    }
                }
            }
        }