Exemple #1
0
        protected void lbtUpdateB_Click(object sender, EventArgs e)
        {
            #region [TestInput]
            if (txtName.Text.Trim().Equals(""))
            {
                WebMsgBox.Show("Name not null !");
                txtName.Focus();
                return;
            }
            if (txtDirector.Text.Trim().Equals(""))
            {
                WebMsgBox.Show("Director not null !");
                txtDirector.Focus();
                return;
            }
            if (txtActor.Text.Trim().Equals(""))
            {
                WebMsgBox.Show("Actor not null !");
                txtActor.Focus();
                return;
            }
            if (txtDuration.Text.Trim().Equals(""))
            {
                WebMsgBox.Show("Duration not null !");
                txtDuration.Focus();
                return;
            }
            if (txtPicture.Text.Trim().Equals(""))
            {
                WebMsgBox.Show("Picture not null !");
                txtPicture.Focus();
                return;
            }
            #endregion

            try
            {
                FilmInfo obj = new FilmInfo();
                obj.FilId       = txtId.Value;
                obj.TypId       = ddlTypId_Update.SelectedValue;
                obj.CouId       = ddlCouId_Update.SelectedValue;
                obj.NameF       = txtName.Text;
                obj.Director    = txtDirector.Text;
                obj.Actor       = txtActor.Text;
                obj.Duration    = txtDuration.Text;
                obj.Description = FCKeditorDescription.Value;
                obj.Detail      = FCKeditorDetail.Value;
                obj.Picture     = txtPicture.Text;
                obj.PictureBig  = txtPictureBig.Text;
                obj.Status      = chkActive.Checked ? "1" : "0";
                if (_insert == true)
                {
                    FilmService.Film_Insert(obj);
                }
                else
                {
                    FilmService.Film_Update(obj);
                }
                BindGrid();
                pnView.Visible   = true;
                pnUpdate.Visible = false;
                _insert          = false;
            }
            catch (Exception ex)
            {
                WebMsgBox.Show(ex.Message);
            }
        }