Пример #1
0
        private void BindData()
        {
            if (dataManager.CheckFilmUsed(film) == true)
            {
                txtFilmLength.Enabled = true;
            }
            else
            {
                txtFilmLength.Enabled = false;
            }

            txtFilmLength.DataBindings.Add("Text", film, "FilmLength", true);


            txtRatio.DataBindings.Add("Text", film, "Ratio", true);
            txtRatio.DataBindings["Text"].Format += TextBox_Ratio_Format;
            txtRatio.DataBindings["Text"].Parse  += TextBox_Ratio_Parse;


            txtFilmId.DataBindings.Add("Text", film, "FilmId", true);
            txtFilmCode.DataBindings.Add("Text", film, "FilmCode", true);
            dtpPublishDate.DataBindings.Add("Value", film, "PublishDate", true);
            dtpStartDate.DataBindings.Add("Value", film, "StartDate", true);
            dtpEndDate.DataBindings.Add("Value", film, "EndDate", true);
            txtPubilsher.DataBindings.Add("Text", film, "Publisher", true);
            txtProducer.DataBindings.Add("Text", film, "Producer", true);
            txtDirector.DataBindings.Add("Text", film, "Director", true);

            txtLowestPrice.DataBindings.Add("Text", film, "LowestPrice", true);
            txtLowestPrice.DataBindings["Text"].Format += TextBox_Currency_Format;

            // txtPoster.DataBindings.Add("Text", film, "Ratio", true);
            txtBrief.DataBindings.Add("Text", film, "Brief", true);
            txtCast.DataBindings.Add("Text", film, "Cast", true);

            if (film.HasMode != null)
            {
                rbIsHrbIsHashMode_Yes.Checked = Convert.ToBoolean(film.HasMode);
            }
        }