コード例 #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;
            }
            #endregion

            try
            {
                var obj = new CountryInfo();
                obj.CouId  = txtId.Value;
                obj.NameCo = txtName.Text;
                obj.Status = chkActive.Checked ? "1" : "0";
                if (_insert == true)
                {
                    CountryService.Country_Insert(obj);
                }
                else
                {
                    CountryService.Country_Update(obj);
                }
                BindGrid();
                LoadFilterNewsNameAutocomplete();
                pnView.Visible   = true;
                pnUpdate.Visible = false;
                _insert          = false;
            }
            catch (Exception ex)
            {
                WebMsgBox.Show(ex.Message);
            }
        }